:root {
    --primary: #3b82f6;
    --primary-dark: #1d4ed8;
    --secondary: #6366f1;
    --dark: #1f2937;
    --gray: #6b7280;
    --light-gray: #f3f4f6;
    --border: #e5e7eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f9fafb;
    color: #374151;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.countdown-container {
    margin-top: 20px;
    padding: 16px;
    border-radius: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    text-align: center;
}

.countdown-info {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.countdown-time {
    font-size: 22px;
    font-weight: bold;
    color: #0369a1;
    letter-spacing: 1px;
}

.intro-box {
    background: #f9fafb;
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.intro-box h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #0369a1;
}

.intro-box p {
    font-size: 1rem;
    color: #374151;
    margin-bottom: 1rem;
}

.highlight-note {
    background: #e0f2fe;
    color: #0369a1;
    padding: 1rem;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

/* Header Section */
.learning-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 30px 0;
    border-radius: 0 0 20px 20px;
    margin-bottom: 20px;
    margin-top: 80px;
}

.learning-header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.learning-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.learning-title {
    flex: 1;
    text-align: center;
}

.learning-title h1 {
    font-size: 24px;
    margin-bottom: 8px;
}

.learning-title p {
    opacity: 0.9;
    font-size: 14px;
}

.progress-container {
    background: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.progress-info {
    color: black;
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    border-radius: 4px;
    width: 35%;
}

/* PERBAIKAN UTAMA: Mobile Menu Toggle dan Module Sidebar */
.mobile-menu-toggle {
    display: none;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 16px;
    font-weight: 600;
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mobile-menu-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.mobile-menu-toggle:hover::before {
    left: 100%;
}

.mobile-menu-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.mobile-menu-toggle.active {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary));
}

.mobile-menu-toggle i {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.mobile-menu-toggle.active i {
    transform: rotate(90deg);
}

/* Learning Path Section - PERBAIKAN UTAMA */
.learning-path {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

/* PERBAIKAN UTAMA: Module Sidebar untuk semua ukuran */
.module-sidebar {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    height: fit-content;
    margin-bottom: 10px;
    border: 1px solid #f0f0f0;
}

/* TAMPILAN MOBILE - sidebar disembunyikan default */
@media (max-width: 767px) {
    .module-sidebar {
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
            opacity 0.3s ease,
            padding 0.3s ease;
        padding: 0 16px;
    }

    .module-sidebar.active {
        max-height: 600px;
        opacity: 1;
        overflow-y: auto;
        padding: 16px;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .learning-path {
        gap: 0;
    }

    /* Scrollbar styling untuk sidebar mobile */
    .module-sidebar.active::-webkit-scrollbar {
        width: 6px;
    }

    .module-sidebar.active::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
    }

    .module-sidebar.active::-webkit-scrollbar-thumb {
        background: var(--primary);
        border-radius: 10px;
    }

    .module-sidebar.active::-webkit-scrollbar-thumb:hover {
        background: var(--primary-dark);
    }
}

/* TAMPILAN DESKTOP - sidebar selalu terbuka */
@media (min-width: 768px) {
    .learning-path {
        grid-template-columns: 1fr 2fr;
        gap: 20px;
    }

    .module-sidebar {
        max-height: none !important;
        overflow: visible !important;
        opacity: 1 !important;
        padding: 16px;
    }

    .mobile-menu-toggle {
        display: none;
    }
}

/* Styling untuk konten sidebar (berlaku semua ukuran) */
.module-category {
    margin-bottom: 16px;
}

.module-category h3 {
    font-size: 16px;
    padding: 8px 0;
    color: var(--primary-dark);
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
    font-weight: 600;
}

.module-list {
    list-style: none;
}

/* Animasi untuk item modul */
.module-item {
    padding: 14px 12px;
    border-left: 4px solid var(--border);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.module-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.05), transparent);
    transition: left 0.5s;
}

.module-item:hover::before {
    left: 100%;
}

.module-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-left-color: var(--primary);
}

.module-item.active {
    border-left: 4px solid var(--primary);
    background: linear-gradient(135deg, #f0f7ff, #e6f3ff);
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.module-item.active::after {
    content: '✓';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-weight: bold;
    font-size: 16px;
}

.module-item h4 {
    font-size: 15px;
    margin-bottom: 6px;
    color: var(--dark);
    font-weight: 600;
}

.module-item p {
    font-size: 13px;
    color: var(--gray);
    margin: 0;
}

.module-content {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: opacity 0.3s ease;
    position: relative;
}

.module-content.loading {
    opacity: 0.7;
    pointer-events: none;
}

.module-content.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.content-header {
    margin-bottom: 20px;
}

.content-header h2 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--dark);
}

.content-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--gray);
    font-size: 13px;
}

.content-body {
    margin-bottom: 24px;
}

.content-body h3 {
    margin: 16px 0 8px;
    color: var(--primary-dark);
    font-size: 18px;
}

.content-body p {
    margin-bottom: 12px;
    font-size: 15px;
}

.content-body ul {
    padding-left: 20px;
    margin-bottom: 16px;
    font-size: 15px;
}

.content-body li {
    margin-bottom: 8px;
}

.example-box {
    background: #f8fafc;
    border-left: 3px solid var(--primary);
    padding: 16px;
    border-radius: 0 8px 8px 0;
    margin: 16px 0;
}

.example-box h4 {
    color: var(--primary-dark);
    margin-bottom: 8px;
    font-size: 16px;
}

.solution-box {
    background: #f0f9ff;
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
}

.solution-box h5 {
    color: var(--primary);
    margin-bottom: 6px;
    font-size: 14px;
}

.soal-box img,
.solution-box img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 8px auto;
    border-radius: 6px;
}

.solution-box p {
    font-size: 14px;
    margin-bottom: 0;
}

.content-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.btn {
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--dark);
}

.btn-outline:hover {
    background: #f8fafc;
}

/* Interactive Elements */
.quiz-container {
    background: #f0f9ff;
    border-radius: 10px;
    padding: 16px;
    margin: 20px 0;
}

.quiz-question {
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 15px;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quiz-option {
    padding: 12px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.quiz-option:hover {
    border-color: var(--primary);
}

.quiz-option.selected {
    background: #dbeafe;
    border-color: var(--primary);
}

/* Resources Section */
.resources-section {
    margin: 30px 0;
}

.resources-section h2 {
    font-size: 20px;
    margin-bottom: 8px;
}

.resources-section>p {
    margin-bottom: 16px;
    font-size: 15px;
}

.resources-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 16px;
}

.resource-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.resource-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.resource-icon {
    height: 100px;
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
}

.resource-content {
    padding: 16px;
}

.resource-content h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.resource-content p {
    color: var(--gray);
    font-size: 13px;
    margin-bottom: 12px;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 13px;
}

/* Achievement Section */
.achievement-section {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 12px;
    padding: 20px;
    margin: 30px 0;
    text-align: center;
}

.achievement-icon {
    font-size: 40px;
    color: #f59e0b;
    margin-bottom: 12px;
}

.achievement-section h2 {
    color: #92400e;
    margin-bottom: 8px;
    font-size: 18px;
}

.achievement-section p {
    color: #92400e;
    margin-bottom: 16px;
    font-size: 14px;
}

/* Responsive Design */
@media (min-width: 640px) {
    .learning-header-content {
        flex-direction: row;
        text-align: left;
    }

    .learning-title {
        text-align: left;
    }

    .content-footer {
        flex-direction: row;
        justify-content: space-between;
    }

    .resources-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .content-header h2 {
        font-size: 22px;
    }

    .module-item h4 {
        font-size: 15px;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 20px;
    }

    .learning-header {
        padding: 40px 0;
    }

    .learning-icon {
        width: 100px;
        height: 100px;
        font-size: 40px;
    }

    .learning-title h1 {
        font-size: 28px;
    }

    .learning-title p {
        font-size: 16px;
    }

    .progress-container {
        padding: 20px;
    }

    .module-sidebar {
        padding: 20px;
    }

    .module-content {
        padding: 30px;
    }

    .content-header h2 {
        font-size: 24px;
    }

    .resources-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .resource-icon {
        height: 120px;
        font-size: 40px;
    }
}