@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap');

:root {
    /* "Common Sense" Light Theme (Default) */
    --bg-color: #FFFFFF;
    --surface-color: #F8F9FA;
    --text-primary: #111111;
    --text-secondary: #4B5563;
    /* Tailwind gray-600 */
    --border-color: #E5E7EB;
    /* Tailwind gray-200 */
    --glass-bg: rgba(255, 255, 255, 0.9);
    --accent-color: #000000;
    --accent-hover: #333333;
    --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    --overlay-bg: rgba(0, 0, 0, 0.4);
    --progress-bg: rgba(0, 0, 0, 0.05);
    --skeleton-bg: rgba(0, 0, 0, 0.05);
    --input-bg: #FFFFFF;
}

body.dark-mode {
    --bg-color: #121212;
    --surface-color: #1E1E1E;
    --text-primary: #FFFFFF;
    --text-secondary: #B0B0B0;
    --border-color: #333333;
    --glass-bg: rgba(18, 18, 18, 0.95);
    --accent-color: #FFFFFF;
    --accent-hover: #E0E0E0;
    --overlay-bg: rgba(0, 0, 0, 0.8);
    --progress-bg: rgba(255, 255, 255, 0.1);
    --skeleton-bg: rgba(255, 255, 255, 0.05);
    --input-bg: rgba(255, 255, 255, 0.03);
}

/* ── Dark Mode Overrides ── */
body.dark-mode .btn-primary {
    background: #FFFFFF;
    color: #000000;
    border-color: #FFFFFF;
}

body.dark-mode .btn-signin {
    background: rgba(255, 255, 255, 0.05);
    color: #FFFFFF;
    border-color: #333333;
}

body.dark-mode .card {
    background: #1E1E1E;
    border-color: #333333;
}

body.dark-mode .social-btn {
    background: #FFFFFF;
    color: #000000;
}

body.dark-mode .sidebar {
    background: #111113;
    border-right-color: #333333;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;

    /* Page Transitions */
    opacity: 0;
    transition: opacity 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

body.loaded {
    opacity: 1;
}

body.fade-out {
    opacity: 0;
}

h1,
h2,
h3,
.serif {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: -0.03em;
    /* Slightly looser tracking for legibility */
    color: var(--text-primary);
    /* Explicitly set color */
}

/* Ensure Paragraphs are Readable */
p,
li {
    color: var(--text-secondary);
}

.serif-accent {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-style: italic;
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--text-primary);
    /* Use Primary Text Color for bar */
    z-index: 1000;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: var(--bg-color);
    transition: var(--transition);
    border-bottom: 1px solid transparent;
}

nav.scrolled {
    padding: 1rem 5%;
    background: var(--glass-bg);
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo img {
    height: 90px !important;
    /* Hyper Modern Size */
    transition: var(--transition);
}

/* Invert Logo for Light Mode */
body.light-mode .logo img {
    filter: invert(1);
}

.logo span:not(.logo-brand-text) {
    display: none;
    /* Hide text if logo is huge? Or style it */
}

.nav-links {
    display: flex;
    gap: 3rem;
    /* More breathing room */
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

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

.btn-signin {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    /* Slightly softer */
    transition: var(--transition);
    color: var(--text-primary);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.03);
    /* Subtle fill */
}

.btn-signin:hover {
    background: var(--surface-color);
    border-color: var(--text-primary);
}

.btn-primary {
    background: var(--text-primary);
    color: #FFFFFF;
    padding: 0.8rem 2rem;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid var(--text-primary);
    cursor: pointer;
    display: inline-block;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #FFFFFF;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}


/* Modern Button Styles */
.btn-modern,
.glow-btn {
    background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
    color: #000;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
    letter-spacing: -0.01em;
}

.btn-modern:hover,
.glow-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
}

.btn-modern:active,
.glow-btn:active {
    transform: translateY(0) scale(0.98);
}

.btn-modern i,
.glow-btn i {
    font-size: 1.1em;
}

/* Secondary Modern Button */
.btn-modern-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-modern-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-primary);
    transform: translateY(-1px);
}

/* Hero Section */
.hero {
    height: 90vh;
    /* Slightly reduced height */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 5%;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

/* Removed the glowing .hero::before pseudo-element */

.hero-label {
    color: var(--accent-color);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s forwards;
}

.hero h1 {
    font-size: 4.5rem;
    line-height: 1.1;
    max-width: 900px;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s 0.2s forwards;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s 0.4s forwards;
}

/* Typewriter Effect - Simplified */
.typewriter-container {
    height: 1.2em;
    display: inline-block;
    color: var(--accent-color);
    font-style: italic;
    border-right: none;
    /* Removed cursor */
}

.cta-group {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s 0.6s forwards;
}

/* Features Grid */
.section {
    padding: 8rem 5%;
    /* Reduced padding */
    border-bottom: 1px solid var(--border-color);
}

.section-header {
    text-align: center;
    margin-bottom: 5rem;
}

.section-header h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 3rem;
    border-radius: 2px;
    /* Sharper */
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px);
    /* Reduced movement */
}

.card i {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 2rem;
    display: block;
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 400;
    /* Lighter weight for clean look */
}

.card p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.card ul li i {
    font-size: 1rem;
    display: inline-block;
    margin-bottom: 0;
    width: auto;
    color: var(--accent-color);
}

/* Testimonials / Success Stories */
.testimonials {
    background: var(--bg-color);
    /* Was hardcoded #0D0D0F */
}

.success-story-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--accent-color);
    padding: 3rem;
    border-radius: 8px;
    max-width: 600px;
    margin: 0 auto;
}

body.light-mode .success-story-card {
    background: rgba(0, 0, 0, 0.05);
    /* Visible on white */
    border-style: solid;
    /* Optional: make it solid in light mode? Dashed is fine. */
}

.testimonial-card {
    border: none;
    background: transparent;
    border-left: 2px solid var(--accent-color);
    padding-left: 2rem;
}

.testimonial-text {
    font-style: italic;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.author {
    font-weight: 600;
    color: var(--accent-color);
}

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

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 3rem;
    }

    .nav-links {
        display: none;
    }
}

/* Sidebar & Dashboard Styles */
.sidebar {
    width: 260px;
    background: var(--surface-color, #111113);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
}

/* Sidebar Credits Card */
.sidebar-credits-card {
    margin: 1rem 1.25rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.credits-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.credits-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.credits-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.credits-progress-container {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.credits-progress-bar {
    height: 100%;
    background: var(--text-primary);
    transition: width 0.3s ease, background 0.3s ease;
}

.credits-footer {
    font-size: 0.7rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.sidebar.minimized .sidebar-credits-card {
    display: none;
}

/* Theme Toggle Switch */
.theme-toggle-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.theme-toggle-bar:hover {
    background: rgba(255, 255, 255, 0.05);
}

body.light-mode .theme-toggle-bar:hover {
    background: rgba(0, 0, 0, 0.04);
}

.theme-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.theme-toggle-label i {
    font-size: 0.95rem;
    width: 18px;
    text-align: center;
}

.theme-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

body.light-mode .theme-switch {
    background: rgba(0, 0, 0, 0.15);
}

.theme-switch.active {
    background: #4CAF50;
}

.theme-switch-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #FFFFFF;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.theme-switch.active .theme-switch-knob {
    transform: translateX(20px);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

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

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.main-content {
    margin-left: 260px;
    padding: 2rem 3rem;
    width: calc(100% - 260px);
    height: 100vh;
    overflow-y: auto;
}

.sidebar-logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

/* Sidebar Navigation Items */
.sidebar .nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    transition: var(--transition);
    font-size: 0.9rem;
    width: 100%;
    cursor: pointer;
}

.sidebar .nav-item:hover,
.sidebar .nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    /* Subtle highlight */
    color: var(--text-primary);
}

.sidebar .nav-item.active {
    border-left: 2px solid var(--accent-color);
    background: rgba(255, 255, 255, 0.03);
}

.sidebar .nav-group-title,
.sidebar .nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin: 1.5rem 0 0.5rem 1rem;
    font-weight: 600;
    opacity: 0.7;
}

/* Sidebar Profile Section */
.sidebar-profile {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.profile-avatar {
    font-size: 2.5rem;
    color: var(--text-secondary);
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.profile-tier {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.profile-credits {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.profile-credits i {
    color: #FFD700;
    font-size: 0.9rem;
}

.sidebar.minimized .sidebar-profile {
    flex-direction: column;
    padding: 1rem 0.5rem;
    text-align: center;
}

.sidebar.minimized .profile-info {
    display: none;
}

/* Minimized Sidebar State */
.sidebar.minimized {
    width: 70px;
    padding: 2rem 0.5rem;
}

.sidebar.minimized .sidebar-logo img {
    height: 28px;
}

.sidebar.minimized .nav-section-title {
    display: none;
}

.sidebar.minimized .nav-item {
    justify-content: center;
    padding: 0.75rem;
}

.sidebar.minimized .nav-item i {
    margin-right: 0;
}

.sidebar.minimized .nav-item:not(:has(i)) {
    display: none;
}

/* Adjust main content when sidebar is minimized */
body.sidebar-minimized .main-content,
body.sidebar-minimized .dashboard-container {
    margin-left: 70px;
    width: calc(100% - 70px);
}

/* Compact Profile Dropdown */
.sidebar-profile-compact {
    position: relative;
    margin: 1rem 0;
}

.profile-compact-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.profile-compact-info:hover {
    background: rgba(255, 255, 255, 0.06);
}

.profile-compact-info .profile-avatar {
    font-size: 2rem;
    color: var(--text-secondary);
}

.profile-text {
    flex: 1;
}

.profile-menu-icon {
    font-size: 1.1rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.profile-compact-info:hover .profile-menu-icon {
    color: var(--text-primary);
}

/* ── Legal & Support Layouts ── */
.legal-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 5rem 2rem 8rem;
}

.legal-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.support-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.support-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
}

.support-card:hover {
    border-color: var(--text-primary);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* ── Form Layouts ── */
.name-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 600px) {
    .name-row {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .legal-container {
        padding: 3rem 1.5rem 6rem;
    }

    .legal-nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem !important;
    }
}

/* Dropdown Menu */
.profile-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    margin-bottom: 0.5rem;
    background: var(--surface-color, #1a1a1c);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.profile-dropdown.show {
    display: block;
    animation: dropdownFadeIn 0.2s ease;
}

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

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

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.dropdown-item i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* ── Advanced Note Editor Styles ── */

.editor-content-wrapper {
    position: relative;
    display: flex;
    overflow: hidden;
}

/* AI Sidebar */
.ai-interpret-sidebar {
    width: 0;
    background: var(--surface-color);
    border-left: 1px solid var(--border-color);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-interpret-sidebar.active {
    width: 350px;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.close-sidebar {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
}

.sidebar-content {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.ai-loading {
    text-align: center;
    padding: 2rem;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.ai-response-text {
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Slash Menu */
.slash-menu {
    position: absolute;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    padding: 0.5rem;
    z-index: 1000;
    width: 280px;
    animation: menuFadeIn 0.2s ease-out;
}

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

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

.slash-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.slash-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.slash-item i {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.slash-item-info {
    display: flex;
    flex-direction: column;
}

.slash-item-info span {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.slash-item-info small {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 500px;
    width: 90%;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.25rem;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.upload-area:hover {
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.upload-icon {
    font-size: 2.5rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--text-primary);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-status {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-cancel {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}

.btn-upload {
    background: var(--text-primary);
    color: var(--bg-color);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.btn-upload:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Legal Templates */
.legal-facts-box {
    background: rgba(255, 255, 255, 0.03);
    border-left: 4px solid var(--text-primary);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
}

/* ── Enhanced Legal & Media Blocks ── */

.legal-case-wrapper {
    margin: 2rem 0;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    border-left: 4px solid var(--text-primary);
}

.case-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.95rem;
    letter-spacing: 0.05em;
}

.case-body {
    padding: 1.5rem;
}

.case-section {
    margin-bottom: 1.25rem;
}

.case-section-title {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    opacity: 0.9;
}

.case-section-content {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    outline: none;
}

/* Floating Table Tools */
.table-controls {
    position: absolute;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.25rem;
    display: flex;
    gap: 0.25rem;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.table-control-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: var(--transition);
}

.table-control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Highlight Colors */
.highlight-yellow {
    background-color: rgba(255, 235, 59, 0.3);
    color: inherit;
}

.highlight-green {
    background-color: rgba(76, 175, 80, 0.3);
    color: inherit;
}

.highlight-blue {
    background-color: rgba(33, 150, 243, 0.3);
    color: inherit;
}

.highlight-pink {
    background-color: rgba(233, 30, 99, 0.3);
    color: inherit;
}

.selection-colors {
    display: flex;
    gap: 0.5rem;
    padding: 0 0.5rem;
}

.color-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.color-dot:hover {
    transform: scale(1.2);
}

.color-dot.active {
    border-color: var(--text-primary);
}

.dot-yellow {
    background: #FFEB3B;
}

.dot-green {
    background: #4CAF50;
}

.dot-blue {
    background: #2196F3;
}

.dot-pink {
    background: #E91E63;
}

.dot-none {
    border: 1px solid var(--border-color);
    position: relative;
}

.dot-none::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    background: #ff4444;
    top: 50%;
    left: 0;
    transform: rotate(45deg);
}

/* Selection Menu Enhancements */
.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Table Styles */
.editor-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.editor-table th,
.editor-table td {
    border: 1px solid var(--border-color);
    padding: 1rem;
    min-width: 100px;
}

/* Module Card Menu (3 Dots) */
.module-card {
    position: relative !important;
    /* Ensure absolute children are relative to card */
}

.module-menu-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 50%;
    transition: var(--transition);
    z-index: 10;
    opacity: 0;
    /* Hidden by default until hover */
}

.module-card:hover .module-menu-btn,
.module-menu-btn.active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

body.light-mode .module-card:hover .module-menu-btn,
body.light-mode .module-menu-btn.active {
    background: rgba(0, 0, 0, 0.05);
}

.module-menu-dropdown {
    position: absolute;
    top: 3rem;
    right: 1rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    min-width: 140px;
    z-index: 20;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.module-menu-dropdown.show {
    display: flex;
}

.module-menu-item {
    padding: 0.75rem 1rem;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.module-menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

body.light-mode .module-menu-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.module-menu-item.delete {
    color: #ff5555;
    background: rgba(255, 85, 85, 0.05);
}

.module-menu-item.delete:hover {
    background: rgba(255, 85, 85, 0.1);
}

/* Delete Confirmation Modal */
.delete-modal-content {
    background: var(--surface-color);
    padding: 2.5rem;
    border-radius: 16px;
    width: 400px;
    text-align: center;
    position: relative;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    margin: 0 auto;
}

.delete-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 85, 85, 0.1);
    color: #ff5555;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1.5rem;
}

.delete-modal h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.delete-modal p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* Slide to Delete Slider */
.slide-delete-container {
    position: relative;
    width: 100%;
    height: 54px;
    background: rgba(255, 85, 85, 0.1);
    border-radius: 27px;
    user-select: none;
    overflow: hidden;
    transition: background 0.3s;
    border: 1px solid rgba(255, 85, 85, 0.2);
}

.slide-delete-container.completed {
    background: #ff5555 !important;
    border-color: #ff5555 !important;
}

.slide-text {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff5555;
    font-weight: 600;
    font-size: 0.9rem;
    pointer-events: none;
    letter-spacing: 0.5px;
    transition: opacity 0.3s;
}

.slide-delete-container.completed .slide-text {
    opacity: 0;
}

.slide-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 48px;
    height: 48px;
    background: #ff5555;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: grab;
    transition: transform 0.1s;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(255, 85, 85, 0.3);
}

.slide-thumb:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.slide-thumb i {
    font-size: 1rem;
    pointer-events: none;
}

/* --- UI Polish & Fixes --- */

/* Fix: Module Menu Clipping */
.module-card {
    overflow: visible !important;
}

/* Note Editor Modernization */
.editor-body {
    outline: none !important;
    border: none !important;
    padding: 1rem 0 3rem;
    font-size: 1.1rem;
    line-height: 1.75;
    color: var(--text-primary);
    min-height: 60vh;
}

/* Placeholder for Editor */
.editor-body:empty:before {
    content: attr(data-placeholder);
    color: var(--text-secondary);
    opacity: 0.5;
    pointer-events: none;
    font-style: italic;
}

/* Ensure Dropdowns are above everything */
.module-menu-dropdown {
    z-index: 1000 !important;
}

/* Slide to Delete Fix */
.delete-modal {
    z-index: 9999 !important;
}

/* Signup Page Blank Fix (if CSS related) */
.login-left,
.login-right {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Create Lecture Card */
.create-card {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    transition: var(--transition);
    min-height: 200px;
    color: var(--text-secondary);
    font-size: 2.5rem;
    position: relative;
    overflow: hidden;
}

.create-card:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.create-card:active {
    transform: translateY(0);
}

/* Optional: Label on hover */
.create-card::after {
    content: "New Lecture";
    position: absolute;
    bottom: 2rem;
    font-size: 1rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition);
}

.create-card:hover::after {
    opacity: 1;
    transform: translateY(0);
}

/* ── Brand Text ── */
.logo-brand-text {
    font-family: 'Inter', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-left: 0.5rem;
    vertical-align: middle;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    padding: 0.5rem 0;
}

.sidebar-logo .logo-brand-text {
    font-size: 1.1rem;
}

/* Hide brand text when sidebar is minimized */
.sidebar.minimized .logo-brand-text {
    display: none;
}

/* Navbar brand text */
nav .logo .logo-brand-text {
    font-size: 1.2rem;
}

/* ── Lecture Card Consistency ── */
.lecture-card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: visible !important;
    min-height: 160px;
}

.lecture-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-color);
}

/* ── Button Primary consistency ── */
.btn-action.btn-primary {
    background: var(--accent-color);
    color: #fff;
    border: none;
}

.btn-action.btn-primary:hover {
    filter: brightness(1.15);
}

/* ── Cookie Consent Banner ── */
.cookie-banner {
    position: fixed;
    bottom: -100%;
    left: 2rem;
    right: 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    z-index: 9999;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    transition: bottom 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 800px;
    margin: 0 auto;
}

.cookie-banner.active {
    bottom: 2rem;
}

.cookie-content {
    max-width: 100%;
}

.cookie-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.cookie-header i {
    font-size: 1.5rem;
    color: var(--accent-color);
}

.cookie-header h3 {
    font-size: 1.25rem;
    margin: 0;
}

.cookie-banner p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.cookie-banner p a {
    color: var(--accent-color);
    text-decoration: underline;
}

.cookie-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.btn-cookie-primary {
    background: var(--accent-color);
    color: #FFF;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-cookie-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-cookie-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-cookie-secondary:hover {
    background: rgba(0, 0, 0, 0.05);
}

.cookie-settings-link {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 500;
}

.cookie-settings-link:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .cookie-banner {
        left: 1rem;
        right: 1rem;
        padding: 1.5rem;
    }

    .cookie-actions {
        gap: 1rem;
    }

    .btn-cookie-primary,
    .btn-cookie-secondary {
        width: 100%;
    }
}

/* ── Cookie Settings Panel ── */
.cookie-settings-panel {
    display: none;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.cookie-settings-panel.active {
    display: block;
    animation: fadeInSlideUp 0.4s ease forwards;
}

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

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

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.settings-header h4 {
    font-size: 1.1rem;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.25rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.setting-info p {
    font-size: 0.85rem !important;
    margin-bottom: 0 !important;
}

/* ── Toggle Switch ── */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border: 1px solid var(--border-color);
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--accent-color);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

input:disabled+.slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

.settings-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
}