/* =========================================
   UK Law Finder - Complete Stylesheet
   ========================================= */

/* === CSS Variables === */
:root {
    --primary: #1a365d;
    --primary-light: #2c5282;
    --primary-dark: #0f2440;
    --accent: #c9a227;
    --accent-light: #d4b34a;
    --accent-dark: #a8841e;
    --success: #38a169;
    --error: #e53e3e;
    --warning: #d69e2e;
    --info: #3182ce;
    --text: #2d3748;
    --text-light: #718096;
    --text-muted: #a0aec0;
    --bg: #f7fafc;
    --bg-white: #ffffff;
    --bg-light: #edf2f7;
    --border: #e2e8f0;
    --border-light: #f0f4f8;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-md: 0 6px 15px rgba(0,0,0,0.1);
    --shadow-lg: 0 15px 35px rgba(0,0,0,0.12);
    --shadow-xl: 0 25px 50px rgba(0,0,0,0.15);
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition: all 0.3s ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }
ul { list-style: none; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }

/* === Container === */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* === Top Bar === */
.top-bar {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.8);
    font-size: 0.8rem;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.top-bar-left i { color: var(--accent); margin-right: 6px; }
.top-bar-right { display: flex; gap: 16px; align-items: center; }
.top-bar-right a { color: rgba(255,255,255,0.8); font-size: 0.8rem; }
.top-bar-right a:hover { color: var(--accent); }
.top-bar-right a i { margin-right: 4px; }
.welcome-text { color: var(--accent); font-weight: 500; }

/* === Navigation === */
.main-nav {
    background: var(--primary);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}
.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-weight: 700;
    text-decoration: none;
}
.logo:hover { color: var(--accent-light); }
.logo i { font-size: 1.8rem; color: var(--accent); }
.logo-title { font-size: 1.3rem; font-family: var(--font-serif); display: block; letter-spacing: 0.5px; }
.logo-subtitle { font-size: 0.7rem; font-weight: 400; opacity: 0.7; display: block; text-transform: uppercase; letter-spacing: 1px; }

.nav-menu { display: flex; align-items: center; gap: 4px; }
.nav-menu li a {
    color: rgba(255,255,255,0.85);
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}
.nav-menu li a:hover, .nav-menu li a.active {
    background: rgba(255,255,255,0.1);
    color: white;
}
.nav-menu li a i { font-size: 0.85rem; }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 250px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 1001;
}
.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown-menu li a {
    color: var(--text) !important;
    padding: 10px 20px !important;
    border-radius: 0 !important;
    font-size: 0.88rem !important;
}
.dropdown-menu li a:hover {
    background: var(--bg-light) !important;
    color: var(--primary) !important;
}
.dropdown-toggle .fa-chevron-down { font-size: 0.65rem; margin-left: 2px; }

/* Mobile Nav Toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: white;
    margin: 5px 0;
    transition: var(--transition);
}

/* === Hero Section === */
.hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    position: relative;
    padding: 80px 0 100px;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 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-content { position: relative; text-align: center; max-width: 900px; margin: 0 auto; }
.hero-title { color: white; margin-bottom: 16px; }
.hero-title-accent {
    font-family: var(--font-serif);
    font-size: 3.2rem;
    font-weight: 800;
    display: block;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.hero-title-sub {
    font-size: 1.4rem;
    font-weight: 300;
    opacity: 0.9;
    display: block;
}
.hero-description {
    color: rgba(255,255,255,0.8);
    font-size: 1.05rem;
    margin-bottom: 36px;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

/* Hero Search */
.hero-search { margin-bottom: 36px; }
.search-form-hero {
    display: flex;
    gap: 0;
    max-width: 720px;
    margin: 0 auto;
    background: white;
    border-radius: 60px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    padding: 6px;
}
.search-input-wrapper {
    flex: 1;
    position: relative;
}
.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
}
.search-input {
    width: 100%;
    border: none;
    padding: 16px 20px 16px 50px;
    font-size: 1.05rem;
    outline: none;
    background: transparent;
    color: var(--text);
}
.search-input::placeholder { color: var(--text-muted); }
.btn-search {
    border-radius: 60px !important;
    padding: 14px 32px !important;
    font-size: 1rem !important;
    white-space: nowrap;
}

/* Search Tags */
.search-tags {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}
.search-tag-label { color: rgba(255,255,255,0.6); font-size: 0.85rem; }
.search-tag {
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.9);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    border: 1px solid rgba(255,255,255,0.15);
    transition: var(--transition);
}
.search-tag:hover { background: rgba(255,255,255,0.2); color: white; }

/* Hero Stats */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
}
.stat-item { text-align: center; }
.stat-number { font-size: 2rem; font-weight: 800; color: var(--accent); font-family: var(--font-serif); }
.stat-label { color: rgba(255,255,255,0.7); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; }

/* Autocomplete */
.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 100;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 4px;
}
.autocomplete-results.active { display: block; }
.autocomplete-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}
.autocomplete-item:hover { background: var(--bg-light); }
.autocomplete-item .ac-title { font-weight: 600; color: var(--text); font-size: 0.9rem; }
.autocomplete-item .ac-meta { font-size: 0.78rem; color: var(--text-light); margin-top: 2px; }
.autocomplete-item .ac-type {
    font-size: 0.7rem;
    background: var(--bg-light);
    padding: 2px 8px;
    border-radius: 10px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === Sections === */
.section { padding: 60px 0; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 36px;
    flex-wrap: wrap;
    gap: 16px;
}
.section-header h2 {
    font-size: 1.6rem;
    font-family: var(--font-serif);
    color: var(--primary);
}
.section-header h2 i { color: var(--accent); margin-right: 8px; }
.section-header p { color: var(--text-light); margin-top: 4px; }
.section-categories { background: var(--bg-white); }
.section-landmark { background: var(--bg-light); }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    border: 2px solid transparent;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    justify-content: center;
}
.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
}
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-block { width: 100%; display: flex; }
.btn-icon {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    color: var(--text-light);
    transition: var(--transition);
    cursor: pointer;
}
.btn-icon:hover { color: var(--accent); border-color: var(--accent); }

/* === Categories Grid === */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}
.category-card {
    background: var(--bg-light);
    padding: 28px 20px;
    border-radius: var(--radius-lg);
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--border-light);
    color: var(--text);
}
.category-card:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.category-card:hover .category-icon { background: rgba(255,255,255,0.15); color: var(--accent); }
.category-card:hover p { color: rgba(255,255,255,0.8); }
.category-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin: 0 auto 14px;
    transition: var(--transition);
}
.category-card h3 { font-size: 0.95rem; margin-bottom: 6px; font-weight: 600; }
.category-card p { font-size: 0.78rem; color: var(--text-light); line-height: 1.4; }

/* === Judgment Cards === */
.judgments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 24px;
}
.judgment-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}
.judgment-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
    border-color: var(--primary);
}
.judgment-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.court-badge {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.importance-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
}
.importance-badge.landmark { background: #FEF3C7; color: #92400E; }
.importance-badge.significant { background: #DBEAFE; color: #1E40AF; }
.judgment-card-title { font-size: 1.05rem; margin-bottom: 6px; line-height: 1.4; }
.judgment-card-title a { color: var(--text); }
.judgment-card-title a:hover { color: var(--primary); }
.judgment-card-citation { color: var(--text-light); font-size: 0.85rem; margin-bottom: 10px; font-weight: 500; }
.judgment-card-summary { color: var(--text-light); font-size: 0.88rem; flex: 1; margin-bottom: 14px; }
.judgment-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
    font-size: 0.82rem;
    color: var(--text-muted);
}
.judgment-card-footer i { margin-right: 4px; }

/* === Landmark Cards === */
.landmark-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}
.landmark-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    display: flex;
    transition: var(--transition);
}
.landmark-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.landmark-accent { width: 5px; background: var(--accent); flex-shrink: 0; }
.landmark-content { padding: 24px; flex: 1; }
.landmark-content h3 { font-size: 1rem; margin: 10px 0 6px; }
.landmark-content h3 a { color: var(--text); }
.landmark-content h3 a:hover { color: var(--primary); }
.landmark-content p { font-size: 0.85rem; color: var(--text-light); margin-bottom: 14px; }
.read-more { color: var(--primary); font-weight: 600; font-size: 0.85rem; }
.read-more:hover { color: var(--accent); }
.read-more i { margin-left: 4px; transition: var(--transition); }
.read-more:hover i { transform: translateX(4px); }

/* === Featured Layout (Most Viewed) === */
.featured-layout { display: grid; grid-template-columns: 1fr 350px; gap: 36px; }
.featured-main h2 { font-family: var(--font-serif); color: var(--primary); margin-bottom: 24px; font-size: 1.5rem; }
.featured-main h2 i { color: var(--accent); margin-right: 8px; }
.most-viewed-list { display: flex; flex-direction: column; gap: 16px; }
.most-viewed-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: var(--bg-white);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}
.most-viewed-item:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.rank {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.most-viewed-title { color: var(--text); font-weight: 600; font-size: 0.95rem; display: block; margin-bottom: 4px; }
.most-viewed-title:hover { color: var(--primary); }
.most-viewed-meta { font-size: 0.8rem; color: var(--text-light); display: flex; gap: 14px; }
.most-viewed-meta i { margin-right: 3px; }

/* === Sidebar Cards === */
.sidebar-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    margin-bottom: 20px;
}
.sidebar-card h3 {
    font-size: 1.05rem;
    margin-bottom: 14px;
    color: var(--primary);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-light);
}
.sidebar-card h3 i { color: var(--accent); margin-right: 6px; }
.sidebar-card p { font-size: 0.9rem; color: var(--text-light); margin-bottom: 16px; }

/* === Page Header === */
.page-header {
    background: var(--primary);
    padding: 40px 0;
    color: white;
}
.page-header h1 { font-size: 1.8rem; font-family: var(--font-serif); margin-bottom: 6px; }
.page-header h1 i { color: var(--accent); margin-right: 8px; }
.page-header p { opacity: 0.8; font-size: 0.95rem; }

/* === Search Page Layout === */
.search-layout { display: grid; grid-template-columns: 280px 1fr; gap: 30px; }
.search-sidebar {
    position: sticky;
    top: 90px;
    align-self: flex-start;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}
.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--border-light);
}
.filter-header h3 { font-size: 1.05rem; color: var(--primary); }
.filter-header h3 i { color: var(--accent); }
.clear-filters { font-size: 0.82rem; color: var(--error); }
.filter-group { margin-bottom: 18px; }
.filter-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.filter-label i { color: var(--accent); margin-right: 4px; width: 16px; text-align: center; }
.filter-select, .filter-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.88rem;
    color: var(--text);
    background: var(--bg);
    transition: var(--transition);
}
.filter-select:focus, .filter-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}
.mt-1 { margin-top: 8px; }
.filter-toggle { display: none; }

/* Search Bar Inline */
.search-bar-inline { margin-bottom: 24px; }
.search-form-inline {
    display: flex;
    gap: 0;
    background: var(--bg-white);
    border-radius: 60px;
    overflow: hidden;
    border: 2px solid var(--border);
    padding: 4px;
    transition: var(--transition);
}
.search-form-inline:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1); }
.search-form-inline .search-input { padding: 12px 16px 12px 44px; font-size: 0.95rem; }
.search-form-inline .btn { border-radius: 60px; padding: 10px 24px; }

/* Results */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
}
.results-count { color: var(--text-light); font-size: 0.95rem; }
.results-count strong { color: var(--text); }
.results-count em { color: var(--primary); font-style: normal; font-weight: 600; }
.results-list { display: flex; flex-direction: column; gap: 16px; }

.result-item {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-light);
    transition: var(--transition);
}
.result-item:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.result-date { margin-left: auto; color: var(--text-muted); font-size: 0.82rem; }
.result-title { font-size: 1.1rem; margin-bottom: 4px; }
.result-title a { color: var(--text); }
.result-title a:hover { color: var(--primary); }
.result-citation { color: var(--text-light); font-size: 0.88rem; font-weight: 500; margin-bottom: 6px; }
.result-judge { color: var(--text-light); font-size: 0.85rem; margin-bottom: 10px; }
.result-judge i { color: var(--accent); margin-right: 4px; }
.result-snippet { font-size: 0.9rem; color: var(--text-light); line-height: 1.65; margin-bottom: 12px; }
.result-snippet mark { background: #FEF3C7; padding: 1px 3px; border-radius: 2px; }
.result-categories { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.category-tag {
    background: var(--bg-light);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: var(--transition);
}
.category-tag:hover { background: var(--primary); color: white; }
.category-tag i { margin-right: 3px; font-size: 0.7rem; }
.result-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
    gap: 10px;
}
.result-meta { display: flex; gap: 16px; font-size: 0.82rem; color: var(--text-muted); }
.result-meta i { margin-right: 3px; }
.result-actions { display: flex; gap: 8px; align-items: center; }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 36px;
}
.page-link {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}
.page-link:hover, .page-link.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}
.no-results i { color: var(--text-muted); margin-bottom: 16px; }
.no-results h3 { font-size: 1.3rem; margin-bottom: 10px; color: var(--text); }
.no-results ul { text-align: left; max-width: 400px; margin: 20px auto; }
.no-results ul li { padding: 6px 0; font-size: 0.9rem; }
.no-results ul li::before { content: '• '; color: var(--accent); }

/* Search Initial */
.search-initial {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}
.search-initial i { color: var(--primary); opacity: 0.3; margin-bottom: 20px; }
.search-initial h2 { color: var(--primary); margin-bottom: 10px; }
.search-tips {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    max-width: 500px;
    margin: 24px auto 0;
    text-align: left;
}
.tip { font-size: 0.9rem; padding: 8px 0; }
.tip i { color: var(--success); margin-right: 8px; }

/* === Judgment Detail Page === */
.judgment-header-section {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
    padding: 30px 0 40px;
}
.judgment-breadcrumb {
    font-size: 0.82rem;
    margin-bottom: 20px;
    opacity: 0.8;
}
.judgment-breadcrumb a { color: rgba(255,255,255,0.7); }
.judgment-breadcrumb a:hover { color: var(--accent); }
.judgment-breadcrumb i { margin: 0 8px; font-size: 0.65rem; }
.judgment-badges { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.judgment-title { font-family: var(--font-serif); font-size: 1.8rem; margin-bottom: 8px; line-height: 1.3; }
.judgment-citation-large { font-size: 1.05rem; opacity: 0.85; font-weight: 500; margin-bottom: 24px; }
.judgment-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.meta-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.08);
    padding: 14px 18px;
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.1);
}
.meta-item i { font-size: 1.2rem; color: var(--accent); }
.meta-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; opacity: 0.7; display: block; }
.meta-value { font-size: 0.92rem; font-weight: 600; display: block; }
.judgment-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.judgment-actions .btn {
    border-color: rgba(255,255,255,0.3);
    color: white;
}
.judgment-actions .btn:hover { background: rgba(255,255,255,0.15); }
.judgment-actions .btn-primary { background: var(--accent); border-color: var(--accent); }
.judgment-actions .btn-primary:hover { background: var(--accent-dark); }

/* Judgment Content Layout */
.judgment-layout { display: grid; grid-template-columns: 1fr 350px; gap: 36px; }
.judgment-block {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 24px;
    border: 1px solid var(--border-light);
}
.block-title {
    font-size: 1.15rem;
    color: var(--primary);
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-light);
}
.block-title i { color: var(--accent); margin-right: 8px; }
.judgment-summary-text { font-size: 0.95rem; line-height: 1.8; color: var(--text); }
.judgment-headnote { font-size: 0.92rem; line-height: 1.7; color: var(--text-light); font-style: italic; }
.judgment-full-text { font-size: 0.95rem; line-height: 1.85; color: var(--text); }
.judgment-full-text h2 { font-size: 1.3rem; color: var(--primary); margin: 28px 0 14px; }
.judgment-full-text h3 { font-size: 1.1rem; color: var(--primary-light); margin: 24px 0 12px; }
.judgment-full-text p { margin-bottom: 14px; }
.judgment-full-text strong { color: var(--primary); }

/* Parties */
.parties-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.party-item {
    background: var(--bg-light);
    padding: 18px;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
}
.party-role { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); display: block; margin-bottom: 4px; }
.party-name { font-weight: 700; font-size: 1rem; display: block; margin-bottom: 4px; }
.party-counsel { font-size: 0.85rem; color: var(--text-light); }

/* Legislation & Cases */
.legislation-list { display: flex; flex-wrap: wrap; gap: 8px; }
.legislation-item {
    background: var(--bg-light);
    padding: 6px 14px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: var(--primary);
    border: 1px solid var(--border);
}
.cases-cited-list { display: flex; flex-direction: column; gap: 8px; }
.cited-case-item { font-size: 0.9rem; color: var(--text); padding: 8px 0; border-bottom: 1px solid var(--border-light); }
.cited-case-item i { color: var(--accent); margin-right: 8px; }

/* Sidebar Categories & Keywords */
.sidebar-categories { display: flex; flex-wrap: wrap; gap: 6px; }
.keyword-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.keyword-tag {
    background: var(--bg-light);
    color: var(--text);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    transition: var(--transition);
}
.keyword-tag:hover { background: var(--primary); color: white; }

/* Citation List */
.citation-list, .related-list { display: flex; flex-direction: column; gap: 10px; }
.citation-item, .related-item {
    display: block;
    padding: 10px;
    border-radius: var(--radius);
    background: var(--bg-light);
    transition: var(--transition);
    color: var(--text);
}
.citation-item:hover, .related-item:hover { background: var(--primary); color: white; }
.citation-item:hover small, .related-item:hover small { color: rgba(255,255,255,0.7); }
.citation-item strong, .related-item strong { font-size: 0.85rem; display: block; margin-bottom: 2px; }
.citation-item small, .related-item small { font-size: 0.75rem; color: var(--text-light); }

/* === Advanced Search Form === */
.advanced-search-form {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 36px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    margin-bottom: 40px;
}
.form-section {
    margin-bottom: 30px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
}
.form-section:last-of-type { border-bottom: none; }
.form-section h3 { font-size: 1.1rem; color: var(--primary); margin-bottom: 18px; }
.form-section h3 i { color: var(--accent); margin-right: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.form-group-full { grid-column: 1 / -1; }
.form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}
.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.92rem;
    color: var(--text);
    background: var(--bg);
    transition: var(--transition);
}
.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
    background: white;
}
.form-group small { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; display: block; }
.form-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    padding-top: 10px;
}
.form-check { margin-bottom: 16px; }
.form-check label { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; cursor: pointer; }
.form-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }

/* Search Tips Section */
.search-tips-section { margin-top: 40px; }
.search-tips-section h3 { font-family: var(--font-serif); font-size: 1.3rem; color: var(--primary); margin-bottom: 20px; }
.search-tips-section h3 i { color: var(--accent); }
.tips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.tip-card {
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}
.tip-card h4 { font-size: 0.95rem; margin-bottom: 8px; color: var(--primary); }
.tip-card h4 i { color: var(--accent); margin-right: 6px; }
.tip-card p { font-size: 0.88rem; color: var(--text-light); }
.tip-card code {
    background: var(--bg-light);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 0.82rem;
    color: var(--primary);
}

/* === Auth Pages === */
.auth-section { display: flex; align-items: center; min-height: 60vh; }
.auth-container { max-width: 480px; margin: 0 auto; width: 100%; }
.auth-card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}
.auth-header { text-align: center; margin-bottom: 28px; }
.auth-icon { font-size: 2.5rem; color: var(--primary); margin-bottom: 12px; }
.auth-header h1 { font-family: var(--font-serif); font-size: 1.6rem; color: var(--primary); margin-bottom: 6px; }
.auth-header p { color: var(--text-light); font-size: 0.9rem; }
.auth-form .form-group { margin-bottom: 18px; }
.auth-form label { font-size: 0.85rem; }
.auth-form label i { color: var(--accent); margin-right: 4px; }
.auth-footer { text-align: center; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border-light); }
.auth-footer p { font-size: 0.88rem; color: var(--text-light); }
.auth-footer a { color: var(--primary); font-weight: 600; }

/* Password Strength */
.password-strength {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}
.password-strength::after {
    content: '';
    display: block;
    height: 100%;
    width: 0;
    transition: var(--transition);
    border-radius: 2px;
}
.password-strength.weak::after { width: 33%; background: var(--error); }
.password-strength.medium::after { width: 66%; background: var(--warning); }
.password-strength.strong::after { width: 100%; background: var(--success); }

/* === Alerts === */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
}
.alert-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-info { background: #DBEAFE; color: #1E40AF; border: 1px solid #BFDBFE; }
.alert i { margin-right: 6px; }

/* === Flash Messages === */
.flash-message {
    padding: 14px 0;
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
}
.flash-success { background: #D1FAE5; color: #065F46; }
.flash-error { background: #FEE2E2; color: #991B1B; }
.flash-info { background: #DBEAFE; color: #1E40AF; }
.flash-message .container { display: flex; align-items: center; gap: 8px; }
.flash-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    opacity: 0.6;
    color: inherit;
}

/* === Profile Page === */
.profile-layout { display: grid; grid-template-columns: 1fr 350px; gap: 30px; }
.profile-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 24px;
    border: 1px solid var(--border-light);
}
.profile-card h2 { font-size: 1.15rem; color: var(--primary); margin-bottom: 18px; padding-bottom: 12px; border-bottom: 2px solid var(--border-light); }
.profile-card h2 i { color: var(--accent); margin-right: 8px; }
.profile-info-card { text-align: center; }
.profile-avatar { font-size: 4rem; color: var(--primary); margin-bottom: 12px; }
.profile-info-card h3 { margin-bottom: 4px; }
.profile-info-card p { color: var(--text-light); font-size: 0.9rem; }
.role-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 3px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 8px;
}
.profile-stats { display: flex; justify-content: center; gap: 30px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border-light); }
.profile-stat { text-align: center; }
.profile-stat strong { display: block; font-size: 1.4rem; color: var(--primary); }
.profile-stat span { font-size: 0.8rem; color: var(--text-light); }

/* History List */
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-light);
    border-radius: var(--radius);
}
.history-query { color: var(--text); font-size: 0.9rem; }
.history-query i { color: var(--text-muted); margin-right: 8px; }
.history-query:hover { color: var(--primary); }
.history-date { font-size: 0.78rem; color: var(--text-muted); }

/* Bookmark List */
.bookmarks-layout { display: grid; grid-template-columns: 240px 1fr; gap: 30px; }
.bookmarks-sidebar {
    position: sticky;
    top: 90px;
    align-self: flex-start;
}
.bookmarks-sidebar h3 { font-size: 1.05rem; color: var(--primary); margin-bottom: 14px; }
.bookmarks-sidebar h3 i { color: var(--accent); margin-right: 6px; }
.folder-list li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9rem;
    transition: var(--transition);
}
.folder-list li a:hover, .folder-list li a.active { background: var(--primary); color: white; }
.folder-list li a.active .folder-count { background: rgba(255,255,255,0.2); }
.folder-count {
    margin-left: auto;
    background: var(--bg-light);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}
.bookmark-notes {
    background: #FFFBEB;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: #92400E;
    margin-bottom: 14px;
    border: 1px solid #FDE68A;
}
.bookmark-notes i { margin-right: 6px; }
.bookmark-mini-list { display: flex; flex-direction: column; gap: 8px; }
.bookmark-mini-item {
    display: block;
    padding: 8px 10px;
    background: var(--bg-light);
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: var(--text);
    transition: var(--transition);
}
.bookmark-mini-item:hover { background: var(--primary); color: white; }
.bookmark-mini-item:hover small { color: rgba(255,255,255,0.7); }
.bookmark-mini-item small { display: block; font-size: 0.75rem; color: var(--text-light); margin-top: 2px; }

/* === Footer === */
.site-footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.8);
    padding: 60px 0 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 1.3rem;
    font-family: var(--font-serif);
    font-weight: 700;
    margin-bottom: 14px;
}
.footer-logo i { color: var(--accent); font-size: 1.5rem; }
.footer-col p { font-size: 0.88rem; line-height: 1.7; margin-bottom: 18px; }
.footer-col h4 {
    color: white;
    font-size: 1rem;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255,255,255,0.1);
}
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { color: rgba(255,255,255,0.7); font-size: 0.88rem; }
.footer-col ul li a:hover { color: var(--accent); }
.footer-social { display: flex; gap: 12px; }
.footer-social a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.footer-social a:hover { background: var(--accent); color: white; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    text-align: center;
    font-size: 0.82rem;
}
.disclaimer { opacity: 0.6; margin-top: 6px; font-size: 0.78rem; }

/* === Back to Top === */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--accent); transform: translateY(-3px); }

/* === Utility Classes === */
.text-muted { color: var(--text-muted); }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }
.bookmark-folder { font-size: 0.78rem; color: var(--text-light); }
.bookmark-folder i { margin-right: 3px; color: var(--accent); }

/* === Print Styles === */
@media print {
    .main-nav, .top-bar, .site-footer, .judgment-actions, .sidebar-card,
    .back-to-top, .judgment-sidebar { display: none !important; }
    .judgment-layout { grid-template-columns: 1fr !important; }
    .judgment-header-section { background: white !important; color: black !important; padding: 10px 0 !important; }
    .judgment-title { color: black !important; }
    .judgment-full-text { font-size: 11pt; }
    body { background: white; }
}

/* === Responsive === */
@media (max-width: 1024px) {
    .featured-layout { grid-template-columns: 1fr; }
    .judgment-layout { grid-template-columns: 1fr; }
    .profile-layout { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-menu {
        display: none;
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        background: var(--primary);
        flex-direction: column;
        padding: 16px;
        box-shadow: var(--shadow-lg);
    }
    .nav-menu.active { display: flex; }
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(255,255,255,0.05);
        margin-top: 4px;
        border-radius: var(--radius);
    }
    .dropdown-menu li a { color: rgba(255,255,255,0.8) !important; }

    .hero-title-accent { font-size: 2.2rem; }
    .hero-title-sub { font-size: 1rem; }
    .hero-stats { gap: 24px; flex-wrap: wrap; }
    .stat-number { font-size: 1.5rem; }

    .search-form-hero { border-radius: var(--radius-lg); flex-direction: column; }
    .btn-search { border-radius: var(--radius) !important; }

    .search-layout { grid-template-columns: 1fr; }
    .search-sidebar {
        position: static;
        display: none;
    }
    .search-sidebar.show { display: block; }
    .filter-toggle { display: inline-flex; }

    .judgments-grid { grid-template-columns: 1fr; }
    .landmark-grid { grid-template-columns: 1fr; }
    .categories-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .parties-grid { grid-template-columns: 1fr; }
    .search-tips { grid-template-columns: 1fr; }
    .tips-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .form-actions { flex-direction: column; }

    .bookmarks-layout { grid-template-columns: 1fr; }
    .bookmarks-sidebar { position: static; }

    .footer-grid { grid-template-columns: 1fr; }
    .auth-card { padding: 28px 20px; }

    .top-bar-content { justify-content: center; text-align: center; }
    .top-bar-left { display: none; }

    .judgment-title { font-size: 1.3rem; }
    .judgment-meta-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .hero { padding: 50px 0 70px; }
    .hero-title-accent { font-size: 1.8rem; }
    .section { padding: 40px 0; }
    .judgment-meta-grid { grid-template-columns: 1fr; }
    .result-footer { flex-direction: column; align-items: flex-start; }
    .top-bar-right { gap: 10px; }
}
