/* ==================================================
   Layout Components
   ================================================== */

/* Container */
.container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1.2rem; /* FIXED: Consistent with mobile-optimized.css */
}

/* Tablet */
@media (min-width: 481px) {
    .container {
        padding: 0 1.6rem;
        max-width: 768px;
    }
}

/* Tablet landscape */
@media (min-width: 768px) {
    .container {
        padding: 0 2rem;
        max-width: 1024px;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .container {
        padding: 0 2.4rem;
        max-width: 1200px;
    }
}

/* Large screens */
@media (min-width: 1440px) {
    .container {
        padding: 0 3rem;
        max-width: 1400px;
    }
}

/* Ultra-wide screens */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
        padding: 0 4rem;
    }
}

/* Fluid Grid System */
.fluid-grid {
    display: grid;
    gap: var(--space-md);
    width: 100%;
    grid-template-columns: 1fr; /* Mobile first */
}

/* Tablet: 2 columns */
@media (min-width: 768px) {
    .fluid-grid-2 {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-lg);
    }
}

/* Desktop: 3 columns */
@media (min-width: 1024px) {
    .fluid-grid-3 {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-xl);
    }
    
    .fluid-grid-4 {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--space-lg);
    }
}

/* Auto-fit responsive columns */
.fluid-grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
}

@media (min-width: 1024px) {
    .fluid-grid-auto {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: var(--space-xl);
    }
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(16, 185, 129, 0.15);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.99);
    backdrop-filter: blur(25px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem; /* Mobile first - better padding */
    max-width: 1200px;
    margin: 0 auto;
    min-height: 65px; /* Slightly smaller for mobile */
    position: relative;
}

@media (min-width: 768px) {
    .header-container {
        padding: 1.5rem 2rem;
    }
}

/* Logo */
.logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.logo a {
    display: block;
    text-decoration: none;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease;
}

.logo-container:hover {
    transform: translateY(-1px);
}

.logo-icon {
    flex-shrink: 0;
    width: 40px; /* Consistent size */
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(16, 185, 129, 0.1));
    transition: filter 0.2s ease;
}

.logo-icon:hover {
    filter: drop-shadow(0 3px 6px rgba(16, 185, 129, 0.2));
}

.logo-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-text h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

@media (min-width: 768px) {
    .logo-container {
        gap: 1.2rem;
    }
    
    .logo-icon {
        width: 45px;
        height: 45px;
    }
    
    .logo-text h1 {
        font-size: 2.8rem;
    }
}

.tagline {
    font-size: 1rem;
    color: #6b7280;
    margin: 0;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: 0;
}

@media (min-width: 768px) {
    .tagline {
        font-size: 1.2rem;
    }
}

/* Desktop Navigation */
.main-nav {
    display: none; /* Hidden on mobile */
    flex: 1;
    justify-content: center;
    align-items: center;
    padding: 0 2rem;
}

@media (min-width: 1024px) {
    .main-nav {
        display: flex;
    }
}

.nav-list {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
    margin: 0;
    padding: 0;
}

@media (min-width: 1200px) {
    .nav-list {
        gap: 3rem;
    }
}

.nav-link {
    font-size: 1.5rem;
    font-weight: 500;
    color: #374151;
    padding: 1rem 0.5rem;
    position: relative;
    display: inline-block;
    text-decoration: none;
    transition: color 0.3s ease;
}

@media (min-width: 1200px) {
    .nav-link {
        font-size: 1.6rem;
        padding: 1rem 1rem;
    }
}

.nav-link:hover {
    color: #10b981;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: #10b981;
    border-radius: 1px;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: #10b981;
    font-weight: 600;
}

/* Mobile Menu Button - Enhanced for touch */
.mobile-menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: white;
    border: 2px solid #10b981;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    transition: all 0.2s ease;
    position: relative;
    flex-shrink: 0;
    /* Better touch response */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

@media (min-width: 1024px) {
    .mobile-menu-btn {
        display: none;
    }
}

.mobile-menu-btn:hover {
    background: #10b981;
    border-color: #059669;
}

.mobile-menu-btn:hover .hamburger-line {
    background-color: white;
}

.mobile-menu-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2.5px;
    background-color: #10b981;
    margin: 4px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
    transform-origin: center;
}

/* Enhanced hamburger animation when active */
.mobile-menu-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
    background-color: var(--primary-green);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
    background-color: var(--primary-green);
}

/* Enhanced Mobile Navigation - Optimized for touch */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile browsers */
    background: transparent;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overscroll-behavior: contain; /* Prevent body scroll when menu is open */
}

.mobile-nav.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav.active .mobile-nav-overlay {
    opacity: 1;
}

.mobile-nav-content {
    position: absolute;
    top: 0;
    right: 0;
    width: min(300px, 85vw); /* Slightly narrower for better UX */
    height: 100vh;
    height: 100dvh;
    background: var(--bg-white);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.mobile-nav.active .mobile-nav-content {
    transform: translateX(0);
}

/* Enhanced close button with better touch target */
.mobile-nav-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 48px; /* Larger touch target */
    height: 48px;
    background: none;
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.8rem;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mobile-nav-close:hover {
    background: var(--gray-100);
    color: var(--primary-green);
    border-color: rgba(16, 185, 129, 0.2);
}

.mobile-nav-close:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.mobile-nav-close:active {
    transform: scale(0.95);
    background: rgba(16, 185, 129, 0.1);
}

.mobile-nav-list {
    padding: 6rem 0 2rem; /* More top padding for close button */
    list-style: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mobile-nav-list li {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-nav-list li:last-child {
    border-bottom: none;
}

/* Enhanced mobile navigation links with better touch targets */
.mobile-nav-link {
    display: block;
    padding: 1.8rem 2rem; /* Larger touch area */
    font-size: 1.7rem;
    font-weight: 500;
    color: var(--gray-700);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    min-height: 56px; /* Ensure adequate touch target */
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mobile-nav-link:hover,
.mobile-nav-link:focus {
    color: var(--primary-green);
    background: rgba(16, 185, 129, 0.05);
    padding-left: 2.5rem;
}

.mobile-nav-link:active {
    background: rgba(16, 185, 129, 0.1);
    transform: scale(0.98);
}

.mobile-nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: var(--primary-green);
    transition: height 0.2s ease;
    border-radius: 0 2px 2px 0;
}

.mobile-nav-link:hover::before,
.mobile-nav-link:focus::before {
    height: 60%;
}

.mobile-nav-link.active {
    color: var(--primary-green);
    background: rgba(16, 185, 129, 0.08);
    font-weight: 600;
}

.mobile-nav-link.active::before {
    height: 80%;
}

/* Section Titles */
.section-title {
    text-align: center;
    color: var(--gray-800);
    margin-bottom: 4rem; /* Mobile first */
    position: relative;
    font-weight: 700;
    font-size: 2.8rem;
    letter-spacing: -1px;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .section-title {
        font-size: 3.6rem;
        margin-bottom: 5rem;
    }
}

@media (min-width: 1440px) {
    .section-title {
        font-size: 4.2rem;
    }
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 6rem;
    height: 0.4rem;
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-purple-dark) 100%);
    border-radius: 2px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

@media (min-width: 768px) {
    .section-title::after {
        width: 8rem;
    }
}

.section-title::before {
    content: '';
    position: absolute;
    bottom: -1.2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 10rem;
    height: 1rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-radius: 5px;
    z-index: -1;
}

@media (min-width: 768px) {
    .section-title::before {
        width: 12rem;
    }
}

/* Footer */
.footer {
    background-color: var(--gray-800);
    color: white;
    padding: 5rem 0 2rem; /* Mobile first */
}

@media (min-width: 768px) {
    .footer {
        padding: 6rem 0 2rem;
    }
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr; /* Mobile first */
    gap: 3rem;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 4rem;
        margin-bottom: 4rem;
    }
}

@media (min-width: 1024px) {
    .footer-content {
        grid-template-columns: repeat(4, 1fr);
    }
}

.footer-section {
    display: flex;
    flex-direction: column;
}

.footer-title {
    color: #34d399;
    margin-bottom: var(--space-lg);
    font-size: 1.8rem;
}

.footer-description {
    color: #d1d5db;
    line-height: 1.6;
    margin-bottom: 0;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.footer-link {
    color: #d1d5db;
    font-size: 1.5rem;
    transition: color var(--transition-normal);
    text-decoration: none;
}

.footer-link:hover {
    color: #34d399;
}

.contact-info .contact-link {
    color: #34d399;
    font-weight: 500;
}

.disclaimer {
    background-color: var(--gray-700);
    border-radius: var(--radius-lg);
    padding: 2.5rem; /* Mobile first */
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .disclaimer {
        padding: 3rem;
    }
}

.disclaimer-title {
    color: var(--warning-yellow);
    margin-bottom: var(--space-lg);
    font-size: 1.8rem;
}

.disclaimer-content {
    color: #d1d5db;
    line-height: 1.6;
}

.disclaimer-content p {
    margin-bottom: var(--space-md);
    color: inherit;
}

.disclaimer-content strong {
    color: var(--warning-yellow);
}

.copyright {
    text-align: center;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--gray-600);
    color: var(--gray-400);
}