:root {
    /* Dark Theme (Default) */
    --bg-base: #0a0a0d;
    --bg-surface: rgba(20, 20, 25, 0.6);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #a0a0ab;
    --accent-1: #6366f1; /* Indigo */
    --accent-2: #a855f7; /* Purple */
    --accent-3: #ec4899; /* Pink */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-base: #f8fafc;
    --bg-surface: rgba(255, 255, 255, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.6);
    --border-glass: rgba(0, 0, 0, 0.08);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --shadow-glass: 0 8px 32px 0 rgba(100, 100, 111, 0.2);
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Background Gradients */
.blob-bg {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.4;
    animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-1), transparent 70%);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-2), transparent 70%);
}

.blob-3 {
    top: 40%;
    left: 60%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-3), transparent 70%);
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}

/* Typography Utilities */
.gradient-text {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* Header */
.glass-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-glass);
    padding: 16px 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.header-brand {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.site-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.logo-icon {
    color: var(--accent-1);
    font-size: 20px;
}

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

.main-nav {
    display: flex;
    gap: 32px;
}

.header-container .main-nav {
    margin-left: auto;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: color var(--transition-fast);
}

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

/* Buttons */
.icon-button {
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.icon-button:hover {
    background: var(--bg-glass);
    transform: translateY(-2px);
}

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

.btn-primary {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

/* Hero Section */
.hero-section {
    padding: 100px 0 80px;
    text-align: center;
}

.hero-container {
    max-width: 800px;
}

.badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
    backdrop-filter: blur(4px);
}

.hero-title {
    font-size: 64px;
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 24px;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

/* Comparison Section */
.comparison-section {
    padding: 40px 0 100px;
}

.grid-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    align-items: start;
}

/* Sidebar / Glass Panel */
.glass-panel {
    background: var(--bg-surface);
    position: sticky;
    top: 100px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--shadow-glass);
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.text-button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.text-button:hover {
    color: var(--text-primary);
}

.filter-group {
    margin-bottom: 28px;
}

.filter-group h3 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    transition: color var(--transition-fast);
}

.checkbox-label:hover {
    color: var(--accent-1);
}

input[type="checkbox"], input[type="radio"] {
    accent-color: var(--accent-1);
    width: 16px;
    height: 16px;
}

.range-slider {
    width: 100%;
    accent-color: var(--accent-1);
    margin-bottom: 12px;
}

.range-values {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Main Grid Controls */
.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.results-count {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
}

.sort-control {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-secondary);
}

.glass-select {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 8px 16px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    backdrop-filter: blur(4px);
}

/* Firms Grid */
.firms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* Firm Cards */
.firm-card {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 24px;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.firm-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.firm-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-glass);
}

[data-theme="light"] .firm-card:hover {
    border-color: rgba(0, 0, 0, 0.15);
}

.firm-card:hover::before {
    opacity: 1;
}

.firm-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.firm-logo-image {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--border-glass);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.firm-logo-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02));
    border: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    font-family: var(--font-heading);
    color: var(--text-primary);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Firm Detail Gallery & Lightbox */
.firm-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.gallery-item {
    height: 160px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--border-glass);
    cursor: zoom-in;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.gallery-item:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.3);
}

.lightbox-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: zoom-out;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-overlay img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    border: 1px solid var(--border-glass);
}

[data-theme="light"] .firm-logo-placeholder {
    background: linear-gradient(135deg, rgba(0,0,0,0.05), rgba(0,0,0,0.02));
}

.firm-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    font-size: 14px;
    background: var(--bg-glass);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--border-glass);
}

.star-icon {
    color: var(--warning);
}

.firm-name {
    font-size: 22px;
    margin-bottom: 12px;
}

.firm-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.tag {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
}

.tag.kyc-no {
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.1);
}

.firm-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-value {
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-body);
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-glass);
}

.price {
    font-size: 24px;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--text-primary);
}

.price-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-surface);
    border: 1px dashed var(--border-glass);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 16px;
}

/* Challenge Tabs UI */
.challenge-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 16px;
}

.tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--bg-glass);
    border-color: var(--border-glass);
    color: var(--accent-1);
}

.tab-content {
    display: none;
    animation: fadeIn var(--transition-normal);
}

.tab-content.active {
    display: block;
}

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

/* SEO Content Section */
.seo-content-section {
    padding: 20px 0 80px;
}

.seo-panel {
    padding: 40px;
    border-radius: 24px;
    position: static;
}

.seo-panel h2 {
    font-size: 28px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.seo-panel h3 {
    font-size: 22px;
    margin-top: 24px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.seo-panel p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 16px;
    line-height: 1.7;
}

.seo-panel p:last-child {
    margin-bottom: 0;
}

/* Footer */
.glass-footer {
    padding: 40px 0;
    border-top: 1px solid var(--border-glass);
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 14px;
    gap: 16px;
}

.footer-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-actions p {
    margin: 0;
}

/* Responsive */
@media (max-width: 900px) {
    .grid-container {
        grid-template-columns: 1fr;
    }
    .hero-title {
        font-size: 48px;
    }
    .filters-sidebar {
        position: relative;
        top: auto;
        transition: opacity 0.8s ease, filter 0.8s ease, transform 0.8s ease;
        --mobile-filter-progress: 1;
        opacity: calc(0.3 + 0.7 * var(--mobile-filter-progress));
        filter: blur(calc((1 - var(--mobile-filter-progress)) * 20px));
        transform: translateY(calc(-20px * (1 - var(--mobile-filter-progress))));
    }
}

@media (max-width: 600px) {
    .header-container {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    .header-brand {
        width: 100%;
        justify-content: space-between;
    }
    .header-actions {
        display: flex;
        justify-content: flex-end;
    }
    .main-nav {
        gap: 16px;
        width: 100%;
        justify-content: center;
    }
    .hero-title {
        font-size: 36px;
    }
    .footer-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}
