/* styles2.css */

/* --- 1. FONTS & BASICS --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

body {
    font-family: 'Inter', sans-serif !important;
    background-color: #f9fafb !important;
    color: #111827 !important;
    padding-top: 80px !important;
}

/* HIDE OLD ELEMENTS */
.navbar, .tab, .btn-group { display: none !important; }

/* --- 2. TOC (SIDEBAR) STYLES --- */
.tocify {
    border: none !important;
    background: transparent !important;
}
.tocify .list-group-item {
    background: transparent !important;
    color: #6b7280 !important;
    font-size: 0.95rem;
    padding: 8px 15px !important;
    border: none !important;
}
.tocify .list-group-item:hover {
    color: #276DC3 !important;
    background: #eff6ff !important;
    border-radius: 6px;
}
.tocify .list-group-item.active {
    color: #276DC3 !important;
    font-weight: 600 !important;
    background: #eff6ff !important;
    border-left: 3px solid #276DC3 !important;
    border-radius: 0 6px 6px 0;
}

/* --- 3. MAIN CONTENT --- */
.main-container { max-width: 1400px !important; }

div.toc-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #e5e7eb;
}

h1, h2, h3 { 
    font-weight: 700 !important; 
    color: #111 !important; 
    margin-top: 1.5em;
    scroll-margin-top: 100px; 
}
h1.title { margin-top: 0; font-size: 2.5rem; }

/* --- 4. TOP NAVBAR STYLES --- */
.lesson-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e5e7eb;
    z-index: 1000;
    display: flex;
    justify-content: center;
}
.nav-content {
    width: 100%;
    max-width: 1400px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Dropdown Button */
.dropdown-wrapper { position: relative; }

.dropdown-btn {
    background: white;
    border: 1px solid #d1d5db;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    min-width: 160px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}
.dropdown-btn:hover { border-color: #276DC3; color: #276DC3; }

/* --- 5. GRID MENU (MODERN LAYOUT) --- */
/* FIX: Removed 'display: grid' from here so 'display: none' actually works */
.dropdown-menu-custom {
    display: none; 
    position: absolute;
    top: 115%;
    right: 0;
    
    /* Layout properties used ONLY when visible */
    width: 320px; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 8px;
    
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
    padding: 12px;
    z-index: 100;
}

/* FIX: 'display: grid' is now ONLY applied when the 'show' class is added by JS */
.dropdown-menu-custom.show { display: grid !important; }

.dropdown-menu-custom a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    color: #374151;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid transparent;
    background-color: #f9fafb;
    transition: all 0.2s;
}

.dropdown-menu-custom a:hover { 
    background-color: #eff6ff; 
    color: #276DC3; 
    border-color: #bfdbfe;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(39, 109, 195, 0.1);
}

/* --- 6. BACK TO TOP BUTTON --- */
#backToTopBtn {
    display: none;
    position: fixed;
    bottom: 100px;
    right: 30px;
    z-index: 9999;
    border: none;
    outline: none;
    background-color: #276DC3;
    color: white;
    cursor: pointer;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(39, 109, 195, 0.3);
    transition: transform 0.2s, background-color 0.2s;
    align-items: center;
    justify-content: center;
}

#backToTopBtn:hover {
    background-color: #1d4ed8;
    transform: translateY(-3px);
}

/* --- 7. BOTTOM NAVIGATION --- */
.bottom-nav-container {
    margin-top: 60px;
    padding-top: 30px;
    padding-bottom: 60px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bottom-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 50px;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.95rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.bottom-nav-btn:hover {
    border-color: #276DC3;
    color: #276DC3;
    background-color: #f0f7ff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 109, 195, 0.15);
}
