/* --- FONTS & CORE --- */
@import url('https://cdn.jsdelivr.net/gh/janyas/line-seed-sans-th@latest/line-seed-sans-th.css');
@import url('https://bit.ly/3CZa0Sz');
@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css');

:root {
    --accent-color: #0d6efd;
    --primary-color: #0d6efd;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --bg-soft: #fbfbfb;
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 20px 40px -12px rgba(0, 0, 0, 0.12);
}

body {
    font-family: 'line_seed_sans_th', 'Inter', Arial, sans-serif;
    background-color: var(--bg-soft);
    color: #1a1d20;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}


/* Force the main content to grow and fill available space */
main {
    flex: 1 0 auto;
}

/* Ensure the footer doesn't shrink */
footer {
    flex-shrink: 0;
}

.hidden {
    display: none !important;
}

.pointer {
    cursor: pointer;
}

.ls-tight {
    letter-spacing: -0.025em;
}

.fw-extrabold {
    font-weight: 800;
}

/* --- NAVIGATION --- */
.navbar {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background-color: rgba(255, 255, 255, 0.85) !important;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-size: 1.25rem;
    letter-spacing: -0.5px;
}

/* --- SEARCH INTERFACE --- */
.search-bar {
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.search-bar:focus-within {
    background: #fff !important;
    border-color: var(--accent-color) !important;
    box-shadow: 0 8px 20px rgba(13, 110, 253, 0.06) !important;
}

#mainSearch:focus {
    box-shadow: none !important;
}

/* --- CARDS & INTERACTIVE ELEMENTS --- */
.card {
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(0, 0, 0, 0.04) !important;
    box-shadow: var(--card-shadow);
    background: #ffffff;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

.icon-circle,
.icon-box {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: transform 0.3s ease;
}

.card:hover .icon-circle,
.card:hover .icon-box {
    transform: scale(1.1) rotate(-3deg);
}

/* --- LESSON NAVIGATION (SIDEBAR) --- */
.list-group-item {
    border: none !important;
    padding: 12px 18px;
    border-radius: 12px !important;
    margin-bottom: 6px;
    font-weight: 500;
    color: #5f6368;
    transition: all 0.2s ease;
    background: transparent;
}

.list-group-item:hover {
    background-color: rgba(0, 0, 0, 0.03) !important;
    color: #000;
}

.list-group-item.active {
    background-color: #eff6ff !important;
    color: var(--accent-color) !important;
    font-weight: 600;
}

/* --- CONTENT TABS --- */
.nav-pills .nav-link {
    color: #6c757d;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.nav-pills .nav-link.active {
    background-color: var(--accent-color);
    box-shadow: 0 6px 15px rgba(13, 110, 253, 0.25);
}

.nav-tabs .nav-link {
    border: none;
    color: #6c757d;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link.active {
    color: #000;
    border-bottom: 2px solid #000;
    background: none;
}

/* --- TECHNICAL FORMATTING --- */
pre {
    background: #121212;
    color: #e0e0e0;
    padding: 24px;
    border-radius: 16px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow-x: auto;
}

.math-formula {
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    border-left: 5px solid var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    font-family: serif;
    /* Better for math symbols if not using LaTeX */
    font-size: 1.1rem;
    margin: 20px 0;
}

.fw-black {
    font-weight: 900;
}

/* Refined Card Hover Effects */
.eng-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.eng-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color) !important;
}

.eng-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.5rem;
}

/* Search Bar Glow */
#mainSearch:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

/* Tab Styling */
.nav-tabs .nav-link {
    color: #6c757d;
    font-weight: 600;
    padding: 1rem 1.5rem;
    transition: 0.2s;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color) !important;
}

.hidden {
    display: none;
}

/* Empty Search State */
#noResults {
    display: none;
    text-align: center;
    padding: 3rem;
}

/* Custom styles for the Master Database look */
.btn-white {
    background-color: white;
    color: #444;
    transition: all 0.2s;
}

.btn-white:hover {
    background-color: #f8f9fa;
    border-color: #0d6efd !important;
}

.ls-tight {
    letter-spacing: -0.5px;
}

/* Optional: Make the "View" button look exactly like the screenshot */
.btn-outline-primary {
    border-width: 1px;
    font-weight: 500;
}

/* Minimalist Nav Link Style */
.minimal-nav-link {
    color: #6c757d;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.5rem 0 !important;
    transition: color 0.2s ease;
    background: none !important;
}

.minimal-nav-link:hover,
.minimal-nav-link.active {
    color: #0d6efd !important;
}

/* Hide the dropdown arrow for a cleaner look if preferred */
.dropdown-toggle::after {
    vertical-align: 0.15em;
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-left: 0.3em solid transparent;
    opacity: 0.5;
}

.extra-small {
    font-size: 0.65rem;
}

.tracking-wider {
    letter-spacing: 0.05rem;
}

/* Clean Dropdown Styling */
.dropdown-menu {
    font-size: 0.85rem;
    min-width: 200px;
}

.dropdown-item:active {
    background-color: #f8f9fa;
    color: #0d6efd;
}

/* Sidebar Transitions */
aside#lesson-sidebar {
    transition: all 0.3s ease-in-out;
    overflow: hidden;
}

#main-content {
    transition: all 0.3s ease-in-out;
}

/* The "Shrunk" State */
.sidebar-collapsed aside#lesson-sidebar {
    width: 0;
    padding: 0;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.sidebar-collapsed #main-content {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
}
