/* Synoptix Premium Theme */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
    /* Primary Palette */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #ec4899;
    --accent: #06b6d4;

    /* Transitions */
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

/* Dark Mode (Default) */
body.dark-mode {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-glass: rgba(15, 23, 42, 0.6);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-glass: 1px solid rgba(255, 255, 255, 0.1);
    --shadow-main: 0 10px 40px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
}

/* Light Mode - Purified & Raised */
body.light-mode {
    --bg-dark: #f1f5f9;
    /* Soft white/grey background */
    --bg-card: #ffffff;
    /* Pure white cards */
    --bg-glass: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-glass: 1px solid rgba(0, 0, 0, 0.04);
    --shadow-main: 0 20px 50px rgba(0, 0, 0, 0.08), 0 5px 15px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 4px 20px rgba(99, 102, 241, 0.1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

body.dark-mode {
    background-image:
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
}

body.light-mode {
    background-image:
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.03) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.03) 0px, transparent 50%);
    background-attachment: fixed;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.03em;
}

/* Utilities */
.container {
    max-width: 1700px;
    margin: 0 auto;
    padding: 0 60px;
}

.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-main);
    transition: var(--transition);
}

/* Layout Containers */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
    position: relative;
    width: 100vw;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    scroll-behavior: smooth;
    position: relative;
}

/* Vertical Icon Sidebar */
.icon-sidebar {
    width: 70px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 0;
    gap: 12px;
    z-index: 1000;
    flex-shrink: 0;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    white-space: nowrap;
}

.icon-sidebar:hover {
    width: 270px;
    box-shadow: 25px 0 50px rgba(0, 0, 0, 0.2);
}

.icon-btn {
    width: calc(100% - 20px);
    margin: 0 10px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 15px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    background: transparent;
    position: relative;
    text-decoration: none;
    box-sizing: border-box;
}

.sidebar-label {
    margin-left: 15px;
    font-weight: 600;
    font-size: 0.95rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.icon-sidebar:hover .sidebar-label {
    opacity: 1;
}

.icon-btn i {
    min-width: 24px;
    text-align: center;
    font-size: 18px;
}

.icon-btn:hover,
.icon-btn.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.sidebar-item.active i {
    color: var(--primary);
}

/* Light Mode Overrides for Sidebar */
.light-mode .icon-sidebar {
    background: rgba(255, 255, 255, 0.9);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.02);
}

.light-mode .sidebar-label {
    color: var(--text-main);
}

.light-mode .icon-btn:hover,
.light-mode .icon-btn.active {
    background: rgba(99, 102, 241, 0.08);
}

/* Floating Actions */
.floating-buttons {
    position: fixed;
    right: 30px;
    bottom: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.fab {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1.1rem;
}

.fab:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 12px 35px rgba(99, 102, 241, 0.5);
}

.fab.back-to-top {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.fab.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Component Overrides for Light Mode */
.light-mode .glass-panel {
    background: #ffffff;
    /* Force pure white */
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.8rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    border: none;
    gap: 0.6rem;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.light-mode .btn-secondary {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
}

.logo span {
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0;
}

/* Tagger Workspace */
.ld-workspace {
    display: block;
    position: relative;
}

.ld-sidebar {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 380px;
    z-index: 2000;
    background: var(--bg-card);
    border: var(--border-glass);
    border-right: none;
    border-radius: 24px 0 0 24px;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.05);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ld-sidebar:hover {
    width: 420px;
    height: 80vh;
    padding: 2.5rem 2rem;
    overflow-y: auto;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    justify-content: flex-start;
    align-items: stretch;
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.15);
}

.ld-sidebar-label {
    writing-mode: vertical-rl;
    text-transform: uppercase;
    letter-spacing: 0.4em;
    font-weight: 900;
    font-size: 0.85rem;
    color: var(--primary);
    opacity: 0.8;
    transition: opacity 0.3s ease;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 15px;
}

.ld-sidebar-label i {
    transform: rotate(90deg);
    margin-bottom: 10px;
}

.ld-sidebar:hover .ld-sidebar-label {
    display: none;
}

.ld-sidebar .ld-stat-card {
    border: none;
    box-shadow: none;
    padding: 0;
    background: transparent;
    opacity: 0;
    transition: opacity 0.3s ease;
    min-width: 320px;
    display: none;
}

.ld-sidebar:hover .ld-stat-card {
    opacity: 1;
    display: block;
}

.ld-tag {
    position: relative;
    padding: 2px 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    display: inline;
    font-weight: 600;
}

/* Category Color Ranges (Light) - Enhanced Contrast */
.light-mode .ld-cat-Comparison {
    background: #f0f3ff !important;
    color: #1e1b4b !important;
    border-bottom: 2px solid #6366f1;
    --cat-vibrant: #6366f1;
}

.light-mode .ld-cat-Structure {
    background: #f5f3ff !important;
    color: #4c1d95 !important;
    border-bottom: 2px solid #8b5cf6;
    --cat-vibrant: #8b5cf6;
}

.light-mode .ld-cat-Imagery {
    background: #ecfdf5 !important;
    color: #064e3b !important;
    border-bottom: 2px solid #10b981;
    --cat-vibrant: #10b981;
}

.light-mode .ld-cat-Rhetoric {
    background: #fff1f2 !important;
    color: #881337 !important;
    border-bottom: 2px solid #f43f5e;
    --cat-vibrant: #f43f5e;
}

.light-mode .ld-cat-Other {
    background: #f8fafc !important;
    color: #334155 !important;
    border-bottom: 2px solid #94a3b8;
    --cat-vibrant: #94a3b8;
}

/* Category Color Ranges (Dark) - Increased Depth */
.dark-mode .ld-cat-Comparison {
    background: rgba(99, 102, 241, 0.35) !important;
    color: #e0e7ff !important;
    border-bottom: 2px solid rgba(99, 102, 241, 0.5);
    --cat-vibrant: #818cf8;
}

.dark-mode .ld-cat-Structure {
    background: rgba(139, 92, 246, 0.35) !important;
    color: #f5f3ff !important;
    border-bottom: 2px solid rgba(139, 92, 246, 0.5);
    --cat-vibrant: #a78bfa;
}

.dark-mode .ld-cat-Imagery {
    background: rgba(16, 185, 129, 0.35) !important;
    color: #d1fae5 !important;
    border-bottom: 2px solid rgba(16, 185, 129, 0.5);
    --cat-vibrant: #34d399;
}

.dark-mode .ld-cat-Rhetoric {
    background: rgba(244, 63, 94, 0.35) !important;
    color: #fff1f2 !important;
    border-bottom: 2px solid rgba(244, 63, 94, 0.5);
    --cat-vibrant: #fb7185;
}

.dark-mode .ld-cat-Other {
    background: rgba(148, 163, 184, 0.35) !important;
    color: #f1f5f9 !important;
    border-bottom: 2px solid rgba(148, 163, 184, 0.5);
    --cat-vibrant: #94a3b8;
}

/* Taxonomy vibrant markers */
.ld-cat-Comparison-marker {
    background: #6366f1 !important;
}

.ld-cat-Structure-marker {
    background: #8b5cf6 !important;
}

.ld-cat-Imagery-marker {
    background: #10b981 !important;
}

.ld-cat-Rhetoric-marker {
    background: #f43f5e !important;
}

.ld-cat-Other-marker {
    background: var(--text-muted) !important;
}

.ld-stat-card {
    padding: 2rem;
    background: var(--bg-card);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-main);
}

.ld-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 12px;
    margin-bottom: 6px;
}

.ld-stat-item:hover {
    background: rgba(99, 102, 241, 0.08);
    transform: translateX(10px);
}

.ld-stat-count {
    background: rgba(0, 0, 0, 0.05);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 800;
}

.dark-mode .ld-stat-count {
    background: rgba(0, 0, 0, 0.4);
    color: white;
}

.ld-highlight-active {
    background: rgba(99, 102, 241, 0.15) !important;
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.1);
}

@keyframes focusZoom {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.25);
        box-shadow: 0 0 25px var(--cat-vibrant);
    }

    100% {
        transform: scale(1.15);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }
}

.ld-focus-zoom {
    animation: focusZoom 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    z-index: 100 !important;
    position: relative;
    outline: 2px solid var(--cat-vibrant);
    outline-offset: 4px;
}

.verse-block {
    margin-bottom: 2rem;
    line-height: 2.3;
    font-size: 1.2rem;
}

.ref-prefix {
    color: var(--text-muted);
    font-weight: 800;
    font-size: 0.85rem;
    margin-right: 1.5rem;
    font-family: 'Consolas', monospace;
    background: rgba(0, 0, 0, 0.03);
    padding: 5px 12px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
}

.verse-pills {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-right: 1.5rem;
    vertical-align: middle;
}

.v-pill {
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 5px;
    letter-spacing: 0.05em;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: var(--transition);
}

.v-pill:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ld-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
    margin-bottom: 2.5rem;
    padding: 1.2rem 2rem;
    background: var(--bg-card);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-main);
}

.ld-sort-select {
    background: var(--bg-dark);
    border: var(--border-glass);
    color: var(--text-main);
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}

.ld-sort-select:hover {
    border-color: var(--primary);
}

.dark-mode .ref-prefix {
    background: rgba(255, 255, 255, 0.05);
}

/* Mode Toggle */
.mode-toggle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: var(--border-glass);
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-main);
}

.mode-toggle:hover {
    transform: rotate(20deg) scale(1.1);
    background: var(--primary);
    color: white;
}

/* Dashboard & Projects Grid */
.grid-projects {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    display: block;
    padding: 2.5rem;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1);
}

.light-mode .project-card:hover {
    box-shadow: 0 30px 60px rgba(99, 102, 241, 0.1);
}

/* Modern Tabs System */
.tab-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    background: var(--bg-card);
    padding: 8px;
    border-radius: 16px;
    border: var(--border-glass);
    mask-image: linear-gradient(to right, black 95%, transparent);
    width: fit-content;
}

.tab-btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.tab-btn i {
    font-size: 1rem;
    opacity: 0.7;
}

.tab-btn:hover {
    background: rgba(99, 102, 241, 0.05);
    color: var(--text-main);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.tab-btn.active i {
    opacity: 1;
}

.tab-content {
    display: none;
    animation: fadeInTab 0.4s ease-out;
}

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

@keyframes fadeInTab {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}