@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

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

:root {
    --brand:          #4F6EF7;
    --brand-dark:     #3A55D4;
    --brand-deeper:   #2C42B0;
    --brand-light:    #EEF2FF;

    --accent:         #10B981;
    --accent-soft:    rgba(16, 185, 129, 0.14);

    --sidebar-bg:     #1A237E;
    --sidebar-bg-2:   #171F78;
    --sidebar-active: #3F4FC2;
    --sidebar-hover:  rgba(255, 255, 255, 0.08);

    --text-primary:   #1E293B;
    --text-secondary: #64748B;
    --surface:        #FFFFFF;
    --border:         rgba(79, 110, 247, 0.12);

    --shadow-card: 0 2px 8px rgba(0,0,0,0.06), 0 8px 28px rgba(79,110,247,0.09);
    --shadow-btn:  0 4px 0 var(--brand-deeper);

    --radius-card: 20px;
    --radius-btn:  12px;

    --font-display: 'Plus Jakarta Sans', sans-serif;
    --font-body:    'Plus Jakarta Sans', sans-serif;

    --sidebar-width: 250px;
}

html {
    width: 100%;
    min-height: 100%;
}

body {
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    background: #E8EDFB;
    color: var(--text-primary);
    overflow-x: hidden;
}

/* =========================
   SIDEBAR
========================= */

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    flex-shrink: 0;

    background:
        radial-gradient(circle at 24px 22px, rgba(16,185,129,0.13), transparent 36px),
        linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);

    padding: 34px 20px 24px;

    display: flex;
    flex-direction: column;

    position: sticky;
    top: 0;

    box-shadow:
        inset -1px 0 0 rgba(255,255,255,0.06),
        12px 0 28px rgba(26,35,126,0.08);
}

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

    margin-bottom: 48px !important;
    padding: 0 10px !important;

    min-height: 42px !important;

    font-family: var(--font-display) !important;
    font-size: 24px !important;
    font-weight: 800 !important;
    color: #FFFFFF !important;
    letter-spacing: 2.5px !important;
    line-height: 1 !important;

    text-shadow: 0 2px 10px rgba(0,0,0,0.16) !important;
}

.sidebar .logo::before {
    content: "";
    width: 11px;
    height: 11px;
    flex: 0 0 11px;

    border-radius: 999px;
    background: var(--accent);

    box-shadow:
        0 0 0 6px var(--accent-soft),
        0 0 18px rgba(16,185,129,0.48);

    display: inline-block;
}

.sidebar .logo:has(.logo-dot)::before {
    display: none;
}

.sidebar .logo-dot {
    width: 11px !important;
    height: 11px !important;
    flex: 0 0 11px !important;

    border-radius: 999px !important;
    background: var(--accent) !important;

    box-shadow:
        0 0 0 6px var(--accent-soft),
        0 0 18px rgba(16,185,129,0.48) !important;
}

.sidebar .logo-text {
    font-family: var(--font-display) !important;
    font-size: 24px !important;
    font-weight: 800 !important;
    color: #FFFFFF !important;

    letter-spacing: 2.5px !important;
    line-height: 1 !important;

    text-shadow: 0 2px 10px rgba(0,0,0,0.16) !important;
}

/* FIX: TITIK KANAN DIHILANGKAN */
.sidebar .logo .dot,
.sidebar .logo-text .dot,
.sidebar .logo-text span {
    display: none !important;
}

/* =========================
   MENU
========================= */

.menu {
    display: flex;
    flex-direction: column;
    gap: 11px;
    flex: 1;
}

.menu-item {
    min-height: 54px;

    display: flex;
    align-items: center;
    gap: 14px;

    padding: 12px 16px;

    border-radius: 16px;
    text-decoration: none;

    color: rgba(255, 255, 255, 0.72);

    font-size: 14px;
    font-weight: 800;

    position: relative;

    transition:
        background 0.18s ease,
        color 0.18s ease,
        transform 0.15s ease,
        box-shadow 0.18s ease;
}

.menu-item:hover {
    background: var(--sidebar-hover);
    color: #FFFFFF;
    transform: translateX(2px);
}

.menu-item.active {
    background: var(--sidebar-active);
    color: #FFFFFF;

    box-shadow:
        0 10px 24px rgba(0,0,0,0.14),
        inset 0 1px 0 rgba(255,255,255,0.14);
}

.menu-item.active::before {
    content: "";
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);

    width: 4px;
    height: 32px;

    border-radius: 999px;
    background: var(--accent);

    box-shadow: 0 0 12px rgba(16,185,129,0.55);
}

.menu-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: rgba(255,255,255,0.06);

    transition:
        background 0.18s ease,
        transform 0.18s ease;
}

.menu-item:hover .menu-icon {
    background: rgba(255,255,255,0.10);
    transform: scale(1.03);
}

.menu-item.active .menu-icon {
    background: rgba(255,255,255,0.16);
}

.menu-item .icon {
    width: 21px !important;
    height: 21px !important;

    min-width: 21px !important;
    max-width: 21px !important;
    min-height: 21px !important;
    max-height: 21px !important;

    display: block !important;
    flex-shrink: 0 !important;

    fill: currentColor !important;
    stroke: none !important;

    color: currentColor !important;
    opacity: 1;
}

.menu-label,
.menu-item > span:not(.menu-icon) {
    line-height: 1;
    white-space: nowrap;
}

.menu-item.mt-auto {
    margin-top: auto;
}

/* =========================
   MAIN CONTENT
========================= */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

/* =========================
   TOP HEADER
========================= */

.top-header {
    background: linear-gradient(135deg, #4F6EF7 0%, #6366F1 100%);
    padding: 18px 48px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    flex-shrink: 0;
}

.hello-text {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    color: #FFFFFF;
    line-height: 1.2;
}

.subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.78);
    margin-top: 3px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.avatar-box {
    width: 38px;
    height: 38px;

    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);

    overflow: hidden;
    display: block;

    transition: border-color 0.2s, transform 0.2s;

    flex-shrink: 0;
}

.avatar-box:hover {
    border-color: #FFFFFF;
    transform: translateY(-1px);
}

.avatar-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.18);
    color: #FFFFFF;

    border: 1px solid rgba(255, 255, 255, 0.35);

    padding: 7px 16px;
    border-radius: var(--radius-btn);

    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;

    cursor: pointer;

    transition: background 0.2s, transform 0.12s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.30);
    transform: translateY(-1px);
}

.btn-auth-outline {
    color: #FFFFFF;
    border: 1.5px solid rgba(255, 255, 255, 0.75);

    padding: 7px 18px;
    border-radius: var(--radius-btn);

    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;

    text-decoration: none;

    transition: background 0.2s, color 0.2s, transform 0.12s;

    display: inline-block;
}

.btn-auth-outline:hover {
    background: #FFFFFF;
    color: var(--brand);
    transform: translateY(-1px);
}

.btn-auth-solid {
    background: #FFFFFF;
    color: var(--brand);

    padding: 7px 18px;
    border-radius: var(--radius-btn);

    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 800;

    text-decoration: none;

    box-shadow: 0 3px 0 rgba(0,0,0,0.13);

    transition: transform 0.1s, box-shadow 0.1s;

    display: inline-block;
}

.btn-auth-solid:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 0 rgba(0,0,0,0.15);
}

/* =========================
   PAGE CONTENT
========================= */

.path-container {
    flex: 1;

    display: flex;
    flex-direction: column;
    align-items: center;

    padding: 40px 32px 60px;
}

/* =========================
   HERO CARD
========================= */

.hero-card {
    background: var(--surface);

    border-radius: var(--radius-card);

    padding: 40px 44px;

    box-shadow: var(--shadow-card);

    width: 100%;
    max-width: 760px;

    border: 1px solid var(--border);
}

.hero-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
}

.hero-text {
    flex: 1;
    min-width: 0;
}

.card-badge {
    display: inline-block;

    background: var(--brand-light);
    color: var(--brand);

    padding: 4px 12px;
    border-radius: 8px;

    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.lesson-title {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);

    margin-top: 12px;
    line-height: 1.25;
}

.lesson-desc {
    margin-top: 10px;

    color: var(--text-secondary);

    font-size: 14px;
    line-height: 1.7;
}

.hero-icon {
    flex-shrink: 0;

    width: 100px;
    height: 100px;

    background: var(--brand-light);
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-icon svg {
    width: 46px;
    height: 46px;
    fill: var(--brand);
}

/* =========================
   BUTTON
========================= */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    background: var(--brand);
    color: #FFFFFF;

    padding: 13px 28px;

    border-radius: var(--radius-btn);

    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 800;

    border: none;
    cursor: pointer;

    box-shadow: var(--shadow-btn);
    text-decoration: none;

    margin-top: 24px;

    transition: transform 0.12s, box-shadow 0.12s, background 0.15s;

    letter-spacing: 0.3px;
}

.btn-primary:hover {
    background: var(--brand-dark);
    transform: translateY(-1px);
    box-shadow: 0 5px 0 var(--brand-deeper);
}

.btn-primary:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--brand-deeper);
}

.btn-primary.btn-locked {
    background: #CBD5E1;
    color: #475569;
    box-shadow: 0 4px 0 #94A3B8;
    cursor: not-allowed;
}

.btn-primary.btn-locked:hover {
    background: #CBD5E1;
    transform: none;
    box-shadow: 0 4px 0 #94A3B8;
}

.btn-primary .lock-icon {
    width: 14px;
    height: 14px;
    fill: #475569;
    flex-shrink: 0;
}

/* =========================
   INFO SECTION
========================= */

.activity-section {
    margin-top: 36px;
    width: 100%;
    max-width: 760px;
}

.section-title {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 800;

    color: var(--text-secondary);

    letter-spacing: 1px;
    text-transform: uppercase;

    margin-bottom: 16px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.info-card {
    background: var(--surface);

    border-radius: 16px;
    padding: 24px 20px;

    text-align: center;

    border: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(79,110,247,0.06);

    transition: transform 0.2s, box-shadow 0.2s;
}

.info-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(79,110,247,0.13);
}

.info-icon {
    width: 58px;
    height: 58px;

    background: var(--brand-light);
    border-radius: 16px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0 auto 16px;
}

.info-icon svg {
    width: 28px;
    height: 28px;
    fill: var(--brand);
}

.info-card h4 {
    color: var(--text-primary);

    font-size: 14px;
    font-weight: 800;

    margin-bottom: 6px;
}

.info-card p {
    color: var(--text-secondary);

    font-size: 13px;
    line-height: 1.55;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 900px) {
    :root {
        --sidebar-width: 88px;
    }

    .sidebar {
        padding: 24px 14px;
    }

    .sidebar .logo {
        justify-content: center !important;
        padding: 0 !important;
        margin-bottom: 40px !important;
        font-size: 0 !important;
    }

    .sidebar .logo-text {
        display: none !important;
    }

    .sidebar .logo::before,
    .sidebar .logo-dot {
        width: 17px !important;
        height: 17px !important;
        flex-basis: 17px !important;
    }

    .menu-item {
        justify-content: center;
        padding: 12px;
        gap: 0;
    }

    .menu-icon {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .menu-label {
        display: none;
    }

    .menu-item .icon {
        width: 23px !important;
        height: 23px !important;

        min-width: 23px !important;
        max-width: 23px !important;
        min-height: 23px !important;
        max-height: 23px !important;
    }

    .menu-item.active::before {
        left: -14px;
    }

    .top-header {
        padding: 16px 24px;
    }
}

@media (max-width: 720px) {
    body {
        display: block;
    }

    .sidebar {
        width: 100%;
        min-width: 0;
        height: calc(68px + env(safe-area-inset-bottom));

        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        z-index: 900;

        padding: 8px 10px calc(8px + env(safe-area-inset-bottom));

        flex-direction: row;
        align-items: center;
        gap: 0;

        overflow-x: visible;

        box-shadow:
            0 -10px 26px rgba(26,35,126,0.12),
            inset 0 1px 0 rgba(255,255,255,0.08);
    }

    .sidebar .logo {
        display: none !important;
    }

    .sidebar .logo-text {
        display: none !important;
    }

    .sidebar .logo::before,
    .sidebar .logo-dot {
        display: none !important;
    }

    .menu {
        flex-direction: row;
        align-items: center;
        justify-content: space-around;
        gap: 4px;
        flex: 1;
        width: 100%;
    }

    .menu-item {
        min-height: 52px;
        flex: 1 1 0;
        padding: 7px 4px;
        gap: 5px;
        border-radius: 14px;
        flex-direction: column;
        justify-content: center;
        white-space: normal;
        transform: none !important;
    }

    .menu-icon {
        width: 24px;
        height: 24px;
        flex-basis: 24px;
        background: transparent;
    }

    .menu-label {
        display: inline;
        font-size: 10px;
        line-height: 1.1;
        text-align: center;
    }

    .menu-item .icon {
        width: 20px !important;
        height: 20px !important;

        min-width: 20px !important;
        max-width: 20px !important;
        min-height: 20px !important;
        max-height: 20px !important;
    }

    .menu-item.active::before {
        display: none;
    }

    .menu-item.mt-auto {
        margin-top: 0;
    }

    .main-content {
        min-height: auto;
        padding-bottom: calc(84px + env(safe-area-inset-bottom));
    }

    .top-header {
        padding: 14px 16px;
        gap: 14px;
        align-items: flex-start;
    }

    .hello-text {
        font-size: 17px;
    }

    .subtitle {
        font-size: 12px;
    }

    .path-container {
        padding: 24px 14px 32px;
    }

    .hero-card {
        padding: 24px 18px;
        border-radius: 16px;
    }

    .hero-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }

    .hero-icon {
        width: 78px;
        height: 78px;
    }

    .hero-icon svg {
        width: 36px;
        height: 36px;
    }

    .lesson-title {
        font-size: 22px;
    }

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

    .header-actions {
        gap: 8px;
    }

    .header-actions form,
    .btn-logout {
        display: none;
    }

    .btn-logout,
    .btn-auth-outline,
    .btn-auth-solid {
        padding: 7px 11px;
        font-size: 12px;
    }

    .avatar-box {
        width: 34px;
        height: 34px;
    }
}

@media (max-width: 420px) {
    .menu-label {
        font-size: 9px;
    }

    .menu-item {
        padding-left: 2px;
        padding-right: 2px;
    }

    .top-header {
        flex-direction: row;
        align-items: center;
    }

    .header-actions {
        width: auto;
        justify-content: flex-end;
    }
}
