/*
==================================================================
STYLE: Obsidian Emerald — Refined Dark/Light Theme
==================================================================
*/

:root {
    --bg-body: #F9F9F9;
    --bg-surface: #FFFFFF;
    --bg-sidebar: #EEEEEE;
    --bg-input: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-quote: #F3F4F6;
    --bg-tag: #F3F4F6;
    --bg-code-inline: #F3F4F6;
    --bg-code-block: #F9FAFB;

    /* Tonal Layering (New) */
    --surface-low: #F3F3F3;
    --surface-high: #EEEEEE;
    --surface-highest: #E2E2E2;

    --text-primary: #0A0C0A;
    /* Ink black with a hint of emerald */
    --text-secondary: #2C332C;
    --accent-emerald: #16A34A;
    /* emerald-600 */
    --vibrant-green: var(--accent-emerald);
    --text-accent: var(--accent-emerald);
    --text-muted: #576157;
    --code-text: var(--accent-emerald);
    --text-code-block: #1A1C1C;

    --border-color: rgba(0, 0, 0, 0.08);

    --font-display: 'Playfair Display', serif;
    --font-accent: 'Fraunces', serif;
    --font-main: 'DM Sans', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius: 8px;
    /* Slightly rounded for "lithograph" feel */
    --shadow-ambient: 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 4px 12px rgba(22, 163, 74, 0.1);

    /* --- GRAPH COLORS --- */
    --bg-graph: #E5E7E5;
    /* Muted weighted paper tint */
    --graph-label: #333C33;
    --graph-label-focused: #0A0C0A;
}

body[data-theme="dark"] {
    --bg-body: #090C09;
    /* Deep forest-tinted black */
    --bg-surface: #0E120E;
    --bg-sidebar: #0B0D0B;
    --bg-input: #0E120E;
    --bg-card: #121812;
    --bg-quote: #151C15;
    --bg-tag: #151C15;
    --bg-code-inline: #151C15;
    --bg-code-block: #090C09;

    /* Tonal Layering (New) */
    --surface-low: #111111;
    --surface-high: #1C1C1C;
    --surface-highest: #242424;

    --text-primary: #F0F4F0;
    --text-secondary: #C8D1C8;
    --accent-emerald: #22C55E;
    /* emerald-500 */
    --text-accent: var(--accent-emerald);
    --text-muted: #96A396;
    --code-text: var(--accent-emerald);
    --text-code-block: #E5E2E1;

    --border-color: rgba(34, 197, 94, 0.12);
    --shadow-ambient: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 10px 30px rgba(34, 197, 94, 0.1);

    /* --- GRAPH COLORS --- */
    --bg-graph: #090C09;
    /* Deep forest-tinted black */
    --graph-label: #96A396;
    --graph-label-focused: #F0F4F0;
}

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

body {
    font-family: var(--font-main);
    color: var(--text-primary);
    background-color: var(--bg-body);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    line-height: 1.6;
    -moz-osx-font-smoothing: grayscale;
    /* Global scrollbar for Firefox */
    scrollbar-width: thin;
    scrollbar-color: rgba(22, 163, 74, 0.3) transparent;
}

/* Global scrollbar styles for Webkit (Chrome/Edge/Safari) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background-color: rgba(22, 163, 74, 0.2);
    border-radius: 20px;
    border: 2px solid transparent;
    background-clip: content-box;
    transition: background-color 0.2s ease;
}

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

::-webkit-scrollbar-button {
    display: none;
    /* Hide scrollbar arrows */
}

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

/* Animations */
@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.staggered-fade>* {
    opacity: 0;
    animation: fade-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.staggered-fade>*:nth-child(1) {
    animation-delay: 0.1s;
}

.staggered-fade>*:nth-child(2) {
    animation-delay: 0.2s;
}

.staggered-fade>*:nth-child(3) {
    animation-delay: 0.3s;
}

.staggered-fade>*:nth-child(4) {
    animation-delay: 0.4s;
}

/* --- Global Header --- */
.global-header {
    height: 60px;
    width: 100%;
    background-color: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    flex-shrink: 0;
    position: relative;
    z-index: 200;
}

.brand {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-decoration: none;
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s ease;
}

.mobile-menu-btn:hover {
    color: var(--text-accent);
}

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

.header-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    font-family: var(--font-main);
    position: relative;
    font-weight: 500;
}

.header-btn:hover {
    color: var(--text-accent);
    transform: translateY(-1px);
}

/* Sliding Underline Effect (Moved to ::before to avoid tooltip collision) */
.header-btn::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--text-accent);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    z-index: 1;
}

.header-btn:hover::before {
    width: 60%;
}

.theme-toggle .fa-sun {
    display: none;
}

body[data-theme="dark"] .theme-toggle .fa-sun {
    display: inline-block;
}

body[data-theme="dark"] .theme-toggle .fa-moon {
    display: none;
}

/* --- Search Overlay (Global & Floating) --- */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    /* Floating near top like Spotlight */
}

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

.search-modal {
    width: 100%;
    max-width: 600px;
    background: rgba(20, 20, 20, 0.93);
    border: 1px solid rgba(34, 197, 94, 0.22);
    border-radius: 4px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

body:not([data-theme="dark"]) .search-modal {
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
}

.mobile-search-bar {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}

.search-input {
    width: 100%;
    padding: 12px 12px 12px 36px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: var(--text-accent);
    background: var(--bg-card);
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.15);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1rem;
}

.close-search-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
}

.close-search-btn:hover {
    color: var(--text-accent);
}

.mobile-search-results {
    max-height: 50vh;
    overflow-y: auto;
    background: var(--bg-body);
}

/* Mobile full-screen search override */
@media (max-width: 800px) {
    .search-overlay {
        padding-top: 0;
        background: var(--bg-body);
        backdrop-filter: none;
    }

    .search-modal {
        max-width: 100%;
        height: 100vh;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    .mobile-search-results {
        max-height: calc(100vh - 70px);
    }
}


/* --- BREADCRUMBS --- */
.breadcrumbs {
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.breadcrumb-item {
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: none;
    display: inline-flex;
    align-items: center;
}

.breadcrumb-item:hover {
    color: var(--text-accent);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
    cursor: default;
    pointer-events: none;
}

.breadcrumb-separator {
    color: var(--border-color);
    font-size: 0.8em;
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Removed padding to ensure it matches global width nicely */
}

/* Custom Scrollbar */
.main-content::-webkit-scrollbar {
    width: 8px;
}

.main-content::-webkit-scrollbar-track {
    background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: var(--radius);
    border: 3px solid transparent;
    background-clip: content-box;
}

.main-content::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-secondary);
}

/* Back Button Style */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-decoration: none;
    margin-bottom: 30px;
    transition: none;
    cursor: pointer;
    align-self: flex-start;
    width: 100%;
    max-width: 1100px;
}

.back-link:hover {
    color: var(--text-accent);
}

/* --- Typography (Marked.js Output) --- */
.markdown-body {
    color: var(--text-primary);
    width: 100%;
    max-width: 1100px;
}

.markdown-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    display: block;
    margin: 1.5rem 0;
    transition: none;
}

.markdown-body img:hover {
    transform: scale(1.01);
}

/* ... existing typography styles ... */

/* --- News Container (Log Renderer) --- */
.log-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 32px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--text-accent);
    display: inline-block;
}

.log-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.news-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.news-header-box {
    display: flex;
    align-items: center;
    padding: 16px;
    cursor: pointer;
    transition: none;
    gap: 16px;
}

.news-header-box:hover {
    background-color: var(--bg-quote);
}

.news-thumb-small {
    width: 60px;
    height: 60px;
    border-radius: var(--radius);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.news-title-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.news-title-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.news-date-badge {
    font-size: 0.8rem;
    color: var(--text-accent);
    font-weight: 500;
}

.news-toggle-icon {
    color: var(--text-secondary);
    transition: none;
}

.news-body-content {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-body);
}

.news-body-content .markdown-body {
    padding: 0;
}



.landing-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.markdown-body h1 {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    margin-bottom: 1.5rem;
    border-bottom: none;
    line-height: 1.1;
}

.markdown-body h2 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.markdown-body p {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.markdown-body a {
    color: var(--text-accent);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

.markdown-body a:hover {
    border-bottom-color: var(--text-accent);
    color: var(--text-accent);
}


.markdown-body blockquote {
    border-left: 4px solid var(--vibrant-green);
    background: var(--bg-quote);
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
    margin: 2rem 0;
    font-style: normal;
}


.markdown-body ul,
.markdown-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.markdown-body li {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* --- TABLE STYLES --- */
.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
    overflow-x: auto;
    display: block;
    /* Ensures responsive scrolling on small screens if needed */
}

/* Restore table display on larger screens */
@media (min-width: 640px) {
    .markdown-body table {
        display: table;
    }
}

.markdown-body th,
.markdown-body td {
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    text-align: left;
}

.markdown-body th {
    background-color: var(--bg-quote);
    font-weight: 600;
    color: var(--text-primary);
}

/* Zebra Striping using existing tag background variable */
.markdown-body tr:nth-child(even) {
    background-color: var(--bg-tag);
}

/* Code Blocks */
.markdown-body pre {
    background: var(--bg-code-block);
    color: var(--text-code-block);
    padding: 20px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.markdown-body code {
    background: var(--bg-code-inline);
    color: var(--code-text);
    padding: 2px 6px;
    border-radius: var(--radius);
    font-size: 0.9em;
    font-family: monospace;
}

.tag-pill {
    display: inline-block;
    background: var(--bg-tag);
    padding: 4px 10px;
    border-radius: var(--radius);
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-right: 8px;
    margin-bottom: 24px;
    font-weight: 500;
}

/* --- THE SHELF GRID (Updated for Minimal Look) --- */
.shelf-header {
    margin-bottom: 20px;
}

/* --- VIEW TOGGLE --- */
.view-toggle {
    display: inline-flex;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 4px;
    gap: 4px;
}

.view-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    transition: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.view-toggle-btn.active {
    background: var(--bg-card);
    color: var(--text-accent);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.shelf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.shelf-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-ambient);
}

.shelf-card:hover {
    border-color: rgba(34, 197, 94, 0.3);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.shelf-icon {
    font-size: 1.8rem;
    color: var(--text-accent);
    margin-bottom: 16px;
}

.shelf-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.shelf-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* --- LIST VIEW (Minimal & Stacked) --- */
.list-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    /* Removed gap for stacked border style */
    margin-top: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.list-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-card);
    border: none;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    cursor: pointer;
    transition: none;
    text-decoration: none;
    gap: 16px;
}

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

.list-item:hover {
    background-color: var(--bg-sidebar);
    transform: translateX(6px);
    box-shadow: inset 3px 0 0 var(--text-accent);
}

/* Removed list-icon-container and list-icon styles */

.list-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    /* Stack title and desc */
    justify-content: center;
}

.list-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0;
}

.list-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;

}

.list-arrow {
    font-size: 0.9rem;
    color: var(--border-color);
    transition: none;
}

.list-item:hover .list-arrow {
    color: var(--text-accent);
}

/* --- LANDING PAGE --- */
.landing-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.landing-hero {
    text-align: center;
    margin-bottom: 60px;
}

.landing-hero h1 {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 500;
    margin-bottom: 20px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.landing-subtitle {
    font-family: var(--font-accent);
    font-style: italic;
    font-size: 1.3rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.4;
}

.landing-section {
    margin-bottom: 40px;
}

.landing-section-title {
    font-family: var(--font-accent);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-accent);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

/* --- MOBILE HEADER & LAYOUT --- */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

body[data-theme="dark"] .mobile-header {
    background: rgba(15, 23, 42, 0.85);
    /* Slate 900 */
}

.mobile-brand {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.header-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: none;
    backdrop-filter: blur(2px);
}

.sidebar-backdrop.visible {
    opacity: 1;
    visibility: visible;
}

/* --- MOBILE SEARCH OVERLAY --- */
.mobile-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-body);
    z-index: 2000;
    display: none;
    flex-direction: column;
}

.mobile-search-overlay.open {
    display: flex;
}

.mobile-search-bar {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}

.mobile-search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 1rem;
    color: var(--text-primary);
    outline: none;
}

.close-search-btn {
    background: transparent;
    border: none;
    color: var(--text-accent);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
}

.mobile-search-results {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 768px) {

    /* Show Header */
    .mobile-header {
        display: flex;
    }

    /* Adjust Sidebar for Mobile */
    .sidebar {
        position: fixed;
        top: 0;
        /* Align to top, header is overlay or sibling? */
        bottom: 0;
        left: 0;
        width: 280px;
        /* Slightly wider */
        z-index: 1001;
        /* Above header */
        transform: translateX(-100%);
        transition: none;
        box-shadow: none;
        /* Shadow handled by backdrop? Or add distinct shadow */
        border-right: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
    }

    /* Adjust Main Content */
    .main-content {
        padding: 80px 20px 40px 20px;
        width: 100%;
        margin-left: 0;
    }

    /* Hide Search in Sidebar on Mobile to avoid redundancy? 
       Actually, keep it as fallback or hide it. 
       User said: "search bar is in the sidebar... cumbersome".
       We are solving this with top bar. We can hide the sidebar search on mobile.
    */
    .sidebar .search-box {
        display: none;
    }
}

/* --- LINK LIBRARY (Visual Gallery) --- */
.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.link-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    text-decoration: none;
    transition: none;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.link-card:hover {
    border-color: rgba(34, 197, 94, 0.45);
    transform: translateY(-2px);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.07);
}

.link-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 0 !important;
    margin-bottom: 8px !important;
    border: none !important;
}

.link-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0 !important;
    flex-grow: 1;
}

.card-icon {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

/* --- Sidebar Footer (Force Add) --- */
.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
    background-color: var(--bg-sidebar);
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: none;
    padding: 4px 0;
}

.footer-link:hover {
    color: var(--text-accent);
}

.footer-link i {
    width: 16px;
    text-align: center;
    font-size: 0.9em;
    opacity: 0.8;
}

/* --- CALENDAR UI --- */
.calendar-year-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
    width: 100%;
    max-width: 1100px;
}

.calendar-month {
    break-inside: avoid;
}

.calendar-month-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-color);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    /* Tighter gap */
}

.calendar-day-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    padding-bottom: 8px;
    opacity: 0.7;
}

.calendar-day {
    aspect-ratio: 1;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: transparent;
    transition: none;
    position: relative;
    opacity: 0.4;
    /* Lower opacity for empty days */
    cursor: default;
}

/* Day with Log Entry */
.calendar-day.has-news {
    opacity: 1;
    cursor: pointer;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: none;
}

.calendar-day.has-news:hover {
    border-color: var(--text-accent);
    background: var(--bg-card);
    transform: translateY(-2px);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.1);
    color: var(--text-accent);
}

.calendar-day.empty {
    /* Empty filler days */
    visibility: hidden;
}

/* Marker for news */
.calendar-marker {
    width: 4px;
    height: 4px;
    background-color: var(--text-accent);
    border-radius: 0;
    margin-top: 2px;
    display: none;
    opacity: 0.8;
}

.calendar-day.has-news .calendar-marker {
    display: block;
}

.calendar-day.has-news:hover .calendar-marker {
    background-color: var(--text-accent);
}

/* Responsive: 3 columns of months on large screens, 1 on mobile */
@media (min-width: 1024px) {
    .calendar-year-container {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 32px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .calendar-year-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

/* --- CONSTELLATION VIEW --- */
#graphContainer {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: calc(100vh - 60px);
    background-color: var(--bg-graph);
    z-index: 100;
    display: none;
    overflow: hidden;
}

#graphContainer.active {
    display: block !important;
}

/* --- GRAPH UI OVERLAYS --- */
.graph-controls {
    position: absolute;
    top: 20px;
    right: 40px;
    z-index: 101;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
}

.close-graph-btn {
    background: #E11D48;
    /* Rose Red as requested/seen in screenshot */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-main);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.3);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-graph-btn:hover {
    background: #BE123C;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(225, 29, 72, 0.4);
}

.graph-legend {
    position: absolute;
    bottom: 24px;
    left: 24px;
    z-index: 105;
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-ambient);
    display: flex;
    flex-direction: column;
    max-height: calc(100% - 48px);
    width: 200px; /* Fixed width for consistent collapsing */
    pointer-events: auto;
    overflow: hidden; /* Hide content when collapsed */
    transition: width 0.3s ease;
}

.legend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.legend-header:hover {
    background: var(--surface-highest);
}

.legend-header i {
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.legend-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 16px 16px 16px;
    overflow-y: auto;
    transition: opacity 0.3s ease, max-height 0.3s ease;
    max-height: 400px;
    opacity: 1;
}

/* Collapsed State */
.graph-legend.collapsed .legend-header {
    border-bottom-color: transparent; /* Remove divider when collapsed */
}

.graph-legend.collapsed .legend-content {
    max-height: 0;
    opacity: 0;
    padding-bottom: 0;
    overflow: hidden;
    margin: 0;
}

body[data-theme="dark"] .graph-legend {
    background: var(--bg-card);
    border-color: rgba(34, 197, 94, 0.2);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    padding: 6px 12px;
    border-radius: 6px;
    user-select: none;
    background: transparent;
    border: none;
    font-family: inherit;
    text-align: left;
    width: 100%;
    opacity: 0.7;
}

.legend-item:focus-visible {
    outline: 2px solid var(--text-accent);
    outline-offset: 2px;
}

.legend-item:hover,
.legend-item.active {
    opacity: 1;
    color: var(--text-primary);
    background: var(--surface-highest);
}

.legend-item.active {
    background: var(--surface-high);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentcolor;
    flex-shrink: 0;
}

.graph-node-label {
    stroke: var(--bg-body);
    stroke-width: 3px;
    paint-order: stroke;
    stroke-linejoin: round;
    font-family: var(--font-main);
    font-weight: 500;
}

.main-content.graph-mode .markdown-body,
.main-content.graph-mode .breadcrumbs,
.main-content.graph-mode .back-link {
    display: none !important;
}

.graph-toggle-btn.active {
    background: var(--text-accent);
    color: var(--bg-sidebar) !important;
    border-color: var(--text-accent);
}



/* ==========================================
   ?? COMPONENT GALLERY ADDITIONS
   ========================================== */

/* 1. CSS-Only Tooltips */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-main);
    padding: 6px 12px;
    border-radius: var(--radius);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
    pointer-events: none;
    box-shadow: var(--shadow-ambient);
    border: 1px solid var(--border-color);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
    font-style: normal;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(4px);
}

body[data-theme="dark"] [data-tooltip]::after {
    background: var(--surface-high);
    border-color: rgba(34, 197, 94, 0.2);
}

/* Bottom Placement (Default) */
[data-tooltip-pos="bottom"]::before {
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    border-bottom-color: var(--bg-code-block);
}

[data-tooltip-pos="bottom"]::after {
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    margin-top: 5px;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

[data-tooltip-pos="bottom"]:hover::before {
    transform: translateX(-50%) translateY(0);
}

[data-tooltip-pos="bottom"]:hover::after {
    transform: translateX(-50%) translateY(0);
}


/* 2. Keyboard Shortcut Badges (Kbd) */
.search-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.search-wrapper .search-input {
    padding-right: 50px;
    /* Space for KBD badge */
}

kbd.shortcut-badge {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-family: var(--font-main);
    /* Ensure it matches UI font, not monospace */
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    box-shadow: inset 0 -1px 0 var(--border-color);
    pointer-events: none;
    /* Let clicks pass through to input */
    transition: none;
}

/* Hide Kbd when input is focused or has text */
.search-input:focus+kbd.shortcut-badge,
.search-input:not(:placeholder-shown)+kbd.shortcut-badge {
    opacity: 0;
}


/* 3. Empty States */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 2.5rem;
    color: var(--border-color);
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state-desc {
    font-size: 0.9rem;
    max-width: 300px;
    line-height: 1.5;
}

/* 4. Random Overview Button */
.random-btn {
    margin-top: 15px;
    padding: 10px 20px;
    font-size: 0.95rem;
    border-radius: var(--radius);
    background: rgba(34, 197, 94, 0.08);
    color: var(--text-accent);
    border: 1px solid rgba(34, 197, 94, 0.2);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    font-family: var(--font-main);
    font-weight: 500;
    letter-spacing: -0.01em;
    position: relative;
    overflow: hidden;
}

.random-btn:hover {
    background: var(--text-accent);
    color: var(--bg-body);
    border-color: var(--text-accent);
}

.random-btn:active {
    transform: none;
    box-shadow: none;
}


/* ==========================================
   ?? STACKED NOTES (Andy Matuschak Style)
   ========================================== */

/* Hide normal content when stacked mode is active */
body.stacked-mode #contentDisplay,
body.stacked-mode #breadcrumbs,
body.stacked-mode #graphContainer {
    display: none !important;
}

body.stacked-mode #noteColumnsScrolling {
    display: flex;
}

body.stacked-mode .main-content {
    padding: 0;
    padding-top: 20px;
    /* Space for breadcrumbs and header */
}

/* Horizontal scrolling container */
.note-columns-scrolling {
    display: none;
    /* Shown only when stacked mode is active */
    flex: 1;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: thin;
}

.note-columns-scrolling::-webkit-scrollbar {
    height: 8px;
    /* Slightly thicker for the horizontal "base" scrollbar */
}

.note-columns-scrolling::-webkit-scrollbar-track {
    background: var(--bg-body);
    border-top: 1px solid var(--border-color);
}

.note-columns-scrolling::-webkit-scrollbar-thumb {
    background-color: rgba(22, 163, 74, 0.4);
    border-radius: 10px;
    border: 2px solid var(--bg-body);
}

.note-columns-scrolling::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-accent);
}


/* Flex container for note columns */
.note-columns-container {
    display: flex;
    flex-direction: row;
    flex-grow: 1;
    transition: width 100ms cubic-bezier(0.19, 1, 0.22, 1);
}

/* Individual note column */
.note-column {
    flex-shrink: 0;
    width: 750px;
    max-width: 750px;
    height: calc(100vh - 60px);
    /* Adjust for header height */
    position: relative;
    overflow-y: auto;
    background-color: var(--bg-body);
    border-left: 1px solid var(--border-color);
    transition: box-shadow 0.3s cubic-bezier(0.19, 1, 0.22, 1),
        opacity 0.3s ease;
    /* transform transition removed for 60fps JS parallax sync */
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.note-column.focused {
    z-index: 20;
    border-left: 2px solid var(--text-accent);
}

.note-column::-webkit-scrollbar {
    width: 4px;
}

.note-column::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 2px;
}

/* First column has no left border */
.note-column:first-of-type {
    border-left: none;
}

/* Overlay (shadow) for notes that are visible/stacked */
.note-column.overlay {
    box-shadow: -15px 0 40px rgba(0, 0, 0, 0.08);
}

body[data-theme="dark"] .note-column.overlay {
    box-shadow: -20px 0 50px rgba(0, 0, 0, 0.4);
}

/* Notes being removed: fade + shrink */
.note-column.pending-exit {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

/* Note column close button */
.note-column-close {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-secondary);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: none;
}

.note-column-close:hover {
    color: var(--text-accent);
    border-color: var(--text-accent);
    background: var(--bg-sidebar);
}

/* Show close button on all columns except the first (primary) */
.note-column:not(:first-of-type) .note-column-close {
    display: flex;
}

/* Stacked Empty State */
.stacked-empty-state {
    flex: 1;
    min-width: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-body);
}

.empty-state-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
    opacity: 0.6;
}

.empty-state-content i {
    font-size: 3rem;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.empty-state-content p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state-content span {
    font-size: 0.9rem;
}

/* Vertical label for notes scrolled out of view */
.note-obscured-label {
    position: absolute;
    left: 0;
    top: 36px;
    bottom: 0;
    width: 40px;
    writing-mode: vertical-lr;
    direction: rtl;
    font-size: 15px;
    letter-spacing: 0.03em;
    font-weight: 500;
    color: var(--text-secondary);
    overflow: hidden;
    background: transparent;
    display: none;
    cursor: pointer;
    transition: color 100ms linear;
    padding-left: 4px;
    padding-right: 4px;
}

.note-obscured-label.hovered {
    color: var(--text-accent);
}

/* Show vertical label when note is behind/scrolled */
.note-column.has-label .note-obscured-label {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

/* Note column content wrapper */
.note-column-content {
    padding: 80px;
    padding-top: 60px;
    padding-bottom: 120px;
    /* Extra space to ensure text is clear of the scrollbar */
    min-height: 100%;
}

.note-column-content .markdown-body {
    max-width: 100%;
}

/* Tags inside stacked columns */
.note-column-content .tag-pill {
    margin-bottom: 16px;
}



/* Responsive: single column on small screens (no stacking) */
@media (max-width: 800px) {
    .mobile-menu-btn {
        display: block;
    }

    .header-actions {
        display: none;
    }

    /* When menu is open, hide the brand logo */
    .global-header.mobile-menu-open .brand {
        display: none !important;
    }

    /* Show actions horizontally filling the header */
    .global-header.mobile-menu-open .header-actions {
        display: flex;
        flex-direction: row;
        width: 100%;
        align-items: center;
        justify-content: space-evenly;
        gap: 8px;
    }

    .note-columns-scrolling {
        overflow-x: hidden;
    }

    .note-column {
        width: 100vw;
        max-width: 100vw;
        position: relative;
        left: 0 !important;
    }

    .note-column.overlay {
        box-shadow: none;
    }

    .note-obscured-label {
        display: none !important;
    }

    .note-column-close {
        display: flex !important;
    }


    /* Restore padding on mobile */
    .note-column-content {
        padding: 32px 20px !important;
    }
}

/* --- READING EXPERIENCE --- */
/* Target ONLY the reading experience (both single view and stacked) */
#contentDisplay,
.note-column-content {
    font-family: var(--font-main);
    font-size: 1.05rem;
    line-height: 1.75;
    letter-spacing: -0.005em;
}

#contentDisplay h1,
#contentDisplay h2,
#contentDisplay h3,
.note-column-content h1,
.note-column-content h2,
.note-column-content h3 {
    font-family: var(--font-main);
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Monospace strictly for code */
#contentDisplay code,
.note-column-content code,
#contentDisplay pre,
.note-column-content pre {
    font-family: var(--font-mono);
}

/* --- BACKLINKS CARD --- */
.backlink-card {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background-color: transparent;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease, border-color 0.2s ease;
    text-align: left;
}

.backlink-card:hover {
    background-color: var(--bg-quote);
    border-color: var(--text-accent);
}

.backlink-card:active {
    transform: scale(0.99);
}

.backlink-title {
    font-weight: 600;
    color: var(--text-accent);
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.backlink-snippet {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

/* --- HOVER LINK POPOVER --- */
#link-preview-popover {
    position: fixed;
    z-index: 10000;
    width: 340px;
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    pointer-events: none;
}

#link-preview-popover.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

#link-preview-popover .popover-title {
    font-weight: 600;
    color: var(--text-accent);
    margin-bottom: 8px;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

#link-preview-popover .popover-snippet {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: normal;
}

/* --- NOTE UTILITIES BAR --- */
.note-utils-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    width: 100%;
    max-width: 1100px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.note-util-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.note-util-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.note-util-btn:hover {
    color: var(--text-accent);
    background: var(--bg-quote);
}

.note-util-btn i {
    font-size: 0.9rem;
}

/* --- TOAST NOTIFICATION --- */
#toast-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    pointer-events: none;
}

.toast {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    animation: toast-in-out 3s forwards;
    opacity: 0;
}

.toast i {
    color: var(--vibrant-green);
}

@keyframes toast-in-out {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }

    15% {
        transform: translateY(0);
        opacity: 1;
    }

    85% {
        transform: translateY(0);
        opacity: 1;
    }

    100% {
        transform: translateY(-20px);
        opacity: 0;
    }
}

@media (max-width: 800px) {
    .note-utils-bar {
        font-size: 0.8rem;
        gap: 12px;
    }
}

/* --- FEEDBACK MODAL --- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    width: 100%;
    max-width: 480px;
    margin: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

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

.form-group {
    margin-bottom: 16px;
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.95rem;
    color: var(--text-primary);
    font-family: var(--font-main);
    transition: border-color 0.2s ease;
}

.form-group select {
    width: 100%;
    padding: 10px 36px 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.95rem;
    color: var(--text-primary);
    font-family: var(--font-main);
    transition: border-color 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23576157' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--text-accent);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-message {
    margin-bottom: 16px;
    padding: 10px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    display: none;
}

.form-message.success {
    display: block;
    background: rgba(34, 197, 94, 0.1);
    color: var(--text-accent);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.form-message.error {
    display: block;
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--text-accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-main);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}