/* ===== E-LEARNING PORTAL STYLES ===== */

.el-header {
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 12px 0;
}

.el-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.back-home {
    background: var(--primary);
    color: var(--white);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 500;
}

.back-home:hover {
    background: var(--primary-dark);
}

.user-name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--light-bg);
    padding: 8px 15px;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--primary-dark);
}

.logout-btn {
    color: #dc3545;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 50px;
    border: 1px solid #dc3545;
}

.logout-btn:hover {
    background: #dc3545;
    color: var(--white);
}

/* Hero */
.el-hero {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    padding: 50px 0;
    text-align: center;
    color: var(--white);
}

.el-hero h2 {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.el-hero h2 i {
    margin-right: 10px;
}

.el-hero p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.el-hero-sub {
    font-size: 0.95rem !important;
    opacity: 0.7 !important;
    margin-top: 5px;
}

/* Main */
.el-main {
    padding: 50px 0;
    background: var(--light-bg);
    min-height: 60vh;
}

/* Auth Wrapper */
.auth-wrapper {
    max-width: 420px;
    margin: 0 auto;
}

/* Cards */
.el-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 35px;
    box-shadow: var(--shadow-md);
    border-top: 4px solid var(--primary);
}

.el-card.hidden {
    display: none;
}

.el-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--gray-light);
}

.el-card-header i {
    font-size: 1.5rem;
    color: var(--primary);
}

.el-card-header h3 {
    font-size: 1.3rem;
    color: var(--dark);
}

/* Form */
.el-form .form-group {
    margin-bottom: 18px;
}

.el-form label {
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 6px;
}

.el-form label i {
    color: var(--primary);
    margin-right: 5px;
    width: 16px;
}

.el-form input,
.el-form select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius);
    font-size: 0.92rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--white);
}

.el-form input:focus,
.el-form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 63, 0.1);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.85rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.checkbox-label input {
    width: auto !important;
}

.forgot-link {
    color: var(--primary);
    font-weight: 500;
}

.forgot-link:hover {
    text-decoration: underline;
}

.el-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.el-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.el-btn i {
    margin-right: 8px;
}

.form-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--gray);
}

.form-switch a {
    color: var(--primary);
    font-weight: 600;
}

.form-switch a:hover {
    text-decoration: underline;
}

/* ===== DASHBOARD ===== */

/* Stats */
.dash-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.dash-stat-item {
    background: var(--white);
    padding: 25px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 15px;
    border-left: 4px solid var(--primary);
}

.dash-stat-item.progress-stat {
    border-left-color: #f39c12;
}

.dash-stat-item.completed-stat {
    border-left-color: #27ae60;
}

.dash-stat-item.available-stat {
    border-left-color: #3498db;
}

.dash-stat-item i {
    font-size: 2rem;
    color: var(--primary);
    opacity: 0.7;
}

.dash-stat-item.progress-stat i { color: #f39c12; }
.dash-stat-item.completed-stat i { color: #27ae60; }
.dash-stat-item.available-stat i { color: #3498db; }

.dash-stat-num {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--dark);
    line-height: 1;
}

.dash-stat-label {
    font-size: 0.82rem;
    color: var(--gray);
    margin-top: 3px;
}

/* Dashboard Sections */
.dash-section {
    margin-bottom: 40px;
}

.dash-section-title {
    font-size: 1.2rem;
    color: var(--dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gray-light);
}

.dash-section-title i {
    color: var(--primary);
}

/* Course Grid */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Course Card */
.course-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.course-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.course-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.course-card.in-progress::before { background: #f39c12; }
.course-card.completed::before { background: #27ae60; }
.course-card.available::before { background: #3498db; }

.course-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.course-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--white);
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.course-status {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-progress {
    background: #fef3cd;
    color: #856404;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-available {
    background: #d6ecf8;
    color: #0c5460;
}

.course-card h4 {
    font-size: 1.05rem;
    color: var(--dark);
    margin-bottom: 5px;
}

.course-card p {
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 15px;
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: var(--gray-light);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, #f39c12, #e67e22);
    border-radius: 10px;
    transition: width 1s ease;
}

.progress-fill.full {
    background: linear-gradient(to right, #27ae60, #2ecc71);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--gray);
    margin-bottom: 15px;
}

/* Course Meta */
.course-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.82rem;
    color: var(--gray);
}

.course-meta i {
    color: var(--primary);
    margin-right: 4px;
}

/* Course Buttons */
.course-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.continue-btn {
    background: #f39c12;
    color: var(--white);
}

.continue-btn:hover {
    background: #e67e22;
}

.cert-btn {
    background: #27ae60;
    color: var(--white);
}

.cert-btn:hover {
    background: #219a52;
}

.enroll-btn {
    background: #3498db;
    color: var(--white);
}

.enroll-btn:hover {
    background: #2980b9;
}

.enroll-btn.enrolled {
    background: #27ae60;
    cursor: default;
}

/* Footer */
.el-footer {
    background: var(--dark);
    color: rgba(255,255,255,0.7);
    padding: 25px 0;
    text-align: center;
    font-size: 0.88rem;
}

.el-footer a {
    color: var(--gold);
}

.el-footer a:hover {
    text-decoration: underline;
}

.el-footer p + p {
    margin-top: 8px;
}

/* Loading Screen */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    gap: 15px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-screen p {
    color: var(--gray);
    font-size: 0.9rem;
}

/* Error Message */
.error-msg {
    background: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-bottom: 15px;
    border: 1px solid #f5c6cb;
}

/* ===== COURSE VIEW ===== */
.back-btn {
    background: var(--white);
    border: 2px solid var(--gray-light);
    padding: 10px 20px;
    border-radius: 50px;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 20px;
    transition: var(--transition);
}

.back-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.course-view-header {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 25px;
}

.course-view-header h2 {
    font-size: 1.5rem;
    color: var(--dark);
    margin-bottom: 5px;
}

.course-view-header h2 i {
    color: var(--primary);
    margin-right: 10px;
}

.progress-text {
    font-size: 0.85rem;
    color: var(--gray);
    margin-top: 8px;
}

.student-lessons-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
}

.student-lesson {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
}

.student-lesson:hover:not(.lesson-locked) {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.student-lesson.lesson-locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.student-lesson.lesson-current {
    border-left: 4px solid var(--primary);
    background: #f0fff5;
}

.student-lesson.lesson-done {
    border-left: 4px solid #27ae60;
}

.sl-status { font-size: 1.5rem; }
.lesson-done .sl-status { color: #27ae60; }
.lesson-current .sl-status { color: var(--primary); }
.lesson-locked .sl-status { color: var(--gray); }

.sl-info { flex: 1; }
.sl-order { font-size: 0.75rem; color: var(--gray); text-transform: uppercase; }
.sl-info h5 { font-size: 1rem; color: var(--dark); margin: 3px 0; }
.sl-info small { color: var(--gray); font-size: 0.8rem; }

/* Lesson Modal */
.lesson-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lesson-modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.lesson-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid var(--gray-light);
}

.lesson-modal-header h3 { font-size: 1.1rem; color: var(--dark); }

.modal-close {
    background: none; border: none;
    font-size: 1.3rem; cursor: pointer; color: var(--gray); padding: 5px;
}

.lesson-modal-body { padding: 25px; }
.lesson-modal-footer { padding: 15px 25px; border-top: 2px solid var(--gray-light); }

.lesson-progress-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.lesson-progress-bar {
    flex: 1;
    height: 10px;
    background: var(--gray-light);
    border-radius: 10px;
    overflow: hidden;
}

.lesson-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #f39c12, #27ae60);
    border-radius: 10px;
    transition: width 1s linear;
}

.lesson-progress-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 35px;
}

.lesson-next-btn.disabled {
    background: var(--gray-light) !important;
    color: var(--gray) !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.video-container {
    position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: var(--radius);
}
.video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

.video-container-native {
    border-radius: var(--radius);
    overflow: hidden;
}

.video-container-native video {
    width: 100%;
    max-height: 500px;
    background: #000;
    border-radius: var(--radius);
}

.pdf-container iframe {
    width: 100%; height: 500px; border-radius: var(--radius); border: 1px solid var(--gray-light);
}

.text-content { font-size: 0.95rem; line-height: 2; color: var(--text); }
.lesson-desc { margin-top: 15px; color: var(--gray); font-size: 0.9rem; }

/* ===== QUIZ ===== */
.quiz-header {
    background: var(--white); padding: 30px; border-radius: var(--radius-lg);
    box-shadow: var(--shadow); margin-bottom: 25px; text-align: center;
}
.quiz-header h2 { color: var(--dark); }
.quiz-header h2 i { color: var(--primary); }
.quiz-form { max-width: 700px; margin: 0 auto; }

.quiz-question {
    background: var(--white); padding: 25px; border-radius: var(--radius-lg);
    box-shadow: var(--shadow); margin-bottom: 20px;
}
.quiz-question h4 { font-size: 1rem; color: var(--dark); margin-bottom: 15px; }
.quiz-options { display: flex; flex-direction: column; gap: 10px; }

.quiz-options label {
    display: flex; align-items: center; gap: 10px; padding: 12px 15px;
    background: var(--light-bg); border-radius: var(--radius);
    cursor: pointer; transition: var(--transition); font-size: 0.92rem;
}
.quiz-options label:hover { background: #e8f5e9; }
.quiz-options input[type="radio"] { accent-color: var(--primary); }

/* ===== CERTIFICATE ===== */
.certificate { max-width: 800px; margin: 0 auto; }

.cert-border {
    border: 3px solid var(--gold); padding: 8px; border-radius: 12px;
}

.cert-content {
    border: 2px solid var(--primary); padding: 50px 40px;
    text-align: center; border-radius: 8px;
    background: linear-gradient(135deg, #fffdf7, #ffffff);
}
.cert-content h2 { font-size: 1.8rem; color: var(--primary-dark); margin: 15px 0 5px; letter-spacing: 2px; }
.cert-subtitle { color: var(--gray); font-size: 0.9rem; margin-bottom: 30px; }
.cert-body p { font-size: 1rem; color: var(--gray); margin: 8px 0; }
.cert-name { font-size: 2rem; color: var(--dark); margin: 10px 0; border-bottom: 2px solid var(--gold); display: inline-block; padding-bottom: 5px; }
.cert-course { font-size: 1.4rem; color: var(--primary); margin: 10px 0 20px; }

.cert-footer {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--gray-light);
}
.cert-date p, .cert-sign p { font-size: 0.8rem; color: var(--gray); }
.cert-seal { font-size: 3rem; }

@media print {
    .el-header, .el-hero, .el-footer, .back-btn, .el-btn { display: none !important; }
    .el-main { padding: 0 !important; }
    .certificate { max-width: 100%; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .courses-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dash-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .el-hero h2 {
        font-size: 1.6rem;
    }

    .el-card {
        padding: 25px;
    }

    .courses-grid {
        grid-template-columns: 1fr;
    }

    .dash-stats {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .header-right {
        gap: 8px;
    }

    .user-name span {
        display: none;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .dash-stats {
        grid-template-columns: 1fr;
    }
}