/* ==========================================================================
   PHILIPPINE SUPREME COURT SEARCH ENGINE - MODERN DESIGN SYSTEM
   ========================================================================== */

/* 1. Design Tokens & Root Custom Properties */
:root {
    /* Color Palette */
    --bg-obsidian: hsl(222, 25%, 10%);
    --bg-slate-dark: hsl(222, 20%, 15%);
    --bg-glass-card: hsla(222, 20%, 18%, 0.65);
    --border-glass: hsla(222, 20%, 30%, 0.35);
    
    --accent-purple: hsl(190, 95%, 55%); /* Brilliant Cyan (kept variable name for compatibility) */
    --accent-purple-glow: hsla(190, 95%, 55%, 0.35);
    --accent-purple-hover: hsl(190, 100%, 75%);
    
    --accent-gold: hsl(45, 100%, 55%);
    --accent-gold-glow: hsla(45, 100%, 55%, 0.25);
    
    --text-primary: hsl(0, 0%, 100%); /* Pure white */
    --text-secondary: hsl(210, 60%, 85%); /* Light ice blue instead of gray */
    --text-muted: hsl(210, 50%, 75%); /* Bright blue-tinted instead of dark gray */
    
    /* System Colors */
    --color-success: hsl(142, 70%, 45%);
    --color-warning: hsl(38, 90%, 55%);
    --color-danger: hsl(350, 80%, 55%);
    
    /* Layout & Shadow constants */
    --shadow-premium: 0 12px 30px -10px hsla(222, 30%, 5%, 0.8), 0 0 1px 1px var(--border-glass);
    --shadow-purple: 0 8px 30px -4px var(--accent-purple-glow);
    --radius-large: 16px;
    --radius-medium: 10px;
    --radius-small: 6px;
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* US Bar Reviewer Inspired Dashboard Colors */
    --admin-bg-sidebar: hsl(222, 30%, 8%);
    --admin-teal: hsl(171, 100%, 41%);
    --admin-teal-glow: hsla(171, 100%, 41%, 0.2);
    --admin-orange: hsl(27, 98%, 54%);
    --admin-orange-glow: hsla(27, 98%, 54%, 0.2);
    --admin-blue: hsl(207, 90%, 54%);
    --admin-blue-glow: hsla(207, 90%, 54%, 0.2);
}

/* 2. Global Resets & Theme Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

body {
    background-color: var(--bg-obsidian);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-glass);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-purple);
}

/* 3. Header Styling */
.app-header {
    background-color: var(--bg-slate-dark);
    border-bottom: 1px solid var(--border-glass);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.4);
    z-index: 50;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 26px;
}

.logo-text h1 {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.1;
}

.logo-text .tagline {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* DB Status indicator badge */
.db-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background-color: hsla(222, 20%, 8%, 0.5);
    border: 1px solid var(--border-glass);
    border-radius: 30px;
    font-size: 12px;
    font-weight: 500;
}

.db-status.free-tier {
    color: var(--color-warning);
    border-color: hsla(38, 90%, 55%, 0.2);
}

.db-status.premium-tier {
    color: var(--color-success);
    border-color: hsla(142, 70%, 45%, 0.2);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    box-shadow: 0 0 10px 1px currentColor;
}

/* 4. Split-Pane Workspace Layout */
.app-workspace {
    flex: 1;
    display: flex;
    height: calc(100vh - 64px);
    overflow: hidden;
}

/* Column 1: Sidebar pane */
.sidebar-pane {
    width: 320px;
    background-color: var(--bg-slate-dark);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 20px;
    flex-shrink: 0;
}

/* Column 2: Results pane */
.results-pane {
    width: 380px;
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    background-color: var(--bg-obsidian);
    flex-shrink: 0;
}

/* Column 3: Reader pane */
.reader-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-obsidian);
    overflow: hidden;
}

/* Pane Header standard styling */
.pane-header {
    height: 56px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-glass);
    background-color: var(--bg-slate-dark);
    flex-shrink: 0;
}

.pane-header h2 {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
}

/* 5. Inputs & Filter Sections in Sidebar */
.search-container {
    margin-bottom: 24px;
}

.search-bar {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 14px;
}

.search-bar input {
    width: 100%;
    padding: 12px 12px 12px 38px;
    background-color: hsl(222, 20%, 10%);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-medium);
    color: var(--text-primary);
    font-size: 13px;
    transition: var(--transition-smooth);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px var(--accent-purple-glow);
}

.clear-btn {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 2px;
}

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

.filter-section {
    margin-bottom: 24px;
}

.filter-section h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Grid of year toggle buttons */
.year-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.year-btn {
    padding: 8px 4px;
    background-color: hsl(222, 20%, 10%);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-small);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: var(--transition-smooth);
}

.year-btn:hover {
    border-color: var(--accent-purple);
    color: var(--text-primary);
}

.year-btn.active {
    background-color: var(--accent-purple);
    border-color: var(--accent-purple);
    color: var(--text-primary);
    box-shadow: var(--shadow-purple);
}

.year-btn.locked {
    position: relative;
    opacity: 0.65;
    background-image: linear-gradient(45deg, var(--border-glass) 25%, transparent 25%, transparent 50%, var(--border-glass) 50%, var(--border-glass) 75%, transparent 75%, transparent);
    background-size: 10px 10px;
}

.year-btn.locked::after {
    content: "🔒";
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 8px;
}

/* Scrollable Ponente (Justice) List */
.ponente-search-bar input {
    width: 100%;
    padding: 8px 12px;
    background-color: hsl(222, 20%, 10%);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-small);
    color: var(--text-primary);
    font-size: 12px;
    margin-bottom: 8px;
}

.ponente-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-small);
    background-color: hsl(222, 20%, 10%);
    padding: 4px;
}

.ponente-item {
    padding: 8px 10px;
    border-radius: var(--radius-small);
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: var(--transition-smooth);
}

.ponente-item:hover {
    background-color: hsla(262, 70%, 60%, 0.1);
    color: var(--text-primary);
}

.ponente-item.active {
    background-color: var(--accent-purple);
    color: var(--text-primary);
}

/* 6. Results Feed Card List */
.results-feed-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feed-welcome-state, .reader-empty-state, .loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    margin: auto;
    color: var(--text-muted);
}

.welcome-icon, .empty-icon {
    font-size: 40px;
    margin-bottom: 16px;
    opacity: 0.65;
}

.feed-welcome-state h3, .reader-empty-state h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.feed-welcome-state p, .reader-empty-state p {
    font-size: 13px;
    max-width: 280px;
    line-height: 1.5;
}

/* Standard Result Card */
.result-card {
    background-color: var(--bg-glass-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-medium);
    padding: 16px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.result-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background-color: var(--accent-purple);
    transition: var(--transition-smooth);
}

.result-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-purple);
    box-shadow: var(--shadow-purple);
}

.result-card:hover::before {
    width: 4px;
}

.result-card.active {
    background-color: hsla(262, 70%, 60%, 0.1);
    border-color: var(--accent-purple);
}

.result-card.active::before {
    width: 4px;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--accent-purple-hover);
    font-weight: 600;
    margin-bottom: 8px;
}

.card-date {
    color: var(--text-muted);
    font-weight: 400;
}

.result-card h4 {
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.card-ponente {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.card-snippet {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
    background-color: hsla(222, 20%, 8%, 0.4);
    padding: 8px;
    border-radius: var(--radius-small);
    border-left: 2px solid var(--border-glass);
}

/* 7. Full-Text Legal Reader Views */
.reader-document-view {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    background-color: hsl(222, 25%, 8%);
}

.case-document-header {
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 24px;
    margin-bottom: 30px;
}

.case-citation {
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    color: var(--accent-purple-hover);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.case-document-header h2 {
    font-size: 22px;
    line-height: 1.3;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.case-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    background-color: var(--bg-slate-dark);
    padding: 12px 16px;
    border-radius: var(--radius-medium);
    border: 1px solid var(--border-glass);
}

.meta-item {
    font-size: 12px;
}

.meta-item .label {
    display: block;
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.meta-item .value {
    color: var(--text-secondary);
    font-weight: 500;
}

.case-document-body {
    font-size: 16px;
    line-height: 1.8;
    color: hsl(210, 15%, 88%);
    max-width: 720px;
    margin: 0 auto;
}

.case-document-body p {
    margin-bottom: 24px;
    text-align: justify;
}

.case-document-body h3 {
    font-size: 16px;
    margin: 32px 0 16px;
    border-left: 3px solid var(--accent-purple);
    padding-left: 12px;
    color: var(--text-primary);
}

mark {
    background-color: var(--accent-gold-glow);
    color: var(--accent-gold);
    padding: 2px 4px;
    border-radius: 3px;
    border-bottom: 1px solid var(--accent-gold);
}

mark.highlight {
    background-color: var(--accent-gold);
    color: hsl(222, 25%, 10%);
    box-shadow: 0 0 10px 1px var(--accent-gold-glow);
    border-bottom: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

mark.highlight:hover {
    background-color: #ff5252;
    color: white;
    box-shadow: 0 0 10px 1px rgba(255, 82, 82, 0.4);
    text-decoration: line-through;
}

mark.highlight:hover::after {
    content: "✕";
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #ff5252;
    color: white;
    font-size: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    text-decoration: none;
}

/* ==========================================================================
   8. REDESIGNED ADMIN DASHBOARD SHELL (US BAR REVIEWER ALIGNED)
   ========================================================================== */
.admin-panel-overlay {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    height: 100vh;
    background-color: hsl(222, 25%, 8%);
    box-shadow: 0 -20px 40px rgba(0, 0, 0, 0.6);
    z-index: 100;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   9. GOOGLE-STYLE LANDING HERO
   ========================================================================== */
.landing-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 64px);
    background-color: var(--bg-obsidian);
    padding: 20px;
    animation: fadeIn 0.5s ease-out;
}

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

.hero-logo-large {
    text-align: center;
    margin-bottom: 40px;
}

.hero-logo-large .hero-icon {
    font-size: 72px;
    display: block;
    margin-bottom: 16px;
    background: -webkit-linear-gradient(45deg, var(--accent-primary), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-logo-large h1 {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.hero-logo-large p {
    color: var(--text-muted);
    font-size: 16px;
}

.hero-search-container {
    width: 100%;
    max-width: 680px;
}

.hero-search-bar {
    display: flex;
    align-items: center;
    background-color: hsl(222, 20%, 12%);
    border: 1px solid var(--border-glass);
    border-radius: 30px;
    padding: 6px 8px;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
    transition: var(--transition-smooth);
}

.hero-search-bar:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-glow), 0 10px 30px -10px rgba(0,0,0,0.5);
}

.search-type-select {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    border-right: 1px solid var(--border-glass);
}

.search-type-select option {
    background-color: var(--bg-slate-dark);
    color: var(--text-primary);
}

.hero-search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 16px 20px;
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
}

.hero-search-btn {
    background-color: var(--accent-primary);
    color: var(--bg-obsidian);
    border: none;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.hero-search-btn:hover {
    background-color: var(--accent-primary-hover);
    transform: scale(1.05);
}

.hero-quick-filters {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

.filter-hint {
    font-size: 13px;
    color: var(--text-muted);
}

.hero-pill-btn {
    background-color: hsla(210, 20%, 98%, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.hero-pill-btn:hover {
    background-color: hsla(210, 20%, 98%, 0.1);
    color: var(--text-primary);
}

.admin-panel-overlay.active {
    bottom: 0;
}

/* The structural framework shell */
.admin-dashboard-shell {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Column 1: Command Sidebar */
.admin-sidebar {
    width: 280px;
    background-color: var(--admin-bg-sidebar);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-shadow: 10px 0 30px rgba(0,0,0,0.3);
}

.admin-sidebar-logo {
    height: 90px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--border-glass);
}

.logo-icon-glowing {
    font-size: 28px;
    background-color: var(--admin-teal-glow);
    padding: 8px;
    border-radius: 12px;
    color: var(--admin-teal);
    box-shadow: 0 0 15px 1px var(--admin-teal-glow);
}

.admin-sidebar-logo h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.admin-sidebar-logo p {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Navigation items inside sidebar */
.admin-nav-menu {
    flex: 1;
    overflow-y: auto;
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-section-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    padding: 16px 28px 8px;
    text-transform: uppercase;
}

.admin-nav-item {
    background: transparent;
    border: none;
    padding: 14px 28px;
    color: var(--text-secondary);
    font-family: 'Outfit', sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    text-align: left;
    position: relative;
    border-left: 4px solid transparent;
    transition: var(--transition-smooth);
}

.admin-nav-item:hover {
    background-color: hsla(210, 20%, 98%, 0.03);
    color: var(--text-primary);
}

/* Dynamic active selection indicator */
.admin-nav-item.active {
    background-color: hsla(210, 20%, 98%, 0.05);
    color: var(--text-primary);
    border-left-color: var(--admin-teal);
    font-weight: 600;
}

.admin-nav-item .nav-icon {
    font-size: 16px;
    opacity: 0.8;
}

/* Profile Card at bottom of sidebar */
.admin-sidebar-profile {
    margin: 24px;
    padding: 16px;
    background-color: hsla(210, 20%, 98%, 0.04);
    border-radius: var(--radius-large);
    border: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--admin-teal);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.profile-info {
    flex: 1;
    overflow: hidden;
}

.profile-info h4 {
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-info p {
    font-size: 10px;
    color: var(--text-muted);
}

.admin-exit-btn {
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.6;
    transition: var(--transition-smooth);
}

.admin-exit-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Column 2: Dashboard Viewport Screen Panels */
.admin-main-viewport {
    flex: 1;
    background-color: hsl(222, 25%, 6%);
    overflow-y: auto;
    padding: 40px;
    display: flex;
    flex-direction: column;
}

.admin-tab-content {
    display: none;
    flex-direction: column;
    height: 100%;
}

.admin-tab-content.active {
    display: flex;
}

.view-header {
    margin-bottom: 32px;
}

.view-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.view-header p {
    font-size: 14px;
    color: var(--text-muted);
}

/* Immersive Card wrapper */
.admin-card-immersive {
    background-color: var(--bg-glass-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-large);
    padding: 30px;
    box-shadow: var(--shadow-premium);
    margin-bottom: 24px;
}

.flex-grow {
    flex: 1;
}

/* ==========================================================================
   📊 US BAR REVIEWER STYLE METRICS & WIDGETS
   ========================================================================== */

/* Metrics cards grid */
.stats-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background-color: var(--bg-glass-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-large);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-premium);
    transition: var(--transition-smooth);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-purple);
}

.stat-icon {
    font-size: 26px;
    padding: 12px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Glowing colors for stats badges */
.stats-teal .stat-icon { background-color: var(--admin-teal-glow); color: var(--admin-teal); }
.stats-orange .stat-icon { background-color: var(--admin-orange-glow); color: var(--admin-orange); }
.stats-purple .stat-icon { background-color: var(--accent-purple-glow); color: var(--accent-purple-hover); }
.stats-blue .stat-icon { background-color: var(--admin-blue-glow); color: var(--admin-blue); }

.stat-info h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 4px;
}

.stat-info p {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Dashboard sub-panels grids */
.overview-subgrid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 24px;
}

.overview-card {
    background-color: var(--bg-glass-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-large);
    padding: 24px;
    box-shadow: var(--shadow-premium);
}

.overview-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 24px;
    border-left: 3px solid var(--admin-teal);
    padding-left: 12px;
}

/* Horizontal progress distribution bars */
.distribution-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dist-bar-item {
    font-size: 12.5px;
}

.dist-bar-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.dist-bar-meta .count {
    font-weight: 600;
    color: var(--admin-teal);
}

.dist-progress-track {
    height: 8px;
    width: 100%;
    background-color: hsl(222, 20%, 10%);
    border-radius: 4px;
    overflow: hidden;
}

.dist-progress-bar {
    height: 100%;
    background-color: var(--admin-teal);
    border-radius: 4px;
    box-shadow: 0 0 10px var(--admin-teal-glow);
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Vertical Activity Timeline Feed */
.activity-timeline-feed {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-left: 20px;
}

.activity-timeline-feed::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 6px;
    bottom: 6px;
    width: 1px;
    background-color: var(--border-glass);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -20px;
    top: 5px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: var(--text-muted);
    border: 2px solid hsl(222, 25%, 6%);
}

.timeline-dot.success { background-color: var(--color-success); box-shadow: 0 0 8px var(--color-success); }
.timeline-dot.warning { background-color: var(--color-warning); box-shadow: 0 0 8px var(--color-warning); }

.timeline-content h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.timeline-content p {
    font-size: 11.5px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 4px;
}

.timeline-time {
    font-size: 10px;
    color: var(--text-muted);
}

/* ==========================================================================
   💻 COMMAND PIPELINE & TERMINAL LOGS
   ========================================================================== */
.pipeline-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 24px;
    margin-bottom: 24px;
}

.action-description h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.action-description p {
    font-size: 12px;
    color: var(--text-muted);
}

.action-btns {
    display: flex;
    gap: 12px;
}

/* Terminal Log panel */
.terminal-container {
    flex: 1;
    background-color: hsl(222, 30%, 3%);
    border-radius: var(--radius-medium);
    border: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 400px;
}

.terminal-header {
    background-color: hsl(222, 20%, 8%);
    border-bottom: 1px solid var(--border-glass);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.terminal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.terminal-dot.red { background-color: var(--color-danger); }
.terminal-dot.yellow { background-color: var(--color-warning); }
.terminal-dot.green { background-color: var(--color-success); }

.terminal-title {
    font-family: monospace;
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 8px;
}

.terminal-screen {
    flex: 1;
    padding: 18px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    line-height: 1.6;
    color: var(--color-success);
    overflow-y: auto;
    white-space: pre-wrap;
    text-shadow: 0 0 2px rgba(34, 197, 94, 0.4);
}

.terminal-welcome {
    color: var(--text-muted);
    text-shadow: none;
}

/* ==========================================================================
   ⚙️ SETTINGS, PAYWALLS, AND DATA TABLES
   ========================================================================== */
.settings-form-group {
    margin-bottom: 24px;
}

.settings-form-group label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.settings-form-group .label-hint {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.admin-checklist-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    background-color: hsl(222, 20%, 8%);
    padding: 16px;
    border-radius: var(--radius-medium);
    border: 1px solid var(--border-glass);
    max-height: 200px;
    overflow-y: auto;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-label input {
    accent-color: var(--admin-teal);
}

.flex-row {
    display: flex;
    gap: 16px;
}

.form-input-box {
    flex: 1;
}

.form-input-box input {
    width: 100%;
    padding: 12px;
    background-color: hsl(222, 20%, 8%);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-small);
    color: var(--text-primary);
    font-size: 13px;
    margin-top: 6px;
    transition: var(--transition-smooth);
}

.form-input-box input:focus {
    outline: none;
    border-color: var(--admin-teal);
}

/* Accounts Table styling details */
.table-search-row {
    margin-bottom: 20px;
}

.table-search-row input {
    width: 320px;
    padding: 10px 14px;
    background-color: hsl(222, 20%, 8%);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-small);
    color: var(--text-primary);
    font-size: 13px;
    transition: var(--transition-smooth);
}

.table-search-row input:focus {
    outline: none;
    border-color: var(--admin-teal);
}

.admin-table-container {
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-medium);
    background-color: hsl(222, 20%, 8%);
    overflow-y: auto;
    max-height: 400px;
}

.admin-user-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.admin-user-table th {
    background-color: hsl(222, 20%, 10%);
    padding: 12px 16px;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-glass);
}

.admin-user-table td {
    padding: 12px 16px;
    color: var(--text-secondary);
    border-bottom: 1px solid hsla(222, 20%, 30%, 0.15);
}

/* ==========================================================================
   9. UPGRADE PREMIUM PAYWALL MODAL
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

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

.modal-content {
    background-color: var(--bg-glass-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-large);
    max-width: 680px;
    width: 100%;
    position: relative;
    padding: 40px;
    box-shadow: var(--shadow-premium);
    overflow: hidden;
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}

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

.paywall-header {
    text-align: center;
    margin-bottom: 30px;
}

.paywall-icon {
    font-size: 40px;
    margin-bottom: 12px;
    display: block;
}

.paywall-header h2 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.paywall-header p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 480px;
    margin: 0 auto;
}

/* Upgrade plan cards grid layout */
.pricing-cards-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.pricing-card {
    background-color: hsl(222, 20%, 12%);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-large);
    padding: 24px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: var(--transition-smooth);
}

.pricing-card:hover {
    border-color: var(--accent-purple);
    transform: translateY(-2px);
}

.card-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 9px;
    background-color: var(--accent-purple);
    color: var(--text-primary);
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.pricing-card h3 {
    font-size: 15px;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.price-box {
    display: flex;
    align-items: baseline;
    margin-bottom: 16px;
}

.price-box .currency {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-right: 2px;
}

.price-box .price-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
}

.price-box .period {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 4px;
}

.features-list {
    list-style: none;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.features-list li {
    display: flex;
    gap: 8px;
    align-items: start;
}

.features-list li::before {
    content: "✓";
    color: var(--accent-purple-hover);
    font-weight: bold;
}

.paywall-footer {
    text-align: center;
}

.payment-badges {
    font-size: 11px;
    color: var(--text-muted);
}

/* ==========================================================================
   10. BUTTONS & METADATA BADGES
   ========================================================================== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-medium);
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.btn-primary {
    background-color: var(--accent-purple);
    color: var(--text-primary);
    box-shadow: var(--shadow-purple);
}

.btn-primary:hover {
    background-color: var(--accent-purple-hover);
}

.btn-secondary {
    background-color: hsl(222, 20%, 8%);
    color: var(--text-secondary);
    border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
    border-color: var(--accent-purple);
    color: var(--text-primary);
}

.btn-block {
    width: 100%;
}

.btn-small {
    padding: 6px 12px;
    font-size: 11px;
    border-radius: var(--radius-small);
}

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

.btn-danger:hover {
    opacity: 0.9;
}

.btn-icon-only {
    background: transparent;
    border: none;
    font-size: 16px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-small);
    transition: var(--transition-smooth);
}

.btn-icon-only:hover {
    background-color: var(--border-glass);
    color: var(--text-primary);
}

.badge {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background-color: var(--border-glass);
    color: var(--text-secondary);
}

.badge-success {
    background-color: hsla(142, 70%, 45%, 0.15);
    color: var(--color-success);
    border: 1px solid hsla(142, 70%, 45%, 0.2);
}

.badge-secondary {
    background-color: hsla(222, 20%, 30%, 0.15);
    color: var(--text-muted);
    border: 1px solid var(--border-glass);
}

.margin-top-large {
    margin-top: 24px;
}

/* Tablet Fallback Layering rules */
.reader-pane.fullscreen-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background-color: var(--bg-obsidian);
    animation: fadeIn 0.3s ease-out forwards;
}

@media (max-width: 1200px) {
    .app-workspace {
        flex-direction: column;
        overflow-y: auto;
    }
    
    .sidebar-pane {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-glass);
        flex-direction: row;
        gap: 16px;
        overflow-x: auto;
        overflow-y: hidden;
    }
    
    .filter-section {
        margin-bottom: 0;
        min-width: 260px;
    }
    
    .results-pane {
        width: 100%;
        height: 45vh;
        min-height: 300px;
        border-right: none;
        border-bottom: 1px solid var(--border-glass);
        flex-shrink: 0;
    }
    
    .reader-pane {
        min-height: 60vh;
        flex: 1;
    }
    
    .admin-dashboard-shell {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-glass);
    }
    
    .admin-nav-menu {
        flex-direction: row;
        overflow-x: auto;
        padding: 10px;
    }
    
    .nav-section-title {
        display: none;
    }
    
    .admin-nav-item {
        padding: 10px 16px;
        border-left: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
    }
    
    .admin-nav-item.active {
        border-left-color: transparent;
        border-bottom-color: var(--admin-teal);
    }
    
    .admin-sidebar-profile {
        display: none;
    }
}

/* ==========================================================================
   FEATURE STYLES: 5 POWER-USER FEATURES
   ========================================================================== */

/* --- FEATURE 1: Citation Cross-Referencing Links --- */
.citation-link {
    color: var(--accent-purple);
    text-decoration: none;
    border-bottom: 1px dashed var(--accent-purple);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-smooth);
    position: relative;
}

.citation-link:hover {
    color: var(--accent-purple-hover);
    border-bottom-color: var(--accent-purple-hover);
    text-shadow: 0 0 12px var(--accent-purple-glow);
}

.citation-link::after {
    content: "🔗";
    font-size: 10px;
    margin-left: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.citation-link:hover::after {
    opacity: 1;
}

/* --- FEATURE 2: Syllabus Mode Banner --- */
.syllabus-mode-banner {
    background: linear-gradient(135deg, hsla(190, 95%, 55%, 0.1), hsla(45, 100%, 55%, 0.08));
    border: 1px solid hsla(190, 95%, 55%, 0.3);
    border-radius: var(--radius-medium);
    padding: 12px 20px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--accent-purple-hover);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeIn 0.3s ease-out;
}

.syllabus-mode-banner a {
    color: var(--accent-gold);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
    margin-left: 4px;
    transition: var(--transition-smooth);
}

.syllabus-mode-banner a:hover {
    color: var(--text-primary);
    text-shadow: 0 0 10px var(--accent-gold-glow);
}

/* --- FEATURE 3: Search Tips Modal Activation --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: hsla(222, 30%, 5%, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.search-tips-btn {
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition-smooth);
}

.search-tips-btn:hover {
    color: var(--accent-purple);
    border-color: var(--accent-purple);
    box-shadow: 0 0 12px var(--accent-purple-glow);
}

.search-tips-modal-content {
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.search-tips-header {
    text-align: center;
    margin-bottom: 24px;
}

.tips-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
}

.search-tips-header h2 {
    font-size: 22px;
    margin-bottom: 8px;
}

.search-tips-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.search-tips-body {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.tip-card {
    background-color: hsla(222, 20%, 12%, 0.6);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-medium);
    padding: 16px;
    transition: var(--transition-smooth);
}

.tip-card:hover {
    border-color: var(--accent-purple);
    transform: translateY(-2px);
}

.tip-card h4 {
    font-size: 13px;
    color: var(--accent-purple-hover);
    margin-bottom: 6px;
}

.tip-card p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.4;
}

.tip-example {
    display: block;
    background-color: hsla(222, 20%, 8%, 0.8);
    color: var(--accent-gold);
    padding: 8px 12px;
    border-radius: var(--radius-small);
    font-size: 12px;
    font-family: 'Fira Code', 'Consolas', monospace;
    border-left: 2px solid var(--accent-gold);
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    z-index: 10;
}

.modal-close-btn:hover {
    color: var(--color-danger);
    border-color: var(--color-danger);
    background-color: hsla(350, 80%, 55%, 0.1);
}

.glassmorphism-card {
    background: var(--bg-glass-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-large);
    padding: 32px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-premium);
    position: relative;
    animation: modalSlideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- FEATURE 4: Bookmarks UI --- */
.bookmarks-section {
    margin-bottom: 16px !important;
}

.bookmarks-toggle-btn {
    width: 100%;
    background: linear-gradient(135deg, hsla(45, 100%, 55%, 0.08), hsla(45, 100%, 55%, 0.03));
    border: 1px solid hsla(45, 100%, 55%, 0.2);
    color: var(--accent-gold);
    padding: 12px 16px;
    border-radius: var(--radius-medium);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-smooth);
}

.bookmarks-toggle-btn:hover {
    background: linear-gradient(135deg, hsla(45, 100%, 55%, 0.15), hsla(45, 100%, 55%, 0.06));
    border-color: var(--accent-gold);
    box-shadow: 0 0 16px hsla(45, 100%, 55%, 0.15);
    transform: translateY(-1px);
}

.badge {
    background-color: var(--accent-purple);
    color: var(--bg-obsidian);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.badge-small {
    font-size: 10px;
    padding: 1px 6px;
    min-width: 16px;
    background-color: var(--accent-gold);
}

.bookmarks-header-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, hsla(45, 100%, 55%, 0.1), hsla(45, 100%, 55%, 0.03));
    border: 1px solid hsla(45, 100%, 55%, 0.25);
    border-radius: var(--radius-medium);
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-gold);
}

.clear-bookmarks-btn {
    background: transparent;
    border: 1px solid hsla(350, 80%, 55%, 0.3);
    color: var(--color-danger);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.clear-bookmarks-btn:hover {
    background-color: hsla(350, 80%, 55%, 0.15);
    border-color: var(--color-danger);
}

.bookmark-indicator {
    border-left-color: var(--accent-gold) !important;
    color: var(--accent-gold) !important;
    background-color: hsla(45, 100%, 55%, 0.05) !important;
}

/* Reader toolbar active button states */
.btn-icon-only {
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-small);
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-smooth);
}

.btn-icon-only:hover {
    color: var(--text-primary);
    border-color: var(--accent-purple);
    background-color: hsla(190, 95%, 55%, 0.08);
}

.btn-icon-only.active {
    color: var(--accent-gold);
    border-color: var(--accent-gold);
    background-color: hsla(45, 100%, 55%, 0.1);
    box-shadow: 0 0 10px hsla(45, 100%, 55%, 0.15);
}

.reader-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* --- FEATURE 5: Export (no extra CSS needed, reuses btn-icon-only) --- */

/* --- TOAST NOTIFICATION SYSTEM --- */
.toast-notification {
    position: fixed;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--bg-glass-card), hsla(222, 20%, 22%, 0.95));
    border: 1px solid var(--accent-purple);
    color: var(--text-primary);
    padding: 14px 28px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    z-index: 300;
    box-shadow: 0 8px 30px -4px hsla(222, 30%, 5%, 0.6), 0 0 20px var(--accent-purple-glow);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    white-space: nowrap;
    pointer-events: none;
}

.toast-notification.show {
    bottom: 32px;
    opacity: 1;
}

.toast-notification.hide {
    bottom: -80px;
    opacity: 0;
}

/* --- Paywall Modal Styles --- */
.paywall-header {
    text-align: center;
    margin-bottom: 24px;
}

.paywall-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.paywall-header h2 {
    font-size: 22px;
    margin-bottom: 8px;
}

.paywall-header p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
}

.pricing-cards-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.pricing-card {
    background-color: hsla(222, 20%, 12%, 0.6);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-large);
    padding: 24px;
    text-align: center;
    position: relative;
    transition: var(--transition-smooth);
}

.pricing-card:hover {
    border-color: var(--accent-purple);
    transform: translateY(-2px);
}

.card-tag {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-gold));
    color: var(--bg-obsidian);
    font-size: 10px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 12px;
    letter-spacing: 0.05em;
}

.price-box {
    margin: 16px 0;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}

.currency {
    font-size: 18px;
    color: var(--text-muted);
}

.price-value {
    font-family: 'Outfit', sans-serif;
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
}

.period {
    font-size: 13px;
    color: var(--text-muted);
}

.features-list {
    list-style: none;
    text-align: left;
    margin-bottom: 20px;
}

.features-list li {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 6px 0;
    border-bottom: 1px solid hsla(222, 20%, 30%, 0.15);
}

.features-list li::before {
    content: "✓ ";
    color: var(--color-success);
    font-weight: 700;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-medium);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-purple), hsl(200, 95%, 45%));
    color: var(--bg-obsidian);
}

.btn-primary:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-purple);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
}

.btn-secondary:hover {
    background-color: hsla(45, 100%, 55%, 0.1);
    transform: scale(1.03);
}

.paywall-footer {
    text-align: center;
}

.payment-badges {
    font-size: 12px;
    color: var(--text-muted);
}

/* Responsive adjustments for search tips modal */
@media (max-width: 600px) {
    .search-tips-body {
        grid-template-columns: 1fr;
    }
    
    .pricing-cards-container {
        grid-template-columns: 1fr;
    }
}

/* Premium Pagination Styling */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: var(--bg-slate-dark);
    border-top: 1px solid var(--border-glass);
    flex-shrink: 0;
    z-index: 10;
    box-shadow: 0 -4px 10px -5px rgba(0, 0, 0, 0.4);
}

.pagination-btn {
    padding: 8px 16px;
    background-color: hsla(222, 20%, 10%, 0.6);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-medium);
    color: var(--accent-purple);
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pagination-btn:hover:not(:disabled) {
    background-color: var(--accent-purple-glow);
    border-color: var(--accent-purple);
    color: var(--text-primary);
    box-shadow: 0 0 10px 1px var(--accent-purple-glow);
}

.pagination-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    color: var(--text-muted);
    border-color: var(--border-glass);
}

.pagination-info {
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

/* Premium Sort Controls Layout (2x2 Grid) */
.sort-controls-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 14px 16px;
    background-color: var(--bg-slate-dark);
    border-bottom: 1px solid var(--border-glass);
    flex-shrink: 0;
    z-index: 10;
    box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.4);
}

.sort-btn {
    padding: 11px 12px;
    background-color: hsla(222, 20%, 10%, 0.65);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-medium);
    color: var(--text-secondary);
    font-family: 'Outfit', sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    user-select: none;
}

.sort-btn:hover:not(:disabled) {
    background-color: var(--accent-purple-glow);
    border-color: var(--accent-purple);
    color: var(--text-primary);
    transform: translateY(-1.5px);
    box-shadow: 0 4px 15px -3px var(--accent-purple-glow);
}

.sort-btn:active:not(:disabled) {
    transform: translateY(0);
}

.sort-btn.active:not(:disabled) {
    background-color: var(--accent-purple) !important;
    border-color: var(--accent-purple) !important;
    color: var(--bg-obsidian) !important;
    font-weight: 700;
    transform: translateY(0);
    box-shadow: var(--shadow-purple) !important;
}

.sort-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background-color: hsla(222, 20%, 10%, 0.2) !important;
    border-color: var(--border-glass) !important;
    color: var(--text-muted) !important;
    transform: none !important;
    box-shadow: none !important;
}

/* ==========================================================================
   🏛️ PREMIUM ROADMAP STYLES: COMPARATIVE SPLIT-PANE & OVERRULED CITATIONS
   ========================================================================== */

.reader-split-container {
    display: flex;
    flex: 1;
    width: 100%;
    height: calc(100% - 56px);
    overflow: hidden;
    position: relative;
}

.secondary-pane {
    width: 0;
    opacity: 0;
    height: 100%;
    overflow-y: auto;
    border-left: 1px solid var(--border-glass);
    background-color: hsl(222, 25%, 6%);
    display: flex;
    flex-direction: column;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    padding: 0;
    flex-shrink: 0;
}

.secondary-pane.active {
    width: 50%;
    opacity: 1;
}

.secondary-pane-header {
    height: 48px;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-glass);
    background-color: var(--bg-slate-dark);
    flex-shrink: 0;
}

.secondary-pane-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-purple-hover);
    margin: 0;
}

.secondary-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: var(--transition-smooth);
}

.secondary-close-btn:hover {
    color: var(--color-danger);
    transform: scale(1.1);
}

.secondary-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

/* Dynamic Citation Links Styling */
.legal-link {
    color: var(--accent-purple);
    text-decoration: none;
    border-bottom: 1px dashed var(--accent-purple);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-smooth);
    position: relative;
    padding: 0 2px;
}

.legal-link:hover {
    color: var(--accent-purple-hover);
    border-bottom-color: var(--accent-purple-hover);
    background-color: var(--accent-purple-glow);
    text-shadow: 0 0 12px var(--accent-purple-glow);
    border-radius: 4px;
}

.legal-link::after {
    content: " 🔗";
    font-size: 9px;
    opacity: 0.7;
}

/* Overruled Landmark Danger Banner */
.precedent-warning-banner {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: var(--radius-medium);
    padding: 16px 20px;
    margin-bottom: 24px;
    color: hsl(0, 100%, 75%);
    font-size: 13.5px;
    line-height: 1.6;
    border-left: 5px solid var(--color-danger);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.15);
    animation: pulseGlow 3s infinite alternate;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 10px rgba(239, 68, 68, 0.1);
    }
    100% {
        box-shadow: 0 0 25px rgba(239, 68, 68, 0.25);
    }
}

/* "Cited In" Subsequent Citation Analytics UI */
.citing-cases-drawer {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border-glass);
}

.citing-cases-drawer h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-gold);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.citing-cases-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    list-style: none;
    padding: 0;
}

.citing-case-item {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-medium);
    font-size: 12.5px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.citing-case-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-purple);
    transform: translateX(4px);
    box-shadow: 0 4px 15px -3px var(--accent-purple-glow);
}

.citing-case-title {
    font-weight: 600;
    color: var(--text-primary);
}

.citing-case-date {
    font-size: 11px;
    color: var(--text-muted);
}

/* ==========================================================================
   🚦 TRAFFIC LIGHT CASE STATUS SYSTEM
   ========================================================================== */

.traffic-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 8px;
    cursor: help;
    transition: var(--transition-smooth);
}

.traffic-badge-green {
    background: hsla(120, 60%, 35%, 0.15);
    border: 1px solid hsla(120, 60%, 40%, 0.35);
    color: hsl(120, 70%, 60%);
}

.traffic-badge-green:hover {
    background: hsla(120, 60%, 35%, 0.28);
    box-shadow: 0 0 10px hsla(120, 60%, 40%, 0.2);
}

.traffic-badge-red {
    background: hsla(0, 80%, 50%, 0.15);
    border: 1px solid hsla(0, 80%, 55%, 0.35);
    color: hsl(0, 80%, 70%);
}

.traffic-badge-red:hover {
    background: hsla(0, 80%, 50%, 0.28);
    box-shadow: 0 0 10px hsla(0, 80%, 55%, 0.2);
}

.traffic-badge-yellow {
    background: hsla(45, 100%, 50%, 0.12);
    border: 1px solid hsla(45, 100%, 55%, 0.3);
    color: hsl(45, 100%, 65%);
}

/* Result cards with overruled status get a subtle red left border */
.card-overruled {
    border-left: 3px solid hsla(0, 80%, 55%, 0.5) !important;
}

.card-overruled:hover {
    border-left-color: hsl(0, 80%, 60%) !important;
}

/* ==========================================================================
   📓 RESEARCH FOLDERS & NOTEPAD STYLES
   ========================================================================== */

.folders-section h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.folder-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    transition: var(--transition-smooth);
    padding: 6px 8px !important;
    border-radius: 6px !important;
}

.folder-btn:hover {
    background: hsla(190, 95%, 55%, 0.08) !important;
    color: var(--accent-purple-hover) !important;
}

/* ==========================================================================
   📑 TABLE OF CONTENTS (TOC) IN READER
   ========================================================================== */

.toc-container {
    background: rgba(20, 25, 35, 0.5);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-medium);
    padding: 16px;
    margin: 16px 0 24px 0;
}

.toc-container h4 {
    color: var(--accent-gold);
    font-size: 14px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toc-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition-smooth);
    display: block;
    border-left: 2px solid transparent;
}

.toc-link:hover {
    color: var(--accent-purple-hover);
    background: hsla(190, 95%, 55%, 0.1);
    border-left-color: var(--accent-purple);
}

.heading-anchor {
    scroll-margin-top: 80px;
}

/* ==========================================================================
   🖍️ IN-TEXT MULTI-COLOR HIGHLIGHTING
   ========================================================================== */

.highlight-yellow {
    background-color: hsla(60, 100%, 50%, 0.25);
    border-bottom: 2px solid hsl(60, 100%, 60%);
    color: #fff;
    padding: 0 4px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.highlight-green {
    background-color: hsla(120, 60%, 40%, 0.25);
    border-bottom: 2px solid hsl(120, 60%, 50%);
    color: #fff;
    padding: 0 4px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.highlight-red {
    background-color: hsla(0, 80%, 50%, 0.25);
    border-bottom: 2px solid hsl(0, 80%, 60%);
    color: #fff;
    padding: 0 4px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.highlight-yellow:hover, .highlight-green:hover, .highlight-red:hover {
    filter: brightness(1.2);
}

/* ==========================================================================
   📖 LEGAL TERM GLOSSARY TOOLTIPS
   ========================================================================== */

.glossary-term {
    border-bottom: 1px dotted var(--accent-gold);
    color: var(--accent-gold);
    cursor: help;
    transition: var(--transition-smooth);
    padding: 0 2px;
}

.glossary-term:hover {
    background-color: hsla(45, 100%, 55%, 0.15);
    border-radius: 2px;
}

.glossary-tooltip {
    position: fixed;
    z-index: 9999;
    background: var(--bg-slate-dark);
    border: 1px solid var(--accent-gold);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--radius-medium);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 10px hsla(45, 100%, 55%, 0.15);
    max-width: 300px;
    font-size: 13px;
    line-height: 1.5;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    backdrop-filter: blur(10px);
}

.glossary-tooltip.visible {
    opacity: 1;
}

.glossary-tooltip-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 4px;
    font-size: 14px;
    border-bottom: 1px solid hsla(45, 100%, 55%, 0.2);
    padding-bottom: 4px;
}

.glossary-term {
    border-bottom: 1px dashed #c49a45;
    cursor: help;
    transition: all 0.2s ease;
}
.glossary-term:hover {
    background-color: rgba(196, 154, 69, 0.1);
}

#highlight-menu {
    position: absolute;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 6px;
    display: none;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    z-index: 10000;
}
.hl-color { width: 20px; height: 20px; border-radius: 50%; cursor: pointer; transition: transform 0.1s; }
.hl-color:hover { transform: scale(1.2); }
.hl-yellow { background: #ffeaa7; }
.hl-green { background: #55efc4; }
.hl-red { background: #ff7675; }
.hl-blue { background: #74b9ff; }
.hl-btn { color: white; cursor: pointer; font-size: 12px; padding: 4px 8px; border-left: 1px solid #444; }
.hl-btn:hover { color: #c49a45; }

.custom-highlight { padding: 2px 0; border-radius: 2px; color: #000; }
.hl-bg-yellow { background: rgba(255, 234, 167, 0.7); }
.hl-bg-green { background: rgba(85, 239, 196, 0.7); }
.hl-bg-red { background: rgba(255, 118, 117, 0.7); }
.hl-bg-blue { background: rgba(116, 185, 255, 0.7); }
.dark-theme .custom-highlight { color: #fff; }

/* === MOBILE FIRST UI FIXES === */
@media (max-width: 768px) {
    .app-body {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        max-height: 250px;
        overflow-y: auto;
    }
    .results-pane {
        width: 100%;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .reader-pane {
        width: 100%;
        flex: 1;
    }
    #secondary-reader-pane {
        border-top: 1px solid var(--border-color);
        border-left: none;
    }
    .app-header {
        padding: 0 10px;
    }
}
