:root {
    /* Primary Background (Dark Navy/Almost Black) */
    --background: #0B0F19; /* Very dark navy */
    --surface: #111827; /* Slightly lighter navy for cards */
    --surface-hover: #1F2937;
    
    /* Text */
    --text: #F8FAFC;
    --text-muted: #94A3B8;
    --text-subtle: #64748B;
    
    /* Accents */
    --primary: #6366F1; /* Indigo/Purple */
    --primary-hover: #4F46E5;
    --secondary: #8B5CF6; /* Purple */
    --secondary-hover: #7C3AED;
    
    /* States */
    --success: #22C55E;
    --success-bg: rgba(34, 197, 94, 0.15);
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --danger: #EF4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    --gradient-glow: linear-gradient(135deg, rgba(99, 102, 241, 0.5) 0%, rgba(139, 92, 246, 0.5) 100%);
    
    /* Borders & UI */
    --border: rgba(148, 163, 184, 0.15);
    --border-light: rgba(148, 163, 184, 0.3);
    
    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    /* Shadows & Elevation */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);
    --shadow-glow-hover: 0 0 30px rgba(139, 92, 246, 0.5);
    
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light theme support (subtle adaptation) */
[data-theme="light"] {
    --background: #F8FAFC;
    --surface: #FFFFFF;
    --surface-hover: #F1F5F9;
    --text: #0F172A;
    --text-muted: #64748B;
    --border: #E2E8F0;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 10px 25px -5px rgba(59, 130, 246, 0.2);
}

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

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color var(--transition), color var(--transition);
}

a { color: inherit; text-decoration: none; transition: color var(--transition); }

/* UTILITIES */
.container { max-width: 1280px; margin: 0 auto; padding: 0 1.25rem; width: 100%; box-sizing: border-box; }

.glass {
    background: rgba(8, 11, 26, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
}
[data-theme="light"] .glass {
    background: rgba(255, 255, 255, 0.8);
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* HEADER */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}
/* We apply glass dynamically or statically to header */
.header.glass { border-bottom: 1px solid rgba(255,255,255,0.05); }

.header .container {
    display: flex; align-items: center; justify-content: space-between; gap: 2rem;
}
.header-logo {
    font-weight: 800; font-size: 1.25rem; letter-spacing: -0.025em;
    display: flex; align-items: center; gap: 0.75rem; color: var(--text);
}
.header-logo svg { color: var(--primary); }

.header-nav { display: flex; gap: 2rem; align-items: center; }
.header-nav a {
    color: var(--text-muted); font-weight: 500; font-size: 0.95rem;
}
.header-nav a:hover { color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 1rem; }

.mobile-menu-btn {
    display: none; background: none; border: none; color: var(--text); cursor: pointer;
}

/* BUTTONS */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.6rem 1.25rem; font-size: 0.95rem; font-weight: 600;
    border-radius: var(--radius); border: 1px solid transparent;
    cursor: pointer; transition: all var(--transition); gap: 0.5rem;
}
.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
    border: none;
}
.btn-primary:hover {
    box-shadow: var(--shadow-glow-hover);
    transform: translateY(-1px);
}
.btn-outline {
    background-color: rgba(255,255,255,0.03);
    border-color: var(--border); color: var(--text);
}
.btn-outline:hover {
    background-color: var(--surface-hover); border-color: var(--border-light);
}
.btn-accent {
    background-color: var(--surface-hover); color: var(--text); border: 1px solid var(--border);
}
.btn-accent:hover {
    background-color: var(--primary); color: #fff; border-color: var(--primary);
}
.btn-icon { padding: 0.5rem; border-radius: var(--radius); }

/* FORMS & INPUTS */
.form-group { margin-bottom: 1.5rem; }
.form-label {
    display: block; font-size: 0.9rem; font-weight: 500; margin-bottom: 0.5rem; color: var(--text-muted);
}
.form-control {
    width: 100%; padding: 0.75rem 1rem; font-family: inherit; font-size: 0.95rem;
    background-color: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text);
    transition: all var(--transition);
}
.form-control:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.search-box { position: relative; width: 100%; max-width: 500px; }
.search-box input {
    padding-left: 3rem; border-radius: var(--radius-full);
    background-color: rgba(255,255,255,0.03);
}
.search-box input:focus {
    background-color: var(--surface);
}
.search-box svg {
    position: absolute; left: 1.25rem; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); width: 1.25rem; height: 1.25rem;
}

/* CARDS */
.card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}
.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}
.card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 2px;
    background: var(--gradient-primary);
    opacity: 0; transition: opacity var(--transition);
}
.card:hover::before { opacity: 1; }

/* PROVIDER CARD */
.provider-card { display: flex; flex-direction: column; gap: 1.25rem; height: 100%; }
.provider-card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.provider-logo-group { display: flex; align-items: center; gap: 1rem; }
.provider-logo {
    width: 56px; height: 56px; border-radius: var(--radius); object-fit: cover;
    background-color: var(--background); border: 1px solid var(--border); padding: 2px;
}
.provider-meta h3 {
    font-size: 1.15rem; font-weight: 700; letter-spacing: -0.025em;
    display: flex; align-items: center; gap: 0.5rem;
}
.provider-meta a { color: var(--text-muted); font-size: 0.85rem; }
.provider-description {
    font-size: 0.9rem; color: var(--text-muted);
    display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.provider-models { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.provider-footer {
    margin-top: auto; padding-top: 1.25rem; border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.provider-price { font-size: 0.85rem; color: var(--text-muted); line-height: 1.2; }
.provider-price strong { color: var(--text); font-size: 1.15rem; font-weight: 700; }

/* BADGES */
.badge {
    display: inline-flex; align-items: center; padding: 0.2rem 0.6rem;
    font-size: 0.75rem; font-weight: 600; border-radius: var(--radius-full);
    background-color: var(--surface-hover); color: var(--text); border: 1px solid var(--border);
}
.badge-verified { background-color: var(--success); color: #fff; border: none; gap: 0.25rem; font-size: 0.65rem; padding: 0.15rem 0.4rem; letter-spacing: 0.5px; }
.badge-category { background-color: rgba(255,255,255,0.05); color: var(--text-muted); border: 1px solid rgba(255,255,255,0.1); font-size: 0.75rem; padding: 0.2rem 0.6rem; }
.badge-promo { background: var(--gradient-primary); color: #fff; border: none; font-size: 0.7rem; letter-spacing: 0.5px; }

/* RATING STARS */
.rating-stars { display: flex; align-items: center; gap: 0.25rem; color: var(--warning); }
.rating-stars svg { width: 1.1rem; height: 1.1rem; }
.rating-count { color: var(--text-muted); font-size: 0.85rem; margin-left: 0.25rem; font-weight: 500;}

/* FILTER SIDEBAR */
.filter-sidebar {
    background-color: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 1.5rem;
}
.filter-group { margin-bottom: 1.5rem; }
.filter-group-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 1rem; color: var(--text); }
.filter-checkbox {
    display: flex; align-items: center; gap: 0.75rem; font-size: 0.9rem; color: var(--text-muted);
    margin-bottom: 0.75rem; cursor: pointer; transition: color var(--transition);
}
.filter-checkbox input[type="checkbox"] {
    appearance: none; width: 1.25rem; height: 1.25rem; border: 1px solid var(--border);
    border-radius: 4px; background-color: rgba(255,255,255,0.02); cursor: pointer; position: relative;
    transition: all var(--transition);
}
.filter-checkbox input[type="checkbox"]:checked { background-color: var(--primary); border-color: var(--primary); }
.filter-checkbox input[type="checkbox"]:checked::after {
    content: ''; position: absolute; left: 6px; top: 2px; width: 4px; height: 10px;
    border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.filter-checkbox:hover { color: var(--text); }

/* RANGE SLIDER UI (Mocked for existing select/input but can be used if implemented) */
.range-slider { width: 100%; margin-top: 0.5rem; }

/* EMPTY STATE */
.empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 4rem 1.5rem; border: 1px dashed var(--border);
    border-radius: var(--radius-lg); background-color: rgba(255,255,255,0.01);
}
.empty-state-icon { width: 3.5rem; height: 3.5rem; color: var(--text-subtle); margin-bottom: 1rem; }
.empty-state-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; }
.empty-state-desc { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.5rem; }

/* PAGINATION */
.pagination { display: flex; justify-content: center; gap: 0.5rem; margin-top: 3rem; }
.pagination .page-item {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.5rem; height: 2.5rem; border-radius: var(--radius); font-size: 0.95rem; font-weight: 600;
    color: var(--text-muted); border: 1px solid var(--border); background: var(--surface);
    transition: all var(--transition);
}
.pagination .page-item:hover { background-color: var(--surface-hover); color: var(--text); border-color: var(--border-light); }
.pagination .page-item.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* FOOTER */
.footer {
    background-color: var(--surface); border-top: 1px solid var(--border); padding: 4rem 0 2rem; margin-top: 4rem;
}
.footer-grid { display: grid; gap: 3rem; margin-bottom: 3rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-brand h3 { font-size: 1.5rem; font-weight: 800; margin-bottom: 1rem; color: var(--text); }
.footer-brand p { color: var(--text-muted); font-size: 0.95rem; max-width: 300px; line-height: 1.6; }
.footer-links h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 1.25rem; color: var(--text); }
.footer-links ul { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.footer-links a { color: var(--text-muted); font-size: 0.9rem; }
.footer-links a:hover { color: var(--primary); }
.footer-bottom {
    border-top: 1px solid var(--border); padding-top: 2rem; display: flex; justify-content: space-between;
    align-items: center; color: var(--text-subtle); font-size: 0.85rem;
}

/* RESPONSIVE DESIGN UTILITIES */
@media (max-width: 1024px) {
    .header-nav, .header-search, .header-actions { display: none !important; }
    .mobile-menu-btn { display: flex !important; align-items: center; justify-content: center; }
    .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
}

/* GRID HELPERS */
.grid { display: grid; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* HERO VISUALS */
.hero-visual {
    position: relative; width: 100%; height: 100%; min-height: 400px;
    display: flex; align-items: center; justify-content: center;
}
.hero-glow {
    position: absolute; width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, rgba(0, 0, 0, 0) 70%);
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    filter: blur(40px); z-index: 0;
}
.trust-indicator {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.85rem; font-weight: 600; color: var(--text-muted);
}
.trust-indicator svg { color: var(--primary); width: 1.25rem; height: 1.25rem; }

/* MISC ANIMATIONS */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}
.animate-float { animation: float 6s ease-in-out infinite; }
