/* Components CSS - Header & Footer Styles - v2.1 MOBILE OPTIMIZED */
/* Include this CSS file when using header.html or footer.html components */
/* CACHE BUST: Mobile footer improvements deployed */

/* CSS Variables (Design System) */
:root {
    /* Brand Colors - Alternative Palette */
    --primary-teal: #2DD4BF;
    --primary-teal-dark: #0D9488;
    --primary-teal-light: #5EEAD4;
    --accent-blue: #3B82F6;
    --accent-purple: #8B5CF6;
    --warm-orange: #F59E0B;
    
    /* Neutral Palette */
    --gray-900: #0F172A;
    --gray-800: #1E293B;
    --gray-700: #334155;
    --gray-600: #475569;
    --gray-500: #64748B;
    --gray-400: #94A3B8;
    --gray-300: #CBD5E1;
    --gray-200: #E2E8F0;
    --gray-100: #F1F5F9;
    --gray-50: #F8FAFC;
    --white: #FFFFFF;
    
    /* Typography */
    --font-primary: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-secondary: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;
    
    /* Shadows */
    --shadow-soft: 0 2px 15px -3px rgba(0, 0, 0, 0.07), 0 10px 20px -2px rgba(0, 0, 0, 0.04);
    --shadow-medium: 0 4px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-large: 0 10px 40px -10px rgba(0, 0, 0, 0.1), 0 20px 25px -5px rgba(0, 0, 0, 0.04);
    
    /* Gradients */
    --gradient-hero: linear-gradient(135deg, #2DD4BF 0%, #3B82F6 50%, #8B5CF6 100%);
    --gradient-cta: linear-gradient(135deg, #0D9488 0%, #0EA5E9 100%);
}

/* Base Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* Navigation Styles */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gray-100);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) 0;
    white-space: nowrap;
    min-height: 60px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--gray-900);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.logo-container img {
    width: 40px;
    height: 40px;
}

.nav-links {
    display: none;
    gap: var(--space-2xl);
}

.nav-links.active {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    padding: var(--space-xl);
    box-shadow: var(--shadow-large);
    border-top: 1px solid var(--gray-100);
}

.mobile-menu-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--space-sm);
    color: var(--gray-700);
}

.nav-links a {
    font-weight: 500;
    color: var(--gray-600);
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary-teal);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-teal);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-cta {
    background: var(--gradient-cta);
    color: white;
    padding: var(--space-sm) var(--space-lg);
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-medium);
}

.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-large);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-shrink: 0;
    white-space: nowrap;
}

/* Footer Styles */
.footer {
    background: var(--gray-900);
    color: white;
    padding: var(--space-4xl) 0 var(--space-xl);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-3xl);
    margin-bottom: var(--space-2xl);
}

.footer-brand {
    max-width: 300px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 1.5rem;
}

.footer-logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.footer-description {
    color: var(--gray-400);
    line-height: 1.6;
}

.footer-column h4 {
    margin-bottom: var(--space-lg);
    color: white;
    font-size: 1.1rem;
    font-family: var(--font-primary);
}

.footer-column a {
    color: var(--gray-400);
    text-decoration: none;
    display: block;
    margin-bottom: var(--space-sm);
    transition: color 0.3s ease;
}

.footer-column a:hover {
    color: var(--primary-teal-light);
}

/* Company Information Styles */
.company-info {
    margin-top: var(--space-sm);
}

.company-info p {
    margin: 0 0 var(--space-xs) 0;
    color: var(--gray-400);
    font-size: 0.9rem;
    line-height: 1.4;
}

.company-name {
    font-weight: 600;
    color: white !important;
    font-size: 1rem !important;
}

.company-reg {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem !important;
}

.company-location {
    font-weight: 500;
}

.company-compliance {
    color: var(--primary-teal-light) !important;
    font-weight: 500;
    font-size: 0.85rem !important;
}

.footer-bottom {
    border-top: 1px solid var(--gray-800);
    padding-top: var(--space-lg);
    text-align: center;
    color: var(--gray-400);
}

/* Responsive Design */
@media (min-width: 1024px) {
    .nav-links {
        display: flex !important;
        position: static !important;
        flex-direction: row !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
        background: none !important;
    }
    
    .nav-links.active {
        position: static !important;
        background: none !important;
        flex-direction: row !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
    }
    
    .mobile-menu-toggle {
        display: none !important;
    }
}

@media (max-width: 1023px) {
    .nav-links {
        display: none !important;
    }
    
    .mobile-menu-toggle {
        display: block !important;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-md);
    }
    
    .nav-content {
        position: relative;
        min-height: 56px;
        gap: var(--space-sm);
        align-items: center;
        justify-content: space-between;
    }
    
    .logo-container {
        font-size: 1.25rem;
        flex: 1;
        min-width: 0;
        max-width: 200px;
    }
    
    .nav-actions {
        gap: var(--space-xs);
        flex-shrink: 0;
    }
    
    .nav-cta {
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.85rem;
        white-space: nowrap;
        min-height: 40px;
    }
    
    /* Compact Mobile Footer - Force Override */
body .footer {
    padding: 2rem 0 1.5rem !important; /* Force smaller padding */
}
    
    body .footer-content {
        grid-template-columns: 1fr !important;
        text-align: center !important;
        gap: 1.5rem !important; /* Smaller gap */
        margin-bottom: 1.5rem !important; /* Smaller margin */
    }
    
    body .footer-brand {
        max-width: none !important;
        margin-bottom: 1rem !important; /* Smaller margin */
    }
    
    body .footer-logo {
        justify-content: center !important;
        margin-bottom: 1rem !important; /* Smaller logo margin */
    }
    
    body .footer-description {
        font-size: 0.9rem !important; /* Smaller description text */
        margin-bottom: 1rem !important;
    }
    
    body .footer-column {
        text-align: center !important;
        margin-bottom: 1rem !important; /* Smaller section spacing */
    }
    
    body .footer-column h4 {
        margin-bottom: 1rem !important; /* Smaller heading margin */
        font-size: 1rem !important; /* Smaller heading */
    }
    
    /* Compact Mobile Company Info - Force Override */
    body .company-info {
        margin-top: 0.5rem !important;
        padding: 1rem 0.75rem !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border-radius: 8px !important;
    }
    
    body .company-info p {
        font-size: 0.85rem !important; /* More compact text */
        margin-bottom: 0.5rem !important; /* Tighter spacing */
        line-height: 1.3 !important;
    }
    
    body .company-name {
        font-size: 1rem !important; /* Compact but readable */
        margin-bottom: 0.5rem !important;
    }
    
    body .company-reg {
        font-size: 0.8rem !important; /* Smaller registration code */
    }
    
    body .company-compliance {
        font-size: 0.8rem !important; /* Smaller compliance text */
        padding: 0.5rem 0.75rem !important;
        border-radius: 4px !important;
        background: rgba(94, 173, 184, 0.1) !important;
        display: inline-block !important;
        margin-top: 0.5rem !important;
    }
    
    /* Compact Touch-Friendly Footer Links */
    .footer-column a {
        padding: var(--space-xs) var(--space-sm); /* Smaller padding */
        margin-bottom: var(--space-xs); /* Tighter spacing */
        border-radius: 4px;
        min-height: 40px; /* Slightly smaller but still touch-friendly */
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background-color 0.3s ease;
        font-size: 0.9rem; /* Smaller text */
    }
    
    .footer-column a:hover,
    .footer-column a:active {
        background: rgba(94, 173, 184, 0.1);
        color: var(--primary-teal-light);
    }
    
    /* Compact Footer Bottom */
    .footer-bottom {
        padding-top: var(--space-md); /* Reduced top padding */
        font-size: 0.8rem; /* Smaller copyright text */
    }
}

/* Focus Styles for Accessibility */
*:focus {
    outline: 2px solid var(--primary-teal);
    outline-offset: 2px;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-teal);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
}

/* Additional Mobile Optimizations */
@media (max-width: 480px) {
    /* Very small screens - extra mobile optimizations */
    .nav-content {
        min-height: 52px;
        padding: var(--space-xs) 0;
    }
    
    .logo-container {
        font-size: 1.1rem;
        max-width: 160px;
    }
    
    .nav-cta {
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.8rem;
        min-height: 36px; /* Smaller but still touch-friendly */
    }
    
    .mobile-menu-toggle {
        padding: var(--space-xs);
        font-size: 1.2rem;
    }
    
    /* Extra Compact Footer for Very Small Screens - Force Override */
    body .footer {
        padding: 1.5rem 0 1rem !important; /* Even more compact */
    }
    
    .footer-content {
        gap: var(--space-md); /* Tighter gap */
        margin-bottom: var(--space-md);
    }
    
    .footer-brand {
        margin-bottom: var(--space-sm); /* Minimal margin */
    }
    
    .footer-logo {
        margin-bottom: var(--space-sm);
        font-size: 1.2rem; /* Smaller logo text */
    }
    
    .footer-description {
        font-size: 0.8rem; /* Even smaller description */
        margin-bottom: var(--space-sm);
        padding: 0 var(--space-sm);
    }
    
    .company-info {
        padding: var(--space-sm);
        margin-top: 0;
    }
    
    .company-info p {
        font-size: 0.8rem !important; /* More compact text */
        margin-bottom: var(--space-xs);
        line-height: 1.2;
    }
    
    .company-name {
        font-size: 0.9rem !important; /* Smaller but still readable */
    }
    
    .company-reg {
        font-size: 0.75rem !important; /* Very compact registration */
    }
    
    .company-compliance {
        font-size: 0.75rem !important; /* Very compact compliance */
        padding: 2px var(--space-xs);
    }
    
    /* Minimal touch targets for very small screens */
    .footer-column {
        margin-bottom: var(--space-sm);
    }
    
    .footer-column h4 {
        font-size: 0.9rem;
        margin-bottom: var(--space-sm);
    }
    
    .footer-column a {
        padding: var(--space-xs);
        margin-bottom: 2px; /* Minimal spacing */
        font-size: 0.85rem;
        min-height: 36px; /* Compact but still touchable */
    }
    
    .footer-bottom {
        padding-top: var(--space-sm);
        font-size: 0.7rem; /* Very small copyright */
    }
}

/* Mobile Performance Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Touch device optimizations */
    .feature-card:hover {
        transform: none; /* Disable hover transforms on touch */
    }
    
    .ai-feature-item:hover {
        transform: none; /* Disable hover effects on touch */
        background: var(--gray-50); /* Keep background change for feedback */
    }
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================
   MOBILE OPTIMIZATION - QUICK WINS
   ============================================ */

/* Enhanced touch feedback for mobile devices */
@media (max-width: 768px) {
    /* Enhanced touch targets */
    .feature-card,
    .nav-cta,
    .btn-primary,
    .footer-link {
        transition: all 0.2s ease;
        cursor: pointer;
    }
    
    /* Active state feedback */
    .feature-card:active,
    .nav-cta:active,
    .btn-primary:active {
        transform: scale(0.98);
        background-color: rgba(45, 212, 191, 0.05);
    }
    
    /* Improved touch targets */
    .footer-link {
        padding: 12px 8px;
        margin: 4px 0;
        display: inline-block;
        min-height: 44px;
        line-height: 1.2;
    }
    
    /* Feature cards enhancement */
    .feature-card:hover,
    .feature-card:focus {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(45, 212, 191, 0.15);
    }
}

/* Mobile loading indicator */
.mobile-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.mobile-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-content {
    text-align: center;
    color: #2DD4BF;
}

.spinner-ring {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(45, 212, 191, 0.2);
    border-top: 4px solid #2DD4BF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loader-text {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #374151;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hide loader once page is loaded */
@media (max-width: 768px) {
    body.loaded .mobile-loader {
        display: none;
    }
}

/* Skip navigation for accessibility */
.skip-nav {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #2DD4BF;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
    z-index: 10001;
    transition: top 0.3s ease;
}

.skip-nav:focus {
    top: 6px;
}