:root {
    --judisyn-navy: #0a1628;
    --judisyn-blue: #1e3a5f;
    --judisyn-blue-light: #2d5a8e;
    --judisyn-silver: #e8ecf1;
    --judisyn-gold: #c9a227;
    --judisyn-gold-light: #dbb94a;
    --judisyn-white: #ffffff;
    --judisyn-text: #1a2332;
    --judisyn-muted: #6b7c93;
    --judisyn-radius: 16px;
    --judisyn-shadow: 0 4px 24px rgba(10, 22, 40, 0.08);
    --judisyn-shadow-lg: 0 12px 48px rgba(10, 22, 40, 0.12);
}

* { box-sizing: border-box; }

body.judisyn-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--judisyn-text);
    background: #f8fafc;
    line-height: 1.6;
}

h1, h2, h3, .display-font {
    font-family: 'Playfair Display', Georgia, serif;
}

/* Navbar */
.judisyn-navbar {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(30, 58, 95, 0.08);
    padding: 0.65rem 0;
    box-shadow: 0 1px 0 rgba(10, 22, 40, 0.04);
}

.judisyn-nav-container {
    max-width: 1400px;
}

.judisyn-main-nav {
    gap: 0.15rem;
}

.judisyn-main-nav .nav-link {
    font-weight: 500;
    color: var(--judisyn-text) !important;
    font-size: 0.875rem;
    padding: 0.55rem 0.85rem !important;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
    position: relative;
}

.judisyn-main-nav .nav-link:hover {
    background: rgba(30, 58, 95, 0.06);
    color: var(--judisyn-blue) !important;
}

.judisyn-main-nav .nav-link.active {
    color: var(--judisyn-navy) !important;
    font-weight: 600;
    background: rgba(201, 162, 39, 0.12);
}

.judisyn-main-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0.25rem;
    left: 50%;
    transform: translateX(-50%);
    width: 1.25rem;
    height: 2px;
    background: var(--judisyn-gold);
    border-radius: 2px;
}

.judisyn-nav-actions {
    border-top: 1px solid var(--judisyn-silver);
}

@media (min-width: 1200px) {
    .judisyn-nav-actions {
        border-top: none;
        gap: 0.75rem !important;
    }
}

.btn-nav-ghost {
    color: var(--judisyn-navy);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-nav-ghost:hover {
    background: var(--judisyn-silver);
    color: var(--judisyn-navy);
}

.nav-user-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem 0.35rem 0.35rem;
    border-radius: 50px;
    background: var(--judisyn-silver);
    color: var(--judisyn-navy) !important;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.nav-user-pill:hover,
.nav-user-pill.show {
    background: white;
    border-color: rgba(30, 58, 95, 0.12);
    box-shadow: var(--judisyn-shadow);
}

.nav-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--judisyn-blue), var(--judisyn-navy));
    color: var(--judisyn-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.navbar-search .search-input-wrapper {
    min-width: 200px;
    max-width: 240px;
}

@media (max-width: 1199.98px) {
    .judisyn-main-nav {
        padding: 0.5rem 0;
        gap: 0;
    }

    .judisyn-main-nav .nav-link {
        padding: 0.65rem 0.5rem !important;
        font-size: 0.95rem;
    }

    .judisyn-main-nav .nav-link.active::after {
        display: none;
    }

    .judisyn-nav-actions {
        padding-bottom: 0.75rem;
    }
}

.brand-logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    line-height: 0;
}

.brand-logo {
    height: 52px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    display: block;
}

.brand-logo-footer {
    height: 44px;
    max-width: 170px;
    background: white;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
}

.brand-logo-auth {
    height: 64px;
    max-width: 220px;
}

.brand-logo-hero {
    height: 80px;
    max-width: 280px;
}

.navbar-brand {
    padding: 0;
    margin-right: 1rem;
}

@media (max-width: 576px) {
    .brand-logo { height: 42px; max-width: 160px; }
}

.navbar-search .search-input-wrapper {
    display: flex; align-items: center; gap: 0.5rem;
    background: var(--judisyn-silver);
    border-radius: 12px;
    padding: 0.35rem 0.35rem 0.35rem 1rem;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.navbar-search .search-input-wrapper:focus-within {
    background: white;
    border-color: var(--judisyn-blue-light);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.navbar-search input {
    border: none; background: transparent; box-shadow: none;
    font-size: 0.9rem;
}

.navbar-search input:focus { outline: none; box-shadow: none; }

/* Legacy nav-link fallback */
.nav-link {
    font-weight: 500;
    color: var(--judisyn-text) !important;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem !important;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-link:hover { background: var(--judisyn-silver); color: var(--judisyn-blue) !important; }

/* Buttons */
.btn-gold {
    background: linear-gradient(135deg, var(--judisyn-gold), var(--judisyn-gold-light));
    color: var(--judisyn-navy);
    border: none;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.2s;
}

.btn-gold:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(201, 162, 39, 0.4);
    color: var(--judisyn-navy);
}

.btn-navy {
    background: var(--judisyn-navy);
    color: white;
    border: none;
    font-weight: 600;
    border-radius: 10px;
}

.btn-navy:hover { background: var(--judisyn-blue); color: white; }

.btn-outline-navy {
    border: 2px solid var(--judisyn-navy);
    color: var(--judisyn-navy);
    font-weight: 600;
    border-radius: 10px;
    background: transparent;
}

.btn-outline-navy:hover { background: var(--judisyn-navy); color: white; }

/* Hero */
.hero-section {
    position: relative;
    background: linear-gradient(160deg, var(--judisyn-navy) 0%, var(--judisyn-blue) 50%, #1a4a7a 100%);
    color: white;
    padding: 6rem 0 8rem;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-particles {
    position: absolute;
    inset: 0;
    opacity: 0.15;
    background: radial-gradient(circle at 20% 50%, var(--judisyn-gold) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, #4a90d9 0%, transparent 40%);
}

.hero-content { position: relative; z-index: 2; }

.hero-title {
    font-size: clamp(2.5rem, 5vw, 3.75rem);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 1.25rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.85;
    max-width: 560px;
    margin: 0 auto 2.5rem;
}

.hero-search {
    max-width: 720px;
    margin: 0 auto;
}

.hero-search-box {
    display: flex;
    background: rgba(255,255,255,0.95);
    border-radius: 16px;
    padding: 0.5rem;
    box-shadow: var(--judisyn-shadow-lg);
    gap: 0.5rem;
}

.hero-search-box input {
    flex: 1;
    border: none;
    padding: 1rem 1.25rem;
    font-size: 1.05rem;
    border-radius: 12px;
    color: var(--judisyn-text);
}

.hero-search-box input:focus { outline: none; }

.search-examples {
    margin-top: 1.25rem;
    font-size: 0.85rem;
    opacity: 0.7;
}

.search-examples a {
    color: var(--judisyn-gold-light);
    text-decoration: none;
    margin: 0 0.5rem;
}

.search-examples a:hover { text-decoration: underline; }

/* Cards */
.judisyn-card {
    background: white;
    border-radius: var(--judisyn-radius);
    border: 1px solid rgba(30, 58, 95, 0.06);
    box-shadow: var(--judisyn-shadow);
    transition: all 0.3s ease;
    overflow: hidden;
}

.judisyn-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--judisyn-shadow-lg);
}

.judgment-card { padding: 1.5rem; }

.judgment-card .citation {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--judisyn-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.judgment-card .title {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--judisyn-navy);
    margin: 0.5rem 0;
    line-height: 1.4;
}

.judgment-card .meta {
    font-size: 0.85rem;
    color: var(--judisyn-muted);
}

/* Sections */
.section-padding { padding: 5rem 0; }

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--judisyn-navy);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--judisyn-muted);
    font-size: 1.05rem;
    margin-bottom: 3rem;
}

/* Feature cards */
.feature-icon {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--judisyn-blue), var(--judisyn-navy));
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    color: var(--judisyn-gold);
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

/* Pricing */
.pricing-card {
    padding: 2.5rem 2rem;
    text-align: center;
    height: 100%;
}

.pricing-card.featured {
    border: 2px solid var(--judisyn-gold);
    position: relative;
}

.pricing-card.featured::before {
    content: 'Most Popular';
    position: absolute;
    top: -12px; left: 50%; transform: translateX(-50%);
    background: var(--judisyn-gold);
    color: var(--judisyn-navy);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 1rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pricing-price {
    font-size: 3rem;
    font-weight: 700;
    color: var(--judisyn-navy);
    font-family: 'Playfair Display', serif;
}

.pricing-price span { font-size: 1rem; color: var(--judisyn-muted); font-family: 'Inter', sans-serif; }

/* Footer */
.judisyn-footer {
    background: var(--judisyn-navy);
    margin-top: 4rem;
}

.footer-links a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 2;
    transition: color 0.2s;
}

.footer-links a:hover { color: var(--judisyn-gold); }

/* Judgment page */
.judgment-header {
    background: white;
    border-bottom: 1px solid var(--judisyn-silver);
    padding: 2rem 0;
}

.judgment-sidebar {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.judgment-text {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--judisyn-text);
}

.judgment-text p { margin-bottom: 1.25rem; }

.judgment-text .para-num {
    color: var(--judisyn-blue);
    font-weight: 600;
    margin-right: 0.5rem;
}

.ai-panel {
    background: linear-gradient(135deg, #f0f4f8, #e8ecf1);
    border-radius: var(--judisyn-radius);
    padding: 1.5rem;
}

.ai-panel .ai-action-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.65rem 1rem;
    border: 1px solid rgba(30,58,95,0.1);
    background: white;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--judisyn-text);
    transition: all 0.2s;
    cursor: pointer;
}

.ai-panel .ai-action-btn:hover {
    border-color: var(--judisyn-blue);
    background: var(--judisyn-blue);
    color: white;
}

/* Search results */
.search-filters {
    background: white;
    border-radius: var(--judisyn-radius);
    padding: 1.5rem;
    box-shadow: var(--judisyn-shadow);
}

.search-hit {
    padding: 1.5rem;
    border-bottom: 1px solid var(--judisyn-silver);
    transition: background 0.2s;
}

.search-hit:hover { background: #f8fafc; }

.search-hit em, .search-hit mark {
    background: rgba(201, 162, 39, 0.25);
    font-style: normal;
    padding: 0 2px;
    border-radius: 2px;
}

/* Badges */
.badge-court {
    background: rgba(30, 58, 95, 0.1);
    color: var(--judisyn-blue);
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
}

/* FAQ */
.faq-item {
    border: 1px solid var(--judisyn-silver);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.faq-item .accordion-button {
    font-weight: 600;
    color: var(--judisyn-navy);
    background: white;
    box-shadow: none;
}

.faq-item .accordion-button:not(.collapsed) {
    background: var(--judisyn-silver);
    color: var(--judisyn-blue);
}

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

.animate-fade-in { animation: fadeInUp 0.6s ease forwards; }

/* Responsive */
@media (max-width: 768px) {
    .hero-section { padding: 4rem 0 5rem; }
    .hero-search-box { flex-direction: column; }
    .judgment-sidebar { position: static; max-height: none; }
}
