/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Make images responsive by default */
img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 15px rgba(0,0,0,0.15);
    position: relative;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    order: 3;
}

.mobile-menu-toggle:hover {
    color: #ecf0f1;
}

/* Hide any duplicate mobile menu buttons */
.mobile-menu-btn {
    display: none !important;
    visibility: hidden !important;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: bold;
}

.logo span {
    color: #ecf0f1;
    font-weight: 300;
}

.nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
}

.nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav a:hover {
    color: #ecf0f1;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 2px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Hide user-menu buttons on mobile - they'll show in dropdown */
@media (max-width: 768px) {
    .user-menu {
        display: none;
    }
    
    .user-menu.active {
        display: flex;
    }
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-name-text {
    display: inline;
}

@media (max-width: 768px) {
    .user-name-text {
        display: none;
    }
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    min-height: 44px; /* Better touch target for mobile */
    touch-action: manipulation; /* Prevent double-tap zoom on mobile */
}

.btn-primary {
    background: #2c3e50;
    color: white;
    border: 2px solid #2c3e50;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    background: #34495e;
    border-color: #34495e;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(44, 62, 80, 0.3);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.2);
}

.btn-success {
    background: #2c3e50;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #1a1a1a;
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    z-index: 1;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.hero .container {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 900px;
    padding: 0 2rem;
}

.hero-content {
    text-align: center;
    color: white;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #ffffff;
    line-height: 1.2;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
    letter-spacing: -0.5px;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    color: #f0f0f0;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
    font-weight: 300;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Stats Section */
.stats {
    background: white;
    padding: 4rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.stat-item {
    text-align: center;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-item i {
    font-size: 3rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.stat-item h3 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #333;
}

.stat-item p {
    color: #666;
    font-size: 1.1rem;
}

/* Featured Pets Section */
.featured-pets {
    padding: 4rem 0;
    background: #f8f9fa;
}

.featured-pets h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.featured-pets > .container > p {
    text-align: center;
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 3rem;
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.filters select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    font-size: 1rem;
    min-width: 150px;
}

/* Pets Grid */
.pets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.pet-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pet-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.pet-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.pet-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.pet-card:hover .pet-image img {
    transform: scale(1.05);
}

.pet-status {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #2c3e50;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.pet-info {
    padding: 1.5rem;
}

.pet-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.pet-breed {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.pet-details {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.pet-details span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
    color: #666;
}

.pet-details i {
    color: #2c3e50;
}

.pet-description {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.pet-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pet-actions .btn {
    flex: 1;
    min-width: 120px;
    padding: 0.75rem;
    font-size: 0.9rem;
    min-height: 44px;
}

/* How It Works Section */
.how-it-works {
    padding: 4rem 0;
    background: white;
}

.how-it-works h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.step {
    text-align: center;
    padding: 2rem;
}

.step-icon {
    width: 80px;
    height: 80px;
    background: #2c3e50;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    transition: transform 0.3s ease;
}

.step:hover .step-icon {
    transform: scale(1.1);
    background: #34495e;
}

.step-icon i {
    font-size: 2rem;
    color: white;
}

.step h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.step p {
    color: #666;
    line-height: 1.6;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: #ecf0f1;
    font-weight: 600;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #ecf0f1;
}

.footer-bottom {
    border-top: 1px solid #555;
    padding-top: 1rem;
    text-align: center;
    color: #ccc;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    -webkit-appearance: none; /* Remove iOS default styling */
    appearance: none;
}

/* Prevent zoom on iOS when focusing input */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="url"],
    textarea,
    select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #2c3e50;
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

/* Alert Styles */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-wrap: nowrap;
        gap: 1rem;
    }
    
    .logo {
        flex: 1;
        min-width: 0;
    }
    
    .logo h1 {
        font-size: 1.5rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Mobile Menu Button - only show on mobile */
    .mobile-menu-toggle {
        display: block;
        order: 3;
        flex-shrink: 0;
        position: relative;
        margin-left: auto;
    }
    
    /* Ensure no duplicate menu buttons */
    .header-content .mobile-menu-toggle:not(:first-of-type) {
        display: none !important;
    }
    
    /* Hide navigation and user menu by default on mobile */
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #2c3e50;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease, opacity 0.3s ease;
        opacity: 0;
        z-index: 999;
        box-shadow: 0 5px 15px rgba(0,0,0,0.2);
        order: 4;
        width: 100%;
    }
    
    .nav.active {
        display: block;
        max-height: 800px;
        opacity: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 1rem;
    }
    
    .nav ul {
        flex-direction: column;
        padding: 1rem 0 1.5rem 0;
        gap: 0;
        width: 100%;
        margin: 0;
        list-style: none;
    }
    
    .nav ul li {
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        display: block;
        margin: 0;
    }
    
    .nav ul li:last-child {
        border-bottom: 1px solid rgba(255,255,255,0.1);
        margin-bottom: 0.5rem;
    }
    
    .nav ul li a {
        display: block;
        padding: 1.2rem 20px;
        width: 100%;
        color: white;
        text-decoration: none;
        font-weight: 500;
        min-height: 48px;
        line-height: 1.5;
    }
    
    .nav ul li a:hover {
        background-color: rgba(255,255,255,0.1);
    }
    
    /* Hide user menu by default on mobile - show only in dropdown */
    .user-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #2c3e50;
        flex-direction: column;
        align-items: stretch;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, top 0.3s ease;
        z-index: 998;
        box-shadow: 0 5px 15px rgba(0,0,0,0.2);
        width: 100%;
        padding: 0;
        order: 5;
        margin-top: 0;
    }
    
    .user-menu.active {
        display: flex;
        max-height: 500px;
        padding: 1rem 0;
    }
    
    /* Position user-menu to appear right after nav when nav is active */
    .nav.active ~ .user-menu {
        top: auto;
    }
    
    /* Calculate top position dynamically - nav height varies */
    .nav.active ~ .user-menu.active {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        border-top: 2px solid rgba(255,255,255,0.2);
    }
    
    .user-menu .user-info {
        padding: 0.5rem 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    
    .user-menu .btn {
        margin: 0.5rem 20px;
        width: calc(100% - 40px);
        text-align: center;
    }
    
    /* Hero Section */
    .hero {
        min-height: 60vh;
        padding: 2rem 0;
    }
    
    .hero-content h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .hero-content p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    .hero-video {
        min-width: 100%;
        min-height: 100%;
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-item {
        padding: 1.5rem 1rem;
    }
    
    .stat-item i {
        font-size: 2rem;
    }
    
    .stat-item h3 {
        font-size: 1.8rem;
    }
    
    /* Pets Grid */
    .pets-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Filters */
    .filters {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .filters select {
        width: 100%;
    }
    
    /* Pet Cards */
    .pet-actions {
        flex-direction: column;
    }
    
    .pet-actions .btn {
        width: 100%;
    }
    
    /* Steps */
    .steps-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Forms */
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Tables */
    .requests-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .requests-table table {
        min-width: 600px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
    
    /* Better spacing on mobile */
    .featured-pets,
    .how-it-works,
    .stats {
        padding: 2rem 0;
    }
    
    /* Page headers */
    .page-header {
        padding: 2rem 0 !important;
    }
    
    .page-header h1 {
        font-size: 2rem !important;
    }
    
    .page-header p {
        font-size: 1rem !important;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .logo h1 {
        font-size: 1.4rem;
    }
    
    /* Hero */
    .hero {
        min-height: 50vh;
        padding: 1.5rem 0;
    }
    
    .hero-content h1 {
        font-size: 1.75rem;
    }
    
    .hero-content p {
        font-size: 0.9rem;
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-item {
        padding: 1rem;
    }
    
    /* Buttons */
    .btn {
        padding: 0.65rem 1.25rem;
        font-size: 0.9rem;
    }
    
    /* Modal */
    .modal-content {
        margin: 5% auto;
        padding: 1.5rem;
        width: 95%;
    }
    
    /* Cards */
    .pet-card {
        margin-bottom: 1rem;
    }
    
    .pet-info {
        padding: 1rem;
    }
    
    /* Admin Dashboard */
    .admin-container {
        padding: 1rem 0;
    }
    
    .admin-header h1 {
        font-size: 1.8rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
    
    .action-card {
        padding: 1.5rem;
    }
    
    .action-card i {
        font-size: 2rem;
    }
    
    /* Forms */
    .form-container {
        padding: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Ensure mobile menu button is hidden on desktop - must come after mobile media query */
@media (min-width: 769px) {
    .header .mobile-menu-toggle,
    .header-content .mobile-menu-toggle,
    .mobile-menu-toggle {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
}
