/* =============================================
   UZURI INSTITUTE ACADEMY - Main Stylesheet
   Brand Colors: #8BC34A (lime green), #4CAF50 (green), #FFFFFF (white)
   ============================================= */

:root {
    --primary: #6aaa1e;
    --primary-dark: #4e8a0e;
    --primary-light: #8BC34A;
    --accent: #ff5722;
    --accent-orange: #ff9800;
    --white: #ffffff;
    --light-bg: #f8fdf2;
    --text-dark: #1a1a1a;
    --text-muted: #6c757d;
    --border: #d4edda;
    --shadow: rgba(106, 170, 30, 0.15);
    --sidebar-width: 260px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--white);
    color: var(--text-dark);
    line-height: 1.6;
}

/* ---- TYPOGRAPHY ---- */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary-dark);
    font-weight: 700;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

/* ---- BUTTONS ---- */
.btn-primary-uzuri {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
}
.btn-primary-uzuri:hover {
    background: linear-gradient(135deg, var(--primary-dark), #3a6b08);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow);
    text-decoration: none;
}

.btn-outline-uzuri {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 8px 22px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
}
.btn-outline-uzuri:hover {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}

.btn-danger-uzuri {
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
}
.btn-danger-uzuri:hover { background: #c82333; color: #fff; text-decoration: none; }

.btn-success-uzuri {
    background: #28a745;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
}
.btn-success-uzuri:hover { background: #218838; color: #fff; text-decoration: none; }

/* ---- NAVBAR ---- */
.navbar-uzuri {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-uzuri .navbar-brand img {
    height: 50px;
    width: auto;
}

.navbar-uzuri .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    padding: 8px 14px !important;
    border-radius: 4px;
    transition: all 0.2s;
}
.navbar-uzuri .nav-link:hover,
.navbar-uzuri .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,0.15);
}

.navbar-uzuri .navbar-toggler {
    border-color: rgba(255,255,255,0.5);
}
.navbar-uzuri .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ---- SIDEBAR (Admin & Student) ---- */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: linear-gradient(180deg, var(--primary-dark) 0%, #2d5a0a 100%);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 20px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    text-align: center;
}
.sidebar-brand img {
    width: 130px;
    height: auto;
    border-radius: 8px;
}

.sidebar-menu {
    padding: 15px 0;
    list-style: none;
}
.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    font-size: 0.95rem;
}
.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-left: 3px solid var(--accent-orange);
    padding-left: 17px;
    text-decoration: none;
}
.sidebar-menu li a i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-section-title {
    padding: 10px 20px 5px;
    color: #ED7751; /* Pure Red */
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 400;
}

/* ---- MAIN CONTENT ---- */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--light-bg);
    transition: margin-left 0.3s ease;
}

.page-header {
    background: #fff;
    padding: 20px 30px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.page-header h1 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--primary-dark);
}

.page-body {
    padding: 25px 30px;
}

/* ---- CARDS ---- */
.card-uzuri {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 15px var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.card-uzuri:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px var(--shadow);
}

.card-uzuri .card-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    padding: 15px 20px;
    font-weight: 600;
    font-size: 1rem;
}

.card-uzuri .card-body {
    padding: 20px;
}

/* Stat cards */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 15px var(--shadow);
    border-left: 4px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 15px;
}
.stat-card.orange { border-left-color: var(--accent-orange); }
.stat-card.red { border-left-color: var(--accent); }
.stat-card.blue { border-left-color: #2196F3; }

.stat-card .stat-icon {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    background: var(--light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
    flex-shrink: 0;
}
.stat-card.orange .stat-icon { color: var(--accent-orange); }
.stat-card.red .stat-icon { color: var(--accent); }
.stat-card.blue .stat-icon { color: #2196F3; }

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}
.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 4px;
}

/* ---- COURSE CARDS ---- */
.course-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px var(--shadow);
}
.course-card .course-thumb {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
}
.course-card .course-thumb-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: rgba(255,255,255,0.7);
}
.course-card .course-body {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.course-card .course-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 8px;
}
.course-card .course-desc {
    color: var(--text-muted);
    font-size: 0.88rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.course-card .course-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.course-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
}
.course-badge {
    background: var(--light-bg);
    color: var(--primary-dark);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid var(--border);
}

/* ---- FORMS ---- */
.form-uzuri .form-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
}
.form-uzuri .form-control,
.form-uzuri .form-select {
    border: 1.5px solid #ced4da;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-uzuri .form-control:focus,
.form-uzuri .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(106, 170, 30, 0.15);
    outline: none;
}

/* ---- TABLES ---- */
.table-uzuri {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px var(--shadow);
}
.table-uzuri thead th {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    padding: 12px 15px;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: left;
}
.table-uzuri tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}
.table-uzuri tbody tr:hover { background: var(--light-bg); }
.table-uzuri tbody td {
    padding: 12px 15px;
    font-size: 0.9rem;
    vertical-align: middle;
}

/* ---- BADGES ---- */
.badge-pending { background: #fff3cd; color: #856404; padding: 4px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }
.badge-confirmed { background: #d4edda; color: #155724; padding: 4px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }
.badge-rejected { background: #f8d7da; color: #721c24; padding: 4px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }
.badge-passed { background: #d4edda; color: #155724; padding: 4px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }
.badge-failed { background: #f8d7da; color: #721c24; padding: 4px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }

/* ---- ALERTS ---- */
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; border-radius: 8px; padding: 12px 16px; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; border-radius: 8px; padding: 12px 16px; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; border-radius: 8px; padding: 12px 16px; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; border-radius: 8px; padding: 12px 16px; }

/* ---- AUTH PAGES ---- */
.auth-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.auth-card .auth-logo {
    text-align: center;
    margin-bottom: 25px;
}
.auth-card .auth-logo img {
    width: 160px;
    height: auto;
    border-radius: 8px;
}
.auth-card h2 {
    text-align: center;
    font-size: 1.4rem;
    margin-bottom: 5px;
}
.auth-card .auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 25px;
}
.auth-divider {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 15px 0;
    position: relative;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #dee2e6;
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

/* ---- HERO SECTION ---- */
.hero-section {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
    color: #fff;
    padding: 80px 0;
    text-align: center;
}
.hero-section h1 {
    color: #fff;
    font-size: 2.5rem;
    margin-bottom: 15px;
}
.hero-section p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 30px;
}

/* ---- PROGRESS BAR ---- */
.progress-uzuri {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}
.progress-uzuri .progress-bar {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* ---- MATERIAL ITEM ---- */
.material-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.2s;
}
.material-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 10px var(--shadow);
}
.material-item .material-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    background: var(--light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--primary);
    flex-shrink: 0;
}
.material-item .material-icon.video { color: #e53935; background: #fce4ec; }
.material-item .material-icon.pdf { color: #e53935; background: #fce4ec; }
.material-item .material-icon.doc { color: #1565c0; background: #e3f2fd; }

/* ---- EXAM ---- */
.exam-question {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}
.exam-question .question-number {
    background: var(--primary);
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    margin-right: 10px;
}
.exam-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border: 1.5px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.exam-option:hover { border-color: var(--primary); background: var(--light-bg); }
.exam-option input[type="radio"]:checked + label { color: var(--primary-dark); font-weight: 600; }
.exam-option.selected { border-color: var(--primary); background: var(--light-bg); }

/* ---- CERTIFICATE ---- */
.certificate-container {
    background: #fff;
    border: 8px solid var(--primary);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}
.certificate-container::before {
    content: '';
    position: absolute;
    inset: 10px;
    border: 2px solid var(--primary-light);
    border-radius: 10px;
    pointer-events: none;
}
.certificate-container .cert-logo img { width: 120px; }
.certificate-container h1 { color: var(--primary-dark); font-size: 2rem; }
.certificate-container .cert-name { font-size: 1.8rem; color: var(--primary); font-weight: 700; border-bottom: 2px solid var(--primary-light); display: inline-block; padding-bottom: 5px; }
.certificate-container .cert-course { font-size: 1.2rem; color: var(--text-dark); }

/* ---- FOOTER ---- */
.footer-uzuri {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.8);
    text-align: center;
    padding: 20px;
    font-size: 0.85rem;
    margin-top: auto;
}

/* ---- MOBILE OVERLAY ---- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-overlay.show {
        display: block;
    }
    .main-content {
        margin-left: 0;
    }
    .page-body {
        padding: 15px;
    }
    .page-header {
        padding: 15px;
    }
    .hero-section h1 {
        font-size: 1.8rem;
    }
    .auth-card {
        padding: 25px 20px;
    }
    .certificate-container {
        padding: 25px 15px;
    }
    .table-responsive { overflow-x: auto; }
}

/* ---- TOPBAR ---- */
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 12px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 5px rgba(0,0,0,0.05);
}
.topbar .menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--primary-dark);
    cursor: pointer;
    padding: 5px;
}
@media (max-width: 768px) {
    .topbar .menu-toggle { display: block; }
}
.topbar .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.topbar .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}
.topbar .user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
}

/* ---- MISC ---- */
.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 3rem;
    color: var(--border);
    margin-bottom: 15px;
    display: block;
}
.breadcrumb-uzuri {
    background: none;
    padding: 0;
    margin-bottom: 20px;
    font-size: 0.85rem;
}
.breadcrumb-uzuri .breadcrumb-item a { color: var(--primary); }
.breadcrumb-uzuri .breadcrumb-item.active { color: var(--text-muted); }

/* Enrollment status banner */
.enrollment-banner {
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.enrollment-banner.pending { background: #fff3cd; border: 1px solid #ffc107; color: #856404; }
.enrollment-banner.confirmed { background: #d4edda; border: 1px solid #28a745; color: #155724; }
.enrollment-banner.not-enrolled { background: #f8f9fa; border: 1px solid #dee2e6; color: #6c757d; }

/* Video player */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 10px;
    background: #000;
}
.video-wrapper video, .video-wrapper iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

/* Pagination */
.pagination-uzuri .page-link {
    color: var(--primary);
    border-color: var(--border);
}
.pagination-uzuri .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ---- UTILITY CLASSES ---- */
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.text-green { color: var(--primary-dark); }
.bg-green-light { background: var(--light-bg); }

/* Ensure card-uzuri doesn't hover-lift in tables */
.no-hover:hover { transform: none; box-shadow: 0 2px 15px var(--shadow); }

/* Material content display */
.material-content {
    line-height: 1.8;
    font-size: 0.97rem;
}
.material-content h1, .material-content h2, .material-content h3 {
    color: var(--primary-dark);
    margin: 20px 0 10px;
}
.material-content ul, .material-content ol {
    padding-left: 25px;
    margin-bottom: 15px;
}
.material-content p { margin-bottom: 12px; }
.material-content strong { color: var(--primary-dark); }

/* Exam timer */
.exam-timer {
    background: var(--primary-dark);
    color: #fff;
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.exam-timer.warning { background: #ff9800; }
.exam-timer.danger { background: #dc3545; }

/* Result circle */
.result-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    margin: 0 auto 20px;
    border: 6px solid var(--primary);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-dark);
}
.result-circle.failed { border-color: #dc3545; color: #dc3545; }

/* Mobile responsive extras */
@media (max-width: 1030px) {
    .stat-card { padding: 15px; }
    .stat-card .stat-value { font-size: 1.4rem; }
    .course-card .course-thumb, .course-card .course-thumb-placeholder { height: 140px; }
    .auth-card { padding: 20px 15px; }
    .certificate-container h1 { font-size: 1.4rem; }
    .certificate-container .cert-name { font-size: 1.3rem; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .page-header h1 { font-size: 1.2rem; }
    .d-flex.gap-2 { flex-wrap: wrap; }
}
