/* ============================================
   Academy Course Platform Styles
   ============================================ */

/* CSS Variables */
:root {
    --academy-bg: #FFF9EB;
    --academy-sidebar-bg: #FFF9EB;
    --academy-content-bg: #FFFFFF;
    --academy-accent: #D87D15;
    --academy-accent-light: #F5A623;
    --academy-text: #2D2D2D;
    --academy-text-muted: #666666;
    --academy-text-light: #999999;
    --academy-border: #E5E5E5;
    --academy-success: #4CAF50;
    --academy-locked: #CCCCCC;
    --academy-radius: 12px;
    --sidebar-width: 320px;
}

/* Layout */

.academy-page .container {
    background: #fefcfb;
}

.academy-layout {
    display: flex;
    min-height: calc(100vh - 66px);
    background: linear-gradient(135deg, #FFF5E6 0%, #FFECD2 100%);
    padding: 24px;
    gap: 24px;
}

/* ============================================
   Sidebar
   ============================================ */
.academy-sidebar {
    width: var(--sidebar-width);
    background: #FFF9EB;
    border: 1px solid #F0DFC7;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 24px;
    height: calc(100vh - 114px);
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(216, 125, 21, 0.08);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--academy-border);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--academy-accent);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.logo-text {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--academy-text);
}

/* Progress Bar */
.sidebar-progress {
    padding: 20px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--academy-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-percent {
    color: var(--academy-accent);
    font-weight: 700;
}

.progress-bar {
    height: 6px;
    background: var(--academy-border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--academy-accent) 0%, var(--academy-accent-light) 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-counter {
    font-size: 0.8rem;
    color: var(--academy-text-muted);
    margin-top: 8px;
}

/* Sidebar Toggle Button (hidden on desktop) */
.sidebar-toggle-btn {
    display: none;
    width: 80px;
    height: 28px;
    padding: 0;
    background: rgba(216, 125, 21, 0.15);
    border: 1px solid rgba(216, 125, 21, 0.3);
    border-radius: 14px;
    cursor: pointer;
    margin: 8px auto;
}

.sidebar-toggle-btn svg {
    display: block;
    margin: 0 auto;
    width: 16px;
    height: 16px;
    color: var(--academy-accent);
    transition: transform 0.3s;
    transform: rotate(180deg);
}

.sidebar-toggle-btn.collapsed svg {
    transform: rotate(0deg);
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--academy-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 20px;
    margin-bottom: 8px;
}

.lesson-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lesson-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s, border-left 0.2s;
    border-left: 3px solid transparent;
}

.lesson-item:hover:not(.locked) {
    background: rgba(216, 125, 21, 0.05);
}

.lesson-item.active {
    background: rgba(216, 125, 21, 0.1);
    border-left-color: var(--academy-accent);
}

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

.lesson-icon {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--academy-border);
    color: var(--academy-text-muted);
}

.lesson-icon.quiz-icon {
    background: var(--academy-locked);
    color: white;
}

.lesson-icon.quiz-icon svg {
    width: 14px;
    height: 14px;
}

.lesson-icon.contents-icon {
    background: var(--academy-border);
    color: var(--academy-text-muted);
}

.lesson-icon.contents-icon svg {
    width: 14px;
    height: 14px;
}

.lesson-item.active .lesson-icon.contents-icon {
    background: var(--academy-accent);
    color: white;
}

.lesson-icon.completed {
    background: var(--academy-success);
    color: white;
}

.lesson-icon.quiz-icon.completed {
    background: var(--academy-success);
    color: white;
}

.lesson-item.active .lesson-icon {
    background: var(--academy-accent);
    color: white;
}

.lesson-item.active .lesson-icon.quiz-icon {
    background: var(--academy-accent);
    color: white;
}

.lesson-icon.quiz-icon.completed {
    background: var(--academy-success);
    color: white;
}

.lesson-item.locked .lesson-icon {
    background: var(--academy-locked);
    color: white;
}

/* Certification item styles */
.lesson-item[data-lesson="certification"]:not(.locked) .lesson-icon {
    background: #8B6BE4;
    color: white;
}

.lesson-item[data-lesson="certification"]:not(.locked):hover {
    background: rgba(139, 107, 228, 0.05);
}

/* Prevent active state styling for certification */
.lesson-item[data-lesson="certification"].active {
    background: transparent;
    border-left-color: transparent;
}

.lesson-title {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--academy-text);
}

.lesson-item.locked .lesson-title {
    color: var(--academy-text-muted);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--academy-border);
    background: var(--academy-sidebar-bg);
}

.user-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-icon {
    width: 40px;
    height: 40px;
    background: var(--academy-accent);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--academy-text);
}

.user-status {
    font-size: 0.8rem;
    color: var(--academy-text-muted);
}

/* ============================================
   Content Area
   ============================================ */
.academy-content {
    flex: 1;
    background: #FFFBF5;
    min-height: calc(100vh - 114px);
    border-radius: 16px;
    border: 1px solid #F0DFC7;
    box-shadow: 0 4px 20px rgba(216, 125, 21, 0.08);
}

.lesson-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px;
}

.lesson-header {
    margin-bottom: 32px;
}

.lesson-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--academy-accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.lesson-title-main {
    font-size: 2rem;
    font-weight: 700;
    color: var(--academy-text);
    line-height: 1.3;
}

.lesson-title-main .lesson-subtitle {
    font-size: 1rem;
    font-weight: 400;
    margin-top: 10px;
    color: var(--academy-text-muted);
    display: block;
}

/* Lesson Body */
.lesson-body {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--academy-text);
}

.lesson-body p {
    margin-bottom: 1rem;
}

.lesson-body h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--academy-text);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.lesson-body h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--academy-text);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.lesson-intro {
    font-size: 1.1rem;
    color: var(--academy-text-muted);
    border-left: 3px solid var(--academy-border);
    padding-left: 16px;
    margin-bottom: 1.5rem;
}

.lesson-list-content {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.lesson-list-content li {
    margin-bottom: 0.5rem;
    position: relative;
}

.lesson-list-content li::marker {
    color: var(--academy-accent);
}

/* Lesson Footer */
.lesson-footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--academy-border);
    display: flex;
    justify-content: flex-end;
}

.btn-next {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--academy-accent);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.btn-next:hover {
    background: #BF6A0F;
    transform: translateY(-2px);
}

.btn-next:active {
    transform: translateY(0);
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 992px) {
    .academy-layout {
        flex-direction: column;
    }

    .academy-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        max-height: none;
        margin-bottom: 12px;
    }

    /* Show toggle button on mobile */
    .sidebar-toggle-btn {
        display: block;
    }

    .sidebar-nav {
        max-height: 1000px;
        overflow: hidden;
        transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
        opacity: 1;
        padding: 0;
    }

    .sidebar-nav.collapsed {
        max-height: 0;
        opacity: 0;
        padding: 0;
    }

    .lesson-content {
        padding: 24px 16px;
    }

    .lesson-title-main {
        font-size: 1.5rem;
    }
}

@media (max-width: 575px) {
    .sidebar-header {
        padding: 16px;
    }

    .sidebar-progress {
        padding: 16px;
    }

    .lesson-item {
        padding: 10px 16px;
    }

    .lesson-title {
        font-size: 0.85rem;
    }

    .lesson-content {
        padding: 20px 12px;
    }

    .lesson-title-main {
        font-size: 1.3rem;
    }

    .lesson-body {
        font-size: 0.95rem;
    }

    .btn-next {
        width: 100%;
        justify-content: center;
    }
}

/* =========================================
   Quiz Module Styles
   ========================================= */

/* --- Container & Layout --- */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.quiz-header {
    text-align: center;
    margin-bottom: 30px;
}

.quiz-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.quiz-description {
    font-size: 16px;
    color: #666;
    line-height: 1.5;
}

/* --- Registration Form --- */
.quiz-registration-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 500px;
    margin: 0 auto;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 14px;
    font-weight: 600;
    color: #444;
}

.form-input {
    padding: 12px 16px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: #4CAF50;
    outline: none;
}

.form-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.form-checkbox {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    accent-color: #4CAF50;
}

.form-checkbox-label {
    font-size: 14px;
    color: #555;
    line-height: 1.4;
}

.form-checkbox-label a {
    color: #4CAF50;
    text-decoration: none;
}

/* --- Quiz Interface --- */
.quiz-progress-bar {
    height: 6px;
    background-color: #f0f0f0;
    border-radius: 3px;
    margin-bottom: 30px;
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    background-color: #4CAF50;
    transition: width 0.3s ease;
}

.question-card {
    margin-bottom: 30px;
}

.question-number {
    font-size: 14px;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.question-text {
    font-size: 20px;
    font-weight: 600;
    color: #222;
    margin-bottom: 24px;
    line-height: 1.4;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.option-item:hover {
    background-color: #f9f9f9;
    border-color: #ccc;
}

.option-item.selected {
    background-color: #e8f5e9;
    border-color: #4CAF50;
}

.option-radio {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    accent-color: #4CAF50;
}

.option-text {
    font-size: 16px;
    color: #333;
    line-height: 1.5;
}

/* --- Controls --- */
.quiz-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.quiz-nav-controls {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.quiz-form-notice {
    font-size: 0.85rem;
    color: var(--academy-text-muted);
    text-align: center;
    margin: 0;
    line-height: 1.4;
}

.btn-quiz {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-secondary {
    background-color: #f5f5f5;
    color: #666;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #e0e0e0;
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background-color: #43a047;
}

.start-btn {
    width: 100%;
}

/* --- Results Screen --- */
.result-screen {
    text-align: center;
    padding: 20px;
}

.result-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.result-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #333;
}

.result-score {
    font-size: 18px;
    color: #555;
    margin-bottom: 30px;
}

.score-highlight {
    font-weight: 700;
    color: #4CAF50;
}

.score-highlight.fail {
    color: #f44336;
}

.result-message {
    margin-bottom: 30px;
    font-size: 16px;
    color: #666;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.error-message {
    margin-top: 20px;
    padding: 12px;
    background-color: #ffebee;
    color: #c62828;
    border-radius: 8px;
    font-size: 14px;
}

/* ============================================
   Contents Page Styles
   ============================================ */
.contents-page {
    max-width: 800px;
}

.contents-page h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--academy-text);
    margin-bottom: 20px;
    margin-top: 40px;
}

.contents-page h2:first-child {
    margin-top: 0;
}

.contents-list {
    list-style: none;
    counter-reset: contents-counter;
    padding: 0;
    margin: 0 0 40px 0;
}

.contents-list li {
    counter-increment: contents-counter;
    padding: 16px 20px;
    margin-bottom: 12px;
    background: #FFF9EB;
    border: 1px solid #F0DFC7;
    border-radius: 8px;
    font-size: 1rem;
    color: var(--academy-text);
    position: relative;
    padding-left: 60px;
}

.contents-list li::before {
    content: counter(contents-counter);
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: var(--academy-accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.contents-outcomes {
    background: #FFF9EB;
    border: 2px solid var(--academy-accent);
    border-radius: 12px;
    padding: 30px;
    margin: 40px 0;
}

.contents-outcomes h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 0;
    font-size: 1.5rem;
    color: var(--academy-accent);
}

.star-icon {
    font-size: 1.5rem;
}

.contents-outcomes>p {
    margin-bottom: 20px;
    color: var(--academy-text);
}

.outcomes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.outcome-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: white;
    padding: 14px;
    border-radius: 8px;
}

.checkmark {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: var(--academy-success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

.outcome-item span:last-child {
    flex: 1;
    color: var(--academy-text);
    font-size: 0.95rem;
    line-height: 1.5;
}

.quote-block {
    background: linear-gradient(135deg, rgba(216, 125, 21, 0.1) 0%, rgba(245, 166, 35, 0.1) 100%);
    border-left: 4px solid var(--academy-accent);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.quote-block p {
    margin: 0;
    font-style: italic;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--academy-text);
}

.contents-intro {
    background: #FEFAF4;
    border: 1px solid #F0DFC7;
    border-radius: 12px;
    padding: 24px;
    margin-top: 30px;
}

.contents-intro h2 {
    margin-top: 0;
    font-size: 1.3rem;
}

.contents-intro p {
    margin: 0;
    line-height: 1.7;
    color: var(--academy-text-muted);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .outcomes-grid {
        grid-template-columns: 1fr;
    }

    .contents-list li {
        padding-left: 50px;
    }

    .contents-list li::before {
        left: 14px;
        width: 24px;
        height: 24px;
        font-size: 0.85rem;
    }
}

@media (max-width: 600px) {
    .quiz-container {
        padding: 15px;
        padding-bottom: 5px;
        /* Reduced from default to minimize whitespace */
        border-radius: 0;
        box-shadow: none;
    }

    .question-text {
        font-size: 18px;
    }

    .option-item {
        padding: 12px;
    }

    .quiz-nav-controls {
        flex-direction: column-reverse;
        gap: 12px;
    }

    /* Keep standard controls (like start/result) normal column if needed, 
       but typically they are single buttons so direction doesn't matter much.
       We specifically requested Nav buttons customization. */

    .btn-quiz {
        width: 100%;
    }

    .contents-outcomes {
        padding: 20px;
    }

    .contents-page h2 {
        font-size: 1.3rem;
    }
}