/* ==========================================
   GROW UP MORE - ROYAL BLUE PROFESSIONAL THEME
   Clean, Modern & Elegant Design
   ========================================== */

/* ========== CSS VARIABLES ========== */
:root {
    /* Royal Blue Theme */
    --primary-900: #1e508a;
    --primary-800: #1e6baf;
    --primary-700: #1d7ad8;
    --primary-600: #258beb;
    --primary-500: #3b82f6;
    --primary-400: #60a5fa;
    --primary-300: #93c5fd;
    --primary-200: #bfdbfe;
    --primary-100: #dbeafe;
    --primary-50: #eff6ff;
    
    /* Secondary - Teal */
    --secondary-600: #0891b2;
    --secondary-500: #06b6d4;
    --secondary-400: #22d3ee;
    
    /* Accent - Amber/Gold */
    --accent-600: #d97706;
    --accent-500: #f59e0b;
    --accent-400: #fbbf24;
    --accent-100: #fef3c7;
    
    /* Success */
    --success-600: #059669;
    --success-500: #10b981;
    --success-100: #d1fae5;
    
    /* Neutral Grays */
    --gray-900: #111827;
    --gray-800: #1f2937;
    --gray-700: #374151;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-300: #d1d5db;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;
    --white: #ffffff;
    
    /* Layout */
    --sidebar-width: 280px;
    --navbar-height: 60px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
}

/* ========== RESET & BASE ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--gray-700);
    background-color: var(--gray-100);
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ========== NAVBAR ========== */
.navbar {
    background: var(--primary-700);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 0 1rem;
    min-height: var(--navbar-height);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--white) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand:hover {
    opacity: 0.9;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 0.875rem !important;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--white) !important;
    background: rgba(255, 255, 255, 0.1);
}

/* Dropdown Styles */
.navbar .dropdown-menu {
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    margin-top: 0.25rem;
    background: var(--white);
}

.navbar .dropdown-item {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--gray-700);
    background: transparent;
    transition: all 0.2s ease;
}

.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus {
    background: var(--primary-100) !important;
    color: var(--primary-700) !important;
}

.navbar .dropdown-item:active,
.navbar .dropdown-item.active {
    background: var(--primary-600) !important;
    color: var(--white) !important;
}

.navbar .dropdown-item i {
    width: 20px;
    margin-right: 0.5rem;
    color: var(--gray-500);
}

.navbar .dropdown-item:hover i,
.navbar .dropdown-item:focus i {
    color: var(--primary-600);
}

.navbar .dropdown-item:active i,
.navbar .dropdown-item.active i {
    color: var(--white);
}

/* Language & User Buttons */
.btn-outline-light {
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--white) !important;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    background: transparent !important;
}

.btn-outline-light:hover,
.btn-outline-light:focus {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--white) !important;
}

.btn-outline-light:active,
.btn-outline-light.show {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.6);
    color: var(--white) !important;
}

/* Dropdown Toggle - prevent white background */
.navbar .dropdown-toggle:hover,
.navbar .dropdown-toggle:focus,
.navbar .dropdown-toggle:active,
.navbar .dropdown-toggle.show {
    background: rgba(255, 255, 255, 0.15) !important;
    color: var(--white) !important;
}

/* ========== LAYOUT ========== */
.layout {
    display: flex;
    min-height: calc(100vh - var(--navbar-height));
}

/* ========== LIGHT SIDEBAR ========== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    overflow-y: auto;
    position: sticky;
    top: var(--navbar-height);
    height: calc(100vh - var(--navbar-height));
}

.sidebar-header {
    background: var(--primary-50);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--primary-100);
    position: sticky;
    top: 0;
    z-index: 10;
}

.sidebar-header h5,
.sidebar-header span {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-800);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-header i {
    color: var(--primary-600);
}

/* Introduction Link */
.intro-link-wrapper {
    border-bottom: 1px solid var(--gray-100);
}

.intro-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-700);
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.intro-link i {
    color: var(--primary-500);
}

.intro-link:hover {
    background: var(--gray-50);
    color: var(--primary-700);
}

/* ========== ACCORDION (Chapters) ========== */
.accordion {
    border: none;
}

.accordion-item {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--gray-100);
}

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

.accordion-button {
    background: var(--white);
    color: var(--gray-800);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.875rem 1.25rem;
    border: none;
    gap: 0.5rem;
}

.accordion-button:not(.collapsed) {
    background: var(--primary-50);
    color: var(--primary-800);
    box-shadow: none;
}

.accordion-button:hover {
    background: var(--gray-50);
}

.accordion-button:focus {
    box-shadow: none;
    border-color: transparent;
}

.accordion-button::after {
    display: none;
}

.accordion-button i:first-child {
    color: var(--primary-500);
}

.acc-icon {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--gray-400);
    transition: transform 0.2s ease;
}

.accordion-button:not(.collapsed) .acc-icon {
    transform: rotate(90deg);
    color: var(--primary-600);
}

.accordion-button:not(.collapsed) i.fa-folder {
    display: none;
}

.accordion-button.collapsed i.fa-folder-open {
    display: none;
}

.accordion-body {
    background: var(--gray-50);
    padding: 0;
}

/* ========== TOPICS ========== */
.topic-item {
    border-bottom: 1px solid var(--gray-100);
}

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

.topic-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-600);
    padding: 0.625rem 1.25rem 0.625rem 1.5rem;
    font-weight: 500;
    font-size: 0.825rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.topic-header:hover {
    background: var(--white);
    color: var(--primary-700);
    border-left-color: var(--primary-400);
}

.topic-arrow {
    font-size: 0.65rem;
    color: var(--gray-400);
    transition: transform 0.2s ease;
    margin-right: 0.5rem;
    transform: rotate(-90deg);
}

.topic-header[aria-expanded="true"] .topic-arrow {
    transform: rotate(0deg);
    color: var(--primary-500);
}

/* ========== SUBTOPICS ========== */
.subtopic-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background: var(--white);
}

.subtopic-item::before,
.subtopic-link::before {
    display: none !important;
    content: none !important;
}

.subtopic-list li {
    border-bottom: 1px solid var(--gray-50);
}

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

.subtopic-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-500);
    padding: 0.5rem 0.50rem 0.5rem 3.50rem;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.subtopic-link::before {
    content: '';
    width: 5px;
    height: 5px;
    background: var(--gray-300);
    border-radius: 50%;
    flex-shrink: 0;
}

.subtopic-link:hover {
    background: var(--primary-50);
    color: var(--primary-700);
    border-left-color: var(--primary-500);
}

.subtopic-link:hover::before {
    background: var(--primary-500);
}

.subtopic-link.active {
    background: var(--primary-100);
    color: var(--primary-800);
    font-weight: 600;
    border-left-color: var(--primary-600);
}

.subtopic-link.active::before {
    background: var(--primary-600);
}

/* ========== RESOURCE LINKS ========== */
.resource-item {
    margin-top: 0.25rem;
    padding-top: 0.25rem;
}

.resource-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-600) !important;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.2rem 1.25rem 0.2rem 2.25rem !important;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.resource-link i {
    font-size: 0.75rem;
}

.resource-link:hover {
    background: var(--accent-100) !important;
    color: var(--accent-600) !important;
    border-left-color: var(--accent-500);
}

.resource-link.active {
    background: var(--accent-100) !important;
    color: var(--accent-600) !important;
    font-weight: 600;
    border-left-color: var(--accent-500);
}

/* ========== CHAPTER RESOURCES ========== */
.chapter-resources {
    padding: 0.5rem 0;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

.resource-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 0.25rem 1rem;
}

.chapter-resource-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary-600) !important;
    font-weight: 600;
    font-size: 0.825rem;
    padding: 0.625rem 1.25rem;
    margin: 0.25rem 0.5rem;
    border-radius: var(--radius);
    transition: all 0.2s ease;
    background: var(--white);
    border: 1px solid var(--gray-100);
}

.chapter-resource-link i {
    color: var(--secondary-500);
}

.chapter-resource-link:hover {
    background: var(--primary-50);
    border-color: var(--primary-200);
    color: var(--primary-700) !important;
}

.chapter-resource-link:hover i {
    color: var(--primary-600);
}

.chapter-resource-link.active {
    background: var(--primary-100);
    border-color: var(--primary-300);
    color: var(--primary-800) !important;
}

/* ========== MAIN CONTENT ========== */
.main-content-wrapper {
    flex: 1;
    background: var(--white);
    overflow-y: auto;
}

.main-content {
    padding: 2rem;
    max-width: 960px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== DASHBOARD ========== */
.dashboard-header {
    background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-800) 100%);
    position: relative;
}

.dashboard-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M20 20h20v20H20zM0 0h20v20H0z'/%3E%3C/g%3E%3C/svg%3E");
}

.dashboard-header h1 {
    font-weight: 600;
    font-size: 2rem;
}

.dashboard-header .lead {
    opacity: 0.9;
}

/* Course Cards */
.hover-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    transition: all 0.25s ease;
    overflow: hidden;
    background: var(--white);
}

.hover-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-200);
}

.hover-card .card-body {
    padding: 1.25rem;
}

.hover-card .card-footer {
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
    padding: 0.75rem 1.25rem;
}

.course-icon {
    width: 56px;
    height: 56px;
    background: var(--primary-100);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.course-icon i {
    font-size: 1.5rem;
    color: var(--primary-600) !important;
}

/* Progress Bar */
.progress {
    height: 6px;
    border-radius: 100px;
    background: var(--gray-200);
}

.progress-bar {
    border-radius: 100px;
    background: var(--primary-500);
}

.progress-bar.bg-success {
    background: var(--success-500) !important;
}

.progress-bar.bg-info {
    background: var(--secondary-500) !important;
}

/* Buttons */
.btn-primary {
    background: var(--primary-600);
    border: none;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: var(--primary-700);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    background: var(--primary-800);
    transform: translateY(0);
}

.btn-outline-primary {
    border: 2px solid var(--primary-500);
    color: var(--primary-600);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
}

.btn-outline-primary:hover {
    background: var(--primary-600);
    border-color: var(--primary-600);
    color: var(--white);
}

.btn-outline-secondary {
    border: 2px solid var(--gray-300);
    color: var(--gray-600);
    font-weight: 500;
}

.btn-outline-secondary:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-700);
}

/* ========== HOME HERO ========== */
.home-hero {
    text-align: center;
    padding: 3rem 0;
}

.home-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-700);
    margin-bottom: 1rem;
}

.home-title-prefix {
    display: block;
    font-size: 1.1rem;
    color: var(--gray-500);
    font-weight: 400;
    margin-bottom: 0.25rem;
}

/* ========== AUTH PAGES ========== */
.auth-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    width: 100%;
    max-width: 420px;
}

.auth-card .card-header {
    background: var(--white);
    border: none;
    padding: 2rem 2rem 1rem;
    text-align: center;
}

.auth-card .card-header h3 {
    color: var(--primary-700);
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.auth-card .card-header p {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.auth-card .card-body {
    padding: 1rem 2rem 2rem;
}

/* ========== FORMS ========== */
.form-control, .form-select {
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    padding: 0.625rem 1rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.form-label {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
}

.input-group-text {
    background: var(--gray-50);
    border: 1px solid var(--gray-300);
    border-right: none;
    color: var(--gray-500);
}

.input-group .form-control {
    border-left: none;
}

.input-group:focus-within .input-group-text {
    border-color: var(--primary-500);
    color: var(--primary-600);
}

/* ========== ALERTS ========== */
.alert {
    border: none;
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
}

.alert-info {
    background: var(--primary-50);
    color: var(--primary-800);
    border-left: 4px solid var(--primary-500);
}

.alert-success {
    background: var(--success-100);
    color: #065f46;
    border-left: 4px solid var(--success-500);
}

.alert-warning {
    background: var(--accent-100);
    color: #92400e;
    border-left: 4px solid var(--accent-500);
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

/* ========== BADGES ========== */
.badge {
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
    border-radius: 100px;
}

.badge.bg-success {
    background: var(--success-500) !important;
}

.badge.bg-primary {
    background: var(--primary-500) !important;
}

/* ========== STATS CARDS ========== */
.stat-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
}

.stat-card:hover {
    border-color: var(--primary-200);
    box-shadow: var(--shadow);
}

.stat-card i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.stat-card .stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-800);
}

.stat-card .stat-label {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* ========== FOOTER ========== */
.footer {
    background: var(--gray-800);
    color: var(--gray-400);
    padding: 1.5rem 0;
    font-size: 0.875rem;
}

.footer a {
    color: var(--gray-300);
    transition: color 0.2s ease;
}

.footer a:hover {
    color: var(--white);
}

/* ========== SCROLLBAR ========== */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--gray-100);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 100px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ========== ERROR PAGES ========== */
.error-page {
    padding: 4rem 0;
    text-align: center;
}

.error-page .error-code {
    font-size: 6rem;
    font-weight: 800;
    color: var(--primary-600);
    line-height: 1;
}

.error-page h2 {
    color: var(--gray-700);
    margin: 1rem 0;
}

.error-page p {
    color: var(--gray-500);
    margin-bottom: 2rem;
}

/* ========== CODE BLOCKS ========== */
pre[class*="language-"] {
    border-radius: var(--radius-lg);
    margin: 1rem 0;
}

code:not([class*="language-"]) {
    background: var(--primary-50);
    color: var(--primary-700);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    font-size: 0.85em;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 992px) {
    .sidebar {
        width: 260px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
        max-height: 50vh;
        border-right: none;
        border-bottom: 1px solid var(--gray-200);
    }
    
    .layout {
        flex-direction: column;
    }
    
    .main-content {
        padding: 1.5rem;
    }
    
    .dashboard-header h1 {
        font-size: 1.5rem;
    }
    
    .home-title {
        font-size: 1.75rem;
    }
    
    .hover-card:hover {
        transform: none;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .auth-card {
        margin: 1rem;
    }
    
    .auth-card .card-body,
    .auth-card .card-header {
        padding: 1.5rem;
    }
}

/* ========== UTILITIES ========== */
.text-primary {
    color: var(--primary-600) !important;
}

.bg-primary {
    background-color: var(--primary-600) !important;
}

.border-primary {
    border-color: var(--primary-500) !important;
}

/* ========== PRINT ========== */
@media print {
    .sidebar, .navbar, .footer {
        display: none !important;
    }
    
    .main-content-wrapper {
        margin: 0;
    }
    
    .main-content {
        max-width: 100%;
        padding: 0;
    }
}