/* ==========================================================================
   IMPORTS & FONTS
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue:wght@400&display=swap');

@font-face {
    font-family: 'Helvetica Now Display';
    src: url('fonts/HelveticaNowDisplay-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Helvetica Now Display';
    src: url('fonts/HelveticaNowDisplay-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Canela Text';
    src: url('fonts/CanelaText-Regular-Trial.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Canela Text';
    src: url('fonts/CanelaText-RegularItalic-Trial.otf') format('opentype');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Canela Text';
    src: url('fonts/CanelaText-Medium-Trial.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Canela Text';
    src: url('fonts/CanelaText-Thin-Trial.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==========================================================================
   FONT LOADING OPTIMIZATION
   ========================================================================== */

/* Prevent FOUT (Flash of Unstyled Text) */
body {
    font-family: 'Helvetica Now Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Font loading states */
.fonts-loaded {
    font-display: swap;
}

/* Ensure smooth font transitions */
* {
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   AUTOFILL PREVENTION
   ========================================================================== */

/* Universal autofill prevention for all input types */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
textarea:-webkit-autofill:active,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus,
select:-webkit-autofill:active,
[class*="input"]:-webkit-autofill,
[class*="input"]:-webkit-autofill:hover,
[class*="input"]:-webkit-autofill:focus,
[class*="input"]:-webkit-autofill:active,
[class*="search"]:-webkit-autofill,
[class*="search"]:-webkit-autofill:hover,
[class*="search"]:-webkit-autofill:focus,
[class*="search"]:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--color-bg-primary) inset !important;
    -webkit-text-fill-color: var(--color-text-primary) !important;
    background-color: var(--color-bg-primary) !important;
    background-image: none !important;
    background-clip: content-box !important;
    transition: background-color 5000s ease-in-out 0s !important;
    -webkit-transition: background-color 5000s ease-in-out 0s !important;
    animation: autofill-fix 0s forwards !important;
}

/* Keyframe animation to force autofill styling */
@keyframes autofill-fix {
    0% {
        background-color: var(--color-bg-primary) !important;
        color: var(--color-text-primary) !important;
    }
    100% {
        background-color: var(--color-bg-primary) !important;
        color: var(--color-text-primary) !important;
    }
}

:root {
    /* Color System */
    --color-bg-primary: #000000;
    --color-bg-secondary: #1a1a1a;
    --color-bg-card: #2F2F2F;
    --color-text-primary: #ffffff;
    --color-text-secondary: #DBD9D9;
    --color-text-placeholder: #828282;
    --color-surface-secondary: #F2F2F2;
    --color-border-primary: #3F3F3F;
    --color-border-secondary: #3F3F3F;
    --color-accent: #4a9eff;
    --color-accent-hover: #3a8eef;
    
    /* Figma Design System Colors */
    --Color-Surface-background-page-bg: #000000;
    --Color-Surface-background-card-bg--default: #2F2F2F;
    --Color-Surface-default-secondary: #F2F2F2;
    --Color-Text-default-primary--text: #ffffff;
    --Color-Text-default-secondary--text: #DBD9D9;
    --Color-Text-default-subtitle: #9D9C9C;
    --Color-Text-default-action-button: #000000;
    --Color-Border-default-primary: #868686;
    --Color-Border-default-secondary: #DBD9D9;
    --Foundations-white: #ffffff;
    --Foundations-black: #000000;
    
    /* Typography */
    --font-family: 'Helvetica Now Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 14px;
    --font-size-sm: 16px;
    --font-size-md: 20px;
    --font-size-lg: 24px;
    --font-size-xl: 31.5px;
    --font-size-xxl: 67.5px;
    
    /* Spacing */
    --spacing-xs: 5px;
    --spacing-sm: 10px;
    --spacing-md: 15px;
    --spacing-lg: 20px;
    --spacing-xl: 25px;
    --spacing-2xl: 30px;
    --spacing-3xl: 40px;
    --spacing-4xl: 48px;
    --spacing-5xl: 60px;
    
    /* Border Radius */
    --radius-sm: 15px;
    --radius-md: 18px;
    --radius-lg: 20px;
    --radius-xl: 34.21px;
    --radius-2xl: 44px;
    
    /* Shadows */
}

body {
    font-family: var(--font-family);
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: 64px; /* Account for fixed header */
}

/* Remove body padding for mobile search page */
@media (max-width: 768px) {
    body {
        padding-top: 0 !important;
    }
}

/* Common 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;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Remove focus outline for all elements */
*:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Remove focus outline for mouse users */
*:focus:not(:focus-visible) {
    outline: none !important;
    box-shadow: none !important;
}

/* Remove focus outline for all interactive elements */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus,
[tabindex]:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Remove mobile selection and touch feedback */
* {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
}

/* Allow text selection for input fields and textareas */
input,
textarea,
[contenteditable] {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}


/* Error Message Styles */
.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #ff4444;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    font-family: 'Helvetica Now Display', sans-serif;
    font-size: 14px;
    font-weight: 500;
    max-width: 300px;
    display: none;
}

.error-message[role="alert"] {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Performance optimizations */
img {
    max-width: 100%;
    height: auto;
}

.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy.loaded {
    opacity: 1;
}

/* Custom Scrollbar Styles - Hide white background */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent; /* Hide white background */
}

::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #555 transparent;
}

/* Base Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius-xl);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 40px;
}

.btn-primary {
    background-color: var(--color-text-primary);
    color: var(--color-bg-primary);
}

.btn-primary:hover {
    background-color: #d0d0d0;
}

/* Base Container */
.page-container {
    min-height: 100vh;
    background: var(--color-bg-primary);
    position: relative;
}