/* 
====================================================================
   THODBERRY INTELLIGENCE - 'VOID' COMPONENTS (FIXED)
   Holographic / Glass / Usable
   Updated: Dec 2025 (Reverted & Polished)
==================================================================== 
*/

/* --- NAVBAR: HYBRID (Glass but Stable) --- */
/* Fixed alignment issues by moving to full-width but keeping glass aesthetic */
.navbar {
    position: sticky;
    /* Switched from fixed to sticky for stability */
    top: 0;
    width: 100%;
    background: rgba(3, 3, 3, 0.8);
    backdrop-filter: var(--glass);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.8rem 0;
    z-index: 1000;
}

.navbar-container {
    display: flex;
    /* Flexbox for alignment */
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.navbar-logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
}

.navbar-menu {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    align-items: center;
}

.navbar-link {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    position: relative;
    transition: color 0.3s;
}

.navbar-link:hover,
.navbar-link.active {
    color: var(--accent-primary);
}

/* Theme Toggle (Style Only - Logic Disabled as user wants Dark only) */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.theme-toggle:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}


/* --- HERO: BENTO GRID (Restored) --- */
.hero-section {
    min-height: 80vh;
    /* Reduced from 100vh for better scaling */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 4rem 0;
}

.hero-bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(var(--border-subtle) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
    background-size: 40px 40px;
    /* Tighter grid */
    mask-image: radial-gradient(circle at center, black 40%, transparent 90%);
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 90%);
    z-index: -1;
    opacity: 0.5;
}

.hero-stats-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 1.2rem;
    background: rgba(0, 240, 255, 0.08);
    /* Darker tint */
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 50px;
    font-family: var(--font-mono);
    color: var(--accent-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.hero-desc {
    max-width: 700px;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
    display: block;
}

/* --- CARDS: HOLOGRAPHIC REDUX --- */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 2rem;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    border-color: var(--accent-primary);
    /* Simple glow border instead of complex gradients */
    background: var(--bg-panel);
    box-shadow: 0 10px 40px -10px rgba(0, 240, 255, 0.1);
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* --- STATS GRID --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    /* Restored gap for better separation */
    margin: 2rem 0;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--text-secondary);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    /* Reverted to solid white for clarity */
    margin-bottom: 0.5rem;
}

.stat-label {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* --- LIBRARY SEARCH & FILTER (PREMIUM) --- */
.library-search-container {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.search-input-wrapper {
    position: relative;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-input-wrapper input {
    width: 100%;
    padding: 1rem 1.5rem;
    padding-right: 3rem;
    background: #111;
    border: 1px solid var(--border-subtle);
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 1rem;
    color: white;
    transition: all 0.3s;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: #000;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
}

.filter-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.filter-select {
    padding: 0.6rem 1.2rem;
    background: #111;
    border: 1px solid var(--border-subtle);
    border-radius: 50px;
    /* Pillow shape for modern look */
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-select:hover,
.filter-select:focus {
    border-color: var(--accent-primary);
    color: white;
    outline: none;
}

/* --- RTI RESULTS GRID (4 Columns) --- */
.rti-grid-results {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4 Columns on large screens */
    gap: 1.5rem;
}

@media (max-width: 1200px) {
    .rti-grid-results {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .rti-grid-results {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .rti-grid-results {
        grid-template-columns: 1fr;
    }
}

/* --- RTI DATA CARD --- */
.rti-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: grid;
    gap: 0.5rem;
    transition: all 0.2s;
}

.rti-card:hover {
    border-color: var(--text-secondary);
    background: var(--bg-panel);
}

.rti-card-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text-primary);
}

.rti-card-meta {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.department-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #fff;
    font-weight: 500;
}

/* --- FOOTER --- */
.footer {
    border-top: 1px solid var(--border-subtle);
    padding: 4rem 0;
    margin-top: 5rem;
    background: var(--bg-surface);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    /* Better responsive wrapping */
    gap: 3rem;
}

.footer h4 {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: #fff;
}

.footer-links a {
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.5rem;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

/* --- MOBILE --- */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}

.navbar-toggle span {
    display: block;
    width: 28px;
    height: 2px;
    background: white;
}

@media (max-width: 768px) {
    .navbar-menu {
        display: none;
        /* JS Toggles this */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--bg-surface);
        flex-direction: column;
        padding: 2rem;
        border-bottom: 1px solid var(--border-subtle);
    }

    .navbar-menu.active {
        display: flex;
    }

    .navbar-toggle {
        display: flex;
    }
}

/* --- TOAST NOTIFICATIONS --- */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--bg-surface);
    color: var(--text-primary);
    padding: 1.5rem 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    border-left: 5px solid var(--color-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1rem;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 1.1rem;
    min-width: 300px;
}

.toast.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.toast-success {
    border-color: var(--color-success);
}

.toast-error {
    border-color: var(--color-error);
}

.toast-warning {
    border-color: var(--color-warning);
}

.toast-info {
    border-color: var(--color-info);
}

/* --- MODAL (DOCUMENT VIEWER) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 1000px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--accent-alert);
}

.modal-body {
    flex: 1;
    padding: 0;
    overflow: hidden;
    background: #000;
}

.modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* --- TEXT TRUNCATION --- */
.text-line-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    /* Standard property */
    /* Limit to 1 line as requested */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-line-clamp.expanded {
    -webkit-line-clamp: unset;
    line-clamp: unset;
    /* Standard property */
}

.read-more-btn {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
    margin-top: 0.2rem;
    text-decoration: underline;
}
