/* ==========================================
   Prabidhik LMS – Modern Global Theme
   Colors: Primary #1a73e8, Secondary #24963f
   ========================================== */

/* ---------- CSS VARIABLES ---------- */
:root {
    --primary: #1a73e8;
    --primary-dark: #0d5bbf;
    --primary-light: #e8f0fe;
    --secondary: #24963f;
    --secondary-dark: #1c7a32;
    --bg-gray: #f5f7fa;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-dark: #1e2a3e;
    --text-muted: #5b6e8c;
    --border-light: #e9edf2;
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.06);
    --radius: 16px;
    --radius-sm: 12px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-gray);
    color: var(--text-dark);
    line-height: 1.5;
    overflow-x: hidden;
}

/* ---------- LAYOUT (SIDEBAR + MAIN) ---------- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-light);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.app-main {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
    width: calc(100% - 280px);
}

.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ---------- SIDEBAR ---------- */
.sidebar-header {
    padding: 1.8rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.3px;
    color: var(--text-dark);
}

.text-green {
    color: var(--secondary);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.avatar-sm {
    width: 44px;
    height: 44px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--primary);
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

/* Sidebar navigation */
.sidebar-nav {
    padding: 1.5rem 1rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-dark);
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 6px;
    text-decoration: none;
}

.sidebar-nav .nav-link i {
    width: 24px;
    font-size: 1.2rem;
    text-align: center;
}

.sidebar-nav .nav-link:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.sidebar-nav .nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
}

.sidebar-nav .nav-link.text-danger:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* ---------- MODERN CARDS ---------- */
.card {
    border: none;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-light);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.card-body {
    padding: 1.5rem;
}

/* ---------- MODERN BUTTONS (Rounded, gradient optional) ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 2rem;
    transition: all 0.25s ease;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #0a4a9e);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(26, 115, 232, 0.3);
}

.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    box-shadow: none;
}
.btn-outline-primary:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: white;
}
.btn-success:hover {
    background: linear-gradient(135deg, var(--secondary-dark), #14682a);
    transform: translateY(-1px);
}

.btn-outline-success {
    background: transparent;
    border: 1px solid var(--secondary);
    color: var(--secondary);
}
.btn-outline-success:hover {
    background: rgba(36, 150, 63, 0.1);
    transform: translateY(-1px);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #212529;
}
.btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}
.btn-secondary {
    background: #e9ecef;
    color: #495057;
}
.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-sm {
    padding: 0.3rem 0.9rem;
    font-size: 0.75rem;
    border-radius: 1.5rem;
}

.btn-lg {
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
    border-radius: 2.5rem;
}

/* ---------- PROGRESS BARS ---------- */
.progress {
    height: 8px;
    border-radius: 12px;
    background-color: #e9ecef;
}
.progress-bar {
    background-color: var(--secondary);
    border-radius: 12px;
}

/* ---------- COURSE GRID ---------- */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}
.course-card {
    overflow: hidden;
    border-radius: var(--radius);
    height: 100%;
}
.course-card .card-img-top {
    height: 160px;
    object-fit: cover;
    background: var(--primary-light);
}

/* ---------- STAT CARDS ---------- */
.stat-card {
    background: var(--card-bg);
    padding: 1.25rem;
    border-radius: 20px;
    border: 1px solid var(--border-light);
    text-align: center;
}
.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

/* ---------- FORMS ---------- */
.form-control, .form-select {
    border-radius: 40px;
    padding: 0.6rem 1.2rem;
    border: 1px solid #cbd5e1;
    transition: 0.2s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    outline: none;
}

/* ---------- ALERTS ---------- */
.alert-success {
    background: #e6f7ec;
    border: none;
    color: #1e7b34;
    border-radius: 40px;
}
.alert-danger {
    background: #fee2e2;
    border: none;
    color: #dc2626;
    border-radius: 40px;
}
.alert-warning {
    background: #fff3cd;
    border: none;
    color: #856404;
    border-radius: 40px;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
    .app-sidebar {
        transform: translateX(-100%);
        width: 260px;
    }
    .app-sidebar.open {
        transform: translateX(0);
    }
    .app-main {
        margin-left: 0;
        width: 100%;
    }
    .main-content {
        padding: 1rem;
    }
    .mobile-menu-btn {
        display: block;
        position: fixed;
        bottom: 20px;
        left: 20px;
        z-index: 1100;
        background: var(--primary);
        color: white;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        border: none;
        box-shadow: 0 2px 6px rgba(0,0,0,0.2);
        cursor: pointer;
    }
}

/* ---------- LOGIN PAGE SPECIFIC (uses same card, button, form styles) ---------- */
.login-page body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card {
    max-width: 520px;
    width: 100%;
    background: #ffffff;
    border-radius: 32px;
    box-shadow: 0 25px 45px -12px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}
/* Ensure no sidebar shows on login */
.no-sidebar .app-sidebar {
    display: none;
}