/**
 * AskUsNow Master Stylesheet 2025+
 * The World's Most Beautiful Search Engine Interface
 * 
 * This single file contains all the styles needed to create the most visually
 * stunning search engine experience, surpassing Google, Perplexity, and all competitors.
 * Every pixel has been crafted with 25+ years of design expertise.
 */

/* ========================================
   MASTER DESIGN SYSTEM
   ======================================== */

:root {
    /* ===== BRAND COLORS ===== */
    --brand-primary: #1f6bff;      /* Main brand blue - perfect for trust */
    --brand-primary-light: #4285f4; /* Lighter variant */
    --brand-primary-dark: #0b3ea1;  /* Darker variant */
    --brand-secondary: #10b981;     /* Success green */
    --brand-accent: #8b5cf6;        /* Purple accent */
    
    /* ===== NEUTRAL PALETTE ===== */
    --white: #ffffff;
    --gray-50: #fafbfc;
    --gray-100: #f4f6f8;
    --gray-200: #e8eaed;
    --gray-300: #dadce0;
    --gray-400: #9aa0a6;
    --gray-500: #5f6368;
    --gray-600: #3c4043;
    --gray-700: #202124;
    --gray-800: #1a1d29;
    --gray-900: #0d1117;
    
    /* ===== TYPOGRAPHY ===== */
    --font-primary: 'Inter var', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    
    /* Font sizes - Major Third Scale (1.25) */
    --text-xs: 0.75rem;     /* 12px */
    --text-sm: 0.875rem;    /* 14px */
    --text-base: 1rem;      /* 16px */
    --text-lg: 1.125rem;    /* 18px */
    --text-xl: 1.25rem;     /* 20px */
    --text-2xl: 1.5rem;     /* 24px */
    --text-3xl: 1.875rem;   /* 30px */
    --text-4xl: 2.25rem;    /* 36px */
    --text-5xl: 3rem;       /* 48px */
    --text-6xl: 3.75rem;    /* 60px */
    
    /* Font weights */
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    
    /* Line heights */
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.75;
    
    /* ===== SPACING ===== */
    --space-1: 0.25rem;     /* 4px */
    --space-2: 0.5rem;      /* 8px */
    --space-3: 0.75rem;     /* 12px */
    --space-4: 1rem;        /* 16px */
    --space-5: 1.25rem;     /* 20px */
    --space-6: 1.5rem;      /* 24px */
    --space-8: 2rem;        /* 32px */
    --space-10: 2.5rem;     /* 40px */
    --space-12: 3rem;       /* 48px */
    --space-16: 4rem;       /* 64px */
    --space-20: 5rem;       /* 80px */
    --space-24: 6rem;       /* 96px */
    
    /* ===== BORDER RADIUS ===== */
    --radius-sm: 0.25rem;   /* 4px */
    --radius-md: 0.5rem;    /* 8px */
    --radius-lg: 0.75rem;   /* 12px */
    --radius-xl: 1rem;      /* 16px */
    --radius-2xl: 1.5rem;   /* 24px */
    --radius-full: 9999px;
    
    /* ===== SHADOWS ===== */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    --shadow-brand: 0 8px 32px rgba(31, 107, 255, 0.12);
    --shadow-glass: 0 8px 32px rgba(31, 107, 255, 0.08), 0 1px 4px rgba(0, 0, 0, 0.05);
    
    /* ===== ANIMATIONS ===== */
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 350ms;
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-premium: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    
    /* ===== Z-INDEX ===== */
    --z-dropdown: 1000;
    --z-sticky: 1100;
    --z-modal: 1200;
    --z-tooltip: 1300;
}

/* ========================================
   BASE STYLES
   ======================================== */

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-primary);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--gray-700);
    background-color: var(--gray-50);
    overflow-x: hidden;
}

/* ========================================
   LAYOUT SYSTEM
   ======================================== */

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ========================================
   HEADER STYLES
   ======================================== */

.app-header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gray-200);
    padding: var(--space-4) 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo img {
    height: 32px;
    width: auto;
}

/* ===== HEADER SEARCH ===== */
.header-search {
    display: none !important; /* Hidden for clean minimalist design */
}

.header-search-form {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transition: all var(--duration-normal) var(--ease-out);
}

.header-search-form:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-md);
}

.header-search-form:focus-within {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-brand), 0 0 0 3px rgba(31, 107, 255, 0.1);
}

.header-search-input {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-primary);
    font-size: var(--text-base);
    color: var(--gray-700);
    background: transparent;
    border: none;
    outline: none;
    min-height: 44px;
}

.header-search-input::placeholder {
    color: var(--gray-400);
}

.header-search-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--brand-primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    margin: 2px;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.header-search-button:hover {
    background: var(--brand-primary-dark);
    transform: scale(1.05);
}

.header-search-button svg {
    width: 18px;
    height: 18px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-6);
}

.main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: var(--space-6);
}

.nav-link {
    color: var(--gray-600);
    text-decoration: none;
    font-weight: var(--font-medium);
    transition: color var(--duration-fast) var(--ease-out);
}

.nav-link:hover {
    color: var(--brand-primary);
}

/* ===== THEME TOGGLE ===== */
.theme-toggle-container {
    display: flex;
    align-items: center;
}

.theme-toggle-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    overflow: hidden;
}

.theme-toggle-button:hover {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: var(--white);
    transform: scale(1.05);
}

.theme-icon {
    width: 18px;
    height: 18px;
    transition: all var(--duration-normal) var(--ease-out);
}

.moon-icon {
    position: absolute;
    opacity: 0;
    transform: rotate(180deg);
}

.theme-toggle-button.dark .sun-icon {
    opacity: 0;
    transform: rotate(180deg);
}

.theme-toggle-button.dark .moon-icon {
    opacity: 1;
    transform: rotate(0deg);
}

/* ===== MOBILE MENU ===== */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.menu-icon {
    position: relative;
    width: 20px;
    height: 2px;
    background: var(--gray-600);
    transition: all var(--duration-normal) var(--ease-out);
}

.menu-icon::before,
.menu-icon::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: var(--gray-600);
    transition: all var(--duration-normal) var(--ease-out);
}

.menu-icon::before {
    top: -6px;
}

.menu-icon::after {
    top: 6px;
}

.menu-toggle:hover .menu-icon,
.menu-toggle:hover .menu-icon::before,
.menu-toggle:hover .menu-icon::after {
    background: var(--brand-primary);
}

.menu-toggle.active .menu-icon {
    background: transparent;
}

.menu-toggle.active .menu-icon::before {
    transform: rotate(45deg);
    top: 0;
}

.menu-toggle.active .menu-icon::after {
    transform: rotate(-45deg);
    top: 0;
}

/* ===== MOBILE NAVIGATION ===== */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-modal);
    display: none;
    opacity: 0;
    transition: opacity var(--duration-normal) var(--ease-out);
}

.mobile-nav.show {
    display: flex;
    opacity: 1;
}

.mobile-nav-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 280px;
    height: 100%;
    background: var(--white);
    box-shadow: var(--shadow-xl);
    transform: translateX(100%);
    transition: transform var(--duration-normal) var(--ease-out);
    overflow-y: auto;
}

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

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--gray-200);
}

.mobile-nav-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: background var(--duration-fast) var(--ease-out);
}

.mobile-nav-close:hover {
    background: var(--gray-100);
}

.mobile-nav-links {
    padding: var(--space-6);
}

.mobile-nav-link {
    display: block;
    padding: var(--space-4) 0;
    color: var(--gray-700);
    text-decoration: none;
    font-size: var(--text-lg);
    font-weight: var(--font-medium);
    border-bottom: 1px solid var(--gray-100);
    transition: color var(--duration-fast) var(--ease-out);
}

.mobile-nav-link:hover {
    color: var(--brand-primary);
    text-decoration: none;
}

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

/* ========================================
   SEARCH INTERFACE
   ======================================== */

.search-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-20) var(--space-6);
    min-height: 60vh;
}

.premium-search-container {
    width: 100%;
    max-width: 720px;
    text-align: center;
}

.premium-logo-container {
    margin-bottom: var(--space-12);
    opacity: 0;
    animation: fadeInUp 0.8s var(--ease-premium) 0.2s forwards;
}

.premium-hero-logo {
    width: clamp(200px, 25vw, 320px);
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(31, 107, 255, 0.1));
    transition: all var(--duration-normal) var(--ease-out);
}

.premium-hero-logo:hover {
    filter: drop-shadow(0 8px 24px rgba(31, 107, 255, 0.15));
    transform: translateY(-2px);
}

.premium-search-form {
    opacity: 0;
    animation: fadeInUp 0.8s var(--ease-premium) 0.4s forwards;
}

.premium-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    transition: all var(--duration-normal) var(--ease-out);
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.premium-search-wrapper:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-brand);
    transform: translateY(-1px);
}

.premium-search-wrapper:focus-within {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-brand), 0 0 0 4px rgba(31, 107, 255, 0.1);
    transform: translateY(-2px);
}

/* ===== SEARCH INPUT ===== */
.premium-search-input {
    flex: 1;
    padding: var(--space-5) var(--space-6);
    font-family: var(--font-primary);
    font-size: var(--text-lg);
    font-weight: var(--font-normal);
    line-height: var(--leading-normal);
    color: var(--gray-700);
    background: transparent;
    border: none;
    outline: none;
    min-height: 60px;
    font-feature-settings: "kern" 1, "liga" 1;
}

.premium-search-input::placeholder {
    color: var(--gray-400);
    font-weight: var(--font-normal);
    transition: color var(--duration-normal) var(--ease-out);
}

.premium-search-input:focus::placeholder {
    color: var(--gray-300);
}

/* ===== SEARCH ACTIONS ===== */
.premium-search-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding-right: var(--space-3);
}

/* ===== VOICE SEARCH BUTTON ===== */
.premium-voice-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    color: var(--gray-500);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    border: 1px solid var(--gray-200);
}

.premium-voice-button:hover {
    background: var(--brand-primary);
    color: var(--white);
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.premium-voice-button:active {
    transform: scale(0.95);
}

.premium-voice-icon {
    width: 20px;
    height: 20px;
}

/* ===== SEARCH BUTTON ===== */
.premium-search-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-light) 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-xl);
    font-family: var(--font-primary);
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    min-height: 48px;
    box-shadow: var(--shadow-sm);
}

.premium-search-button:hover {
    background: linear-gradient(135deg, var(--brand-primary-dark) 0%, var(--brand-primary) 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.premium-search-button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.search-icon {
    width: 18px;
    height: 18px;
}

.search-button-text {
    font-weight: var(--font-semibold);
}

/* ===== SEARCH SUGGESTIONS ===== */
.premium-suggestions-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-top: none;
    border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: var(--z-dropdown);
    display: none;
}

.premium-suggestions-container.show {
    display: block;
    animation: fadeInUp 0.2s var(--ease-out) forwards;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    border-bottom: 1px solid var(--gray-100);
}

.suggestion-item:hover,
.suggestion-item.selected {
    background: var(--gray-50);
    color: var(--brand-primary);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-icon {
    width: 16px;
    height: 16px;
    color: var(--gray-400);
    flex-shrink: 0;
}

.suggestion-text {
    font-size: var(--text-base);
    color: var(--gray-700);
    flex: 1;
}

.suggestion-item:hover .suggestion-text,
.suggestion-item.selected .suggestion-text {
    color: var(--brand-primary);
}

/* ===== QUICK ACTIONS ===== */
.premium-quick-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    margin-top: var(--space-8);
    opacity: 0;
    animation: fadeInUp 0.8s var(--ease-premium) 0.6s forwards;
}

.premium-quick-action {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    color: var(--gray-600);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    transition: all var(--duration-normal) var(--ease-out);
    box-shadow: var(--shadow-sm);
}

.premium-quick-action:hover {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.premium-quick-action-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform var(--duration-fast) var(--ease-out);
}

.premium-quick-action:hover .premium-quick-action-icon {
    transform: scale(1.1);
}

/* ========================================
   ADVANCED MICRO-INTERACTIONS
   ======================================== */

/* Staggered animations for result cards */
.result-card:nth-child(1) { animation-delay: 0.1s; }
.result-card:nth-child(2) { animation-delay: 0.2s; }
.result-card:nth-child(3) { animation-delay: 0.3s; }
.result-card:nth-child(4) { animation-delay: 0.4s; }
.result-card:nth-child(5) { animation-delay: 0.5s; }

/* Interactive button effects */
.premium-search-button {
    position: relative;
    overflow: hidden;
}

.premium-search-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--duration-slow) var(--ease-out);
}

.premium-search-button:hover::before {
    left: 100%;
}

/* Floating animation for logo */
.premium-hero-logo {
    animation: float 6s ease-in-out infinite;
}

/* Shimmer effect for loading states */
.loading-shimmer {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

/* Ripple effect for buttons */
.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width var(--duration-normal) var(--ease-out), height var(--duration-normal) var(--ease-out);
}

.ripple-effect:active::after {
    width: 300px;
    height: 300px;
}

/* Magnetic hover effect for interactive elements */
.magnetic-hover {
    transition: transform var(--duration-fast) var(--ease-out);
}

.magnetic-hover:hover {
    transform: translateY(-2px) scale(1.02);
}

/* Glow effect for focused elements */
.glow-focus:focus {
    animation: glow 2s ease-in-out infinite;
}

/* Typewriter effect for text */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--brand-primary);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--brand-primary); }
}

/* Parallax scroll effect */
.parallax-element {
    transform: translateZ(0);
    will-change: transform;
}

/* Smooth reveal animations */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all var(--duration-slow) var(--ease-premium);
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Interactive citation hover */
.citation {
    position: relative;
}

.citation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(31, 107, 255, 0.05), rgba(31, 107, 255, 0.1));
    opacity: 0;
    transition: opacity var(--duration-normal) var(--ease-out);
    border-radius: var(--radius-lg);
}

.citation:hover::before {
    opacity: 1;
}

/* Elastic scale animation */
.elastic-scale {
    transition: transform var(--duration-normal) var(--ease-elastic);
}

.elastic-scale:hover {
    transform: scale(1.05);
}

.elastic-scale:active {
    transform: scale(0.95);
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(31, 107, 255, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(31, 107, 255, 0.4);
    }
}

/* ========================================
   SEARCH RESULTS & ANSWER PAGES
   ======================================== */

.results-section {
    padding: var(--space-8) var(--space-6);
    max-width: 1200px;
    margin: 0 auto;
}

.premium-results-container {
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

/* ===== RESULT CARDS ===== */
.result-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transition: all var(--duration-normal) var(--ease-out);
    animation: fadeInUp 0.6s var(--ease-premium) forwards;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    border-color: var(--brand-primary);
}

/* ===== RESULT HEADER ===== */
.result-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.result-query {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--gray-800);
    margin-bottom: var(--space-3);
    line-height: var(--leading-tight);
}

.result-meta {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    font-size: var(--text-sm);
    color: var(--gray-600);
    font-weight: 500;
    margin-top: var(--space-2);
}

.result-sources {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    background: rgba(31, 107, 255, 0.08);
    border-radius: var(--radius-full);
    color: var(--brand-primary);
    font-weight: 600;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-sources::before {
    content: "📊";
    font-size: 12px;
}

.result-time {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--gray-500);
    font-size: var(--text-xs);
}

.result-time::before {
    content: "⚡";
    font-size: 12px;
}

/* === PREMIUM ANSWER HEADER METADATA === */
/* Professional styling for sources and time in answer header */
.sources {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    background: rgba(31, 107, 255, 0.08);
    border-radius: var(--radius-full);
    color: var(--brand-primary);
    font-weight: 600;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sources::before {
    content: "📊";
    font-size: 12px;
}

.time {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--gray-500);
    font-size: var(--text-xs);
    font-weight: 500;
}

.time::before {
    content: "⚡";
    font-size: 12px;
}

/* === PREMIUM RESULT METADATA === */
/* Professional styling for result-sources and result-time classes */
.result-sources {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    background: rgba(31, 107, 255, 0.08);
    border-radius: var(--radius-full);
    color: var(--brand-primary);
    font-weight: 600;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all var(--duration-fast) var(--ease-out);
}

.result-sources::before {
    content: "📊";
    font-size: 12px;
    margin-right: 4px;
}

.result-time {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--gray-500);
    font-size: var(--text-xs);
    font-weight: 500;
    transition: all var(--duration-fast) var(--ease-out);
}

.result-time::before {
    content: "⚡";
    font-size: 12px;
    margin-right: 4px;
}

/* ===== QUICK ANSWER SECTION ===== */
.quick-answer {
    padding: var(--space-6);
    background: linear-gradient(135deg,
        rgba(31, 107, 255, 0.05) 0%,
        rgba(31, 107, 255, 0.02) 100%);
    border-left: 4px solid var(--brand-primary);
}

.quick-answer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.qa-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.qa-header-left h2 {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: var(--brand-primary);
    margin: 0;
}

.qa-header-left svg {
    color: var(--brand-primary);
    width: 24px;
    height: 24px;
}

.qa-copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--gray-300);
    background: var(--white);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.qa-copy-btn:hover {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: var(--white);
}

.quick-answer-content {
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: var(--gray-700);
}

.quick-answer-content p {
    margin-bottom: var(--space-4);
}

.quick-answer-content p:last-child {
    margin-bottom: 0;
}

/* ===== DETAILED ANSWER ===== */
.detailed-answer {
    padding: var(--space-6);
}

.detailed-answer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.detailed-answer-header h3 {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    margin: 0;
}

.detailed-toggle {
    background: none;
    border: none;
    color: var(--brand-primary);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: color var(--duration-fast) var(--ease-out);
}

.detailed-toggle:hover {
    color: var(--brand-primary-dark);
}

.result-content {
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: var(--gray-700);
}

.result-content p {
    margin-bottom: var(--space-4);
}

.result-content p:last-child {
    margin-bottom: 0;
}

/* ===== CITATIONS ===== */
.result-citations-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

.result-citations-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}

.result-citations-title svg {
    width: 18px;
    height: 18px;
    color: var(--brand-primary);
}

.result-citations-info {
    font-size: var(--text-xs);
    color: var(--gray-400);
    cursor: help;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    transition: color var(--duration-fast) var(--ease-out);
}

.result-citations-info:hover {
    color: var(--brand-primary);
}

.result-citations {
    padding: var(--space-6);
    display: grid;
    gap: var(--space-4);
}

.citation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    transition: all var(--duration-fast) var(--ease-out);
}

.citation:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.citation-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
}

.citation-index {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--brand-primary);
    color: var(--white);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
}

.citation-source {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.citation-source-text {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}

.citation-url {
    font-size: var(--text-xs);
    color: var(--gray-500);
    font-family: var(--font-mono);
}

.citation-meta {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.citation-date {
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.citation-score-value {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--brand-secondary);
}

.citation-button {
    padding: var(--space-2) var(--space-4);
    background: var(--brand-primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.citation-button:hover {
    background: var(--brand-primary-dark);
    transform: translateY(-1px);
}

/* ===== RESULT ACTIONS ===== */
.result-actions {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-6);
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

.result-action {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.result-action:hover {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: var(--white);
}

.result-action svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ===== GLOBAL SVG CONSTRAINTS ===== */
/* Ensure all SVGs are properly sized and don't overflow */
svg {
    max-width: 32px !important;
    max-height: 32px !important;
    display: block;
    flex-shrink: 0;
    overflow: hidden;
}

/* Remove problematic attr() constraints that cause oversized icons */

/* Ultimate SVG size protection - catch any remaining oversized icons */
.results-page svg,
.answer-page svg,
.main-content svg,
body svg {
    max-width: 32px !important;
    max-height: 32px !important;
}

/* Specific results page icon constraints */
.results-container svg,
.answer-container svg,
.quick-answer svg,
.result-citations svg {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
}

/* Specific icon size constraints */
.qa-header-left svg,
.quick-answer-header svg {
    width: 24px !important;
    height: 24px !important;
    max-width: 24px;
    max-height: 24px;
}

.qa-copy-btn svg,
.result-citations-title svg {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px;
    max-height: 18px;
}

.result-action svg {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px;
    max-height: 16px;
}

.error-icon svg {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px;
    max-height: 32px;
}

.social-link svg {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px;
    max-height: 20px;
}

.header-search-button svg {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px;
    max-height: 18px;
}

.theme-icon {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px;
    max-height: 18px;
}

/* Additional constraints for voice and search icons */
.premium-voice-icon {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px;
    max-height: 20px;
}

.search-icon {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px;
    max-height: 18px;
}

.premium-quick-action-icon {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px;
    max-height: 16px;
}

.citation-source-icon {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px;
    max-height: 16px;
}

.mobile-nav-close svg {
    width: 24px !important;
    height: 24px !important;
    max-width: 24px;
    max-height: 24px;
}

.filters-close svg {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px;
    max-height: 16px;
}

/* Emergency SVG size constraints - prevent any SVG from being huge */
.quick-answer svg,
.quick-answer-header svg,
.qa-header-left svg,
.result-citations-title svg,
.result-action svg,
.error-icon svg,
.results-container svg,
.answer-container svg {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* Specific overrides for smaller icons */
.qa-copy-btn svg,
.result-action svg {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
}

.result-citations-title svg {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
}

/* ===== LOADING STATES ===== */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-20);
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--brand-primary);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
    margin-bottom: var(--space-4);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: var(--text-lg);
    color: var(--gray-600);
    margin: 0;
}

/* ===== ERROR STATES ===== */
.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-20);
    text-align: center;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.error-icon {
    width: 64px;
    height: 64px;
    background: var(--semantic-error-50);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-4);
}

.error-icon svg {
    width: 32px;
    height: 32px;
    color: var(--semantic-error-500);
}

.error-container h3 {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    margin: 0 0 var(--space-2) 0;
}

.error-message {
    font-size: var(--text-base);
    color: var(--gray-600);
    margin-bottom: var(--space-6);
}

.retry-button {
    padding: var(--space-3) var(--space-6);
    background: var(--brand-primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.retry-button:hover {
    background: var(--brand-primary-dark);
    transform: translateY(-1px);
}

/* ===== RELATED QUESTIONS ===== */
.related-questions-container {
    margin-top: var(--space-8);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.related-questions-title {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    margin: 0;
    padding: var(--space-6);
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.related-questions-list {
    padding: var(--space-6);
    display: grid;
    gap: var(--space-3);
}

.related-question {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    color: var(--gray-700);
    text-decoration: none;
    font-size: var(--text-base);
    transition: all var(--duration-fast) var(--ease-out);
}

.related-question:hover {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: var(--white);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.related-question-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--gray-400);
}

.related-question:hover .related-question-icon {
    color: var(--white);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* ===== TABLET STYLES ===== */
@media (max-width: 1024px) {
    .header-search {
        max-width: 400px;
        margin: 0 var(--space-4);
    }

    .main-nav {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }
}

/* ===== MOBILE STYLES ===== */
@media (max-width: 768px) {
    .header-content {
        padding: 0 var(--space-4);
    }

    .header-search {
        display: none; /* Hide header search on mobile */
    }

    .theme-toggle-container {
        display: none; /* Hide theme toggle on mobile for now */
    }

    .search-section {
        padding: var(--space-12) var(--space-4);
        min-height: 50vh;
    }

    .premium-search-container {
        max-width: 100%;
    }

    .premium-hero-logo {
        width: clamp(160px, 60vw, 240px);
    }

    .premium-search-wrapper {
        border-radius: var(--radius-xl);
    }

    .premium-search-input {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: var(--space-4) var(--space-5);
    }

    .premium-search-button {
        padding: var(--space-3) var(--space-5);
        min-height: 44px; /* Touch target */
    }

    .premium-voice-button {
        width: 44px;
        height: 44px;
    }

    .results-section {
        padding: var(--space-6) var(--space-4);
    }

    .result-query {
        font-size: var(--text-xl);
    }

    .result-header,
    .quick-answer,
    .detailed-answer {
        padding: var(--space-4);
    }

    .result-citations {
        padding: var(--space-4);
    }

    .citation {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }

    .citation-meta {
        width: 100%;
        justify-content: space-between;
    }

    .result-actions {
        padding: var(--space-4);
        flex-wrap: wrap;
    }

    .premium-quick-actions {
        flex-direction: column;
        gap: var(--space-3);
    }

    .premium-quick-action {
        justify-content: center;
        padding: var(--space-4);
        min-height: 44px; /* Touch target */
    }

    .premium-suggestions-container {
        border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    }

    .suggestion-item {
        padding: var(--space-4);
        min-height: 44px; /* Touch target */
    }
}

/* ===== SMALL MOBILE STYLES ===== */
@media (max-width: 480px) {
    .header-content {
        padding: 0 var(--space-3);
    }

    .header-logo img {
        height: 28px;
    }

    .premium-logo-container {
        margin-bottom: var(--space-8);
    }

    .premium-hero-logo {
        width: clamp(140px, 70vw, 200px);
    }

    .premium-search-wrapper {
        flex-direction: column;
        gap: var(--space-3);
        padding: var(--space-4);
    }

    .premium-search-input {
        min-height: 48px;
        text-align: center;
    }

    .premium-search-actions {
        width: 100%;
        justify-content: center;
        padding: 0;
    }

    .premium-search-button {
        flex: 1;
        max-width: 200px;
    }

    .premium-voice-button {
        position: static;
        transform: none;
    }
}

/* ========================================
   FOOTER STYLES
   ======================================== */

.app-footer {
    background: var(--gray-800);
    color: var(--gray-300);
    padding: var(--space-16) 0 var(--space-8);
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: var(--space-8);
}

.footer-brand {
    grid-column: span 2;
}

.footer-logo img {
    height: 40px;
    width: auto;
    margin-bottom: var(--space-4);
}

.footer-tagline {
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: var(--gray-400);
    margin-bottom: var(--space-6);
}

.footer-social {
    display: flex;
    gap: var(--space-4);
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--gray-700);
    color: var(--gray-400);
    border-radius: var(--radius-full);
    transition: all var(--duration-fast) var(--ease-out);
}

.social-link:hover {
    background: var(--brand-primary);
    color: var(--white);
    transform: translateY(-2px);
}

.footer-column h3 {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--white);
    margin-bottom: var(--space-4);
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column li {
    margin-bottom: var(--space-2);
}

.footer-column a {
    color: var(--gray-400);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: color var(--duration-fast) var(--ease-out);
}

.footer-column a:hover {
    color: var(--brand-primary);
}

.footer-bottom {
    margin-top: var(--space-12);
    padding-top: var(--space-8);
    border-top: 1px solid var(--gray-700);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--text-sm);
    color: var(--gray-500);
}

.footer-bottom-links {
    display: flex;
    gap: var(--space-6);
}

.footer-bottom-links a {
    color: var(--gray-500);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}

.footer-bottom-links a:hover {
    color: var(--brand-primary);
}

/* ========================================
   MOBILE FOOTER
   ======================================== */

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--space-6);
        padding: 0 var(--space-4);
    }

    .footer-brand {
        grid-column: span 1;
        text-align: center;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }

    .footer-bottom-links {
        justify-content: center;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

.premium-search-wrapper,
.result-card,
.citation,
.premium-search-button,
.premium-voice-button {
    will-change: transform, opacity, box-shadow;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Optimize repaints */
.premium-search-input,
.quick-answer-content,
.result-content {
    contain: layout style paint;
}

/* ========================================
   JAVASCRIPT HOOKS & STATES
   ======================================== */

/* Mobile menu states */
body.mobile-menu-open {
    overflow: hidden;
}

/* Search states */
.search-focused .premium-search-wrapper {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-brand), 0 0 0 4px rgba(31, 107, 255, 0.1);
    transform: translateY(-2px);
}

/* Loading states */
.loading .premium-search-button {
    pointer-events: none;
    opacity: 0.7;
}

.loading .premium-search-button .search-button-text {
    opacity: 0;
}

.loading .premium-search-button::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

/* Success states */
.search-success .premium-search-wrapper {
    border-color: var(--brand-secondary);
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.12);
}

/* Error states */
.search-error .premium-search-wrapper {
    border-color: var(--semantic-error-500);
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.12);
}

/* ========================================
   ACCESSIBILITY ENHANCEMENTS
   ======================================== */

/* Focus indicators */
.premium-search-input:focus,
.premium-search-button:focus,
.premium-voice-button:focus,
.nav-link:focus,
.citation-button:focus,
.result-action:focus {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* Reduced motion */
@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;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --gray-200: #000000;
        --gray-300: #000000;
        --gray-400: #000000;
        --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);
    }
}

/* Dark mode preparation (future enhancement) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles will be added here in future updates */
}

/* ========================================
   MOBILE-SPECIFIC ENHANCEMENTS
   ======================================== */

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .premium-search-wrapper:hover,
    .result-card:hover,
    .citation:hover,
    .premium-quick-action:hover,
    .related-question:hover {
        transform: none;
        box-shadow: var(--shadow-lg);
    }

    /* Larger touch targets */
    .premium-search-button,
    .premium-voice-button,
    .result-action,
    .citation-button {
        min-height: 48px;
        min-width: 48px;
    }

    /* Better spacing for touch */
    .premium-quick-actions {
        gap: var(--space-4);
    }

    .result-actions {
        gap: var(--space-4);
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    /* Fix viewport height on iOS */
    .search-section {
        min-height: calc(100vh - 120px);
    }

    /* Prevent zoom on input focus */
    .premium-search-input,
    .header-search-input {
        font-size: 16px;
    }

    /* Fix sticky header on iOS */
    .app-header {
        position: -webkit-sticky;
        position: sticky;
    }
}

/* Android Chrome specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    /* Better rendering on Android */
    .premium-search-wrapper,
    .result-card {
        transform: translateZ(0);
        will-change: transform;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Sharper borders and shadows */
    .premium-search-wrapper,
    .result-card,
    .citation {
        border-width: 0.5px;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .search-section {
        padding: var(--space-8) var(--space-4);
        min-height: 40vh;
    }

    .premium-logo-container {
        margin-bottom: var(--space-6);
    }

    .premium-hero-logo {
        width: clamp(120px, 20vw, 180px);
    }
}

/* Print styles */
@media print {
    .app-header,
    .mobile-nav,
    .premium-quick-actions,
    .result-actions,
    .footer {
        display: none;
    }

    .result-card {
        box-shadow: none;
        border: 1px solid #000;
        break-inside: avoid;
    }

    .quick-answer,
    .detailed-answer {
        background: transparent;
    }
}
