
/* =====================================================
   LENTERA BELAJAR
   Main Stylesheet
   ===================================================== */

/* ---------- GLOBAL ---------- */

:root {
    --bg-main: #080b1d;
    --bg-card: #11162d;
    --bg-card-light: #171e3a;
    --border: #252d4b;
    --primary: #7657f6;
    --primary-light: #9b86ff;
    --blue: #38a5f5;
    --green: #10b981;
    --amber: #f59e0b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --radius: 18px;
    --shadow: 0 15px 40px rgba(0, 0, 0, .25);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg-main);
    color: var(--text-main);
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

a {
    text-decoration: none;
    color: inherit;
}

.hidden {
    display: none !important;
}

/* ---------- DASHBOARD LAYOUT ---------- */

.dashboard-shell {
    width: 100%;
}

.dashboard-welcome {
    position: relative;
    display: grid;
    grid-template-columns: 1.3fr .7fr;
    align-items: center;
    min-height: 330px;
    padding: 42px 48px;
    overflow: hidden;
    border: 1px solid rgba(139, 119, 255, .25);
    border-radius: 24px;
    background:
        radial-gradient(circle at 80% 20%, rgba(118, 87, 246, .25), transparent 35%),
        linear-gradient(120deg, #151b39, #10152c 65%, #1c1942);
    box-shadow: var(--shadow);
}

.welcome-copy {
    position: relative;
    z-index: 2;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #b2a3ff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
}

.eyebrow-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #8c70ff;
    box-shadow: 0 0 14px #8c70ff;
}

.welcome-copy h2 {
    margin: 20px 0 14px;
    color: white;
    font-size: clamp(27px, 4vw, 42px);
    font-weight: 850;
    line-height: 1.2;
    letter-spacing: -1.5px;
}

.welcome-copy h2 span {
    color: #a995ff;
}

.welcome-copy p {
    max-width: 620px;
    color: #aab4d0;
    font-size: 14px;
    line-height: 1.8;
}

.welcome-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

/* ---------- BUTTONS ---------- */

.btn-primary,
.btn-secondary,
.btn-quiet {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 12px 19px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
    transition: .2s ease;
}

.btn-primary {
    color: white;
    border: 1px solid #917aff;
    background: linear-gradient(135deg, #795cf6, #6042d9);
    box-shadow: 0 7px 20px rgba(118, 87, 246, .25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(118, 87, 246, .4);
}

.btn-secondary {
    color: #d9d2ff;
    border: 1px solid #5949a0;
    background: #211d45;
}

.btn-secondary:hover {
    background: #30265f;
}

.btn-quiet {
    color: #c1c9df;
    border: 1px solid #343c5d;
    background: rgba(255, 255, 255, .04);
}

.btn-quiet:hover {
    color: white;
    background: rgba(255, 255, 255, .09);
}

/* ---------- WELCOME ART ---------- */

.welcome-art {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
}

.art-orbit {
    position: absolute;
    width: 240px;
    height: 240px;
    border: 1px solid rgba(157, 135, 255, .25);
    border-radius: 50%;
}

.orbit-one {
    transform: rotateX(65deg) rotate(-25deg);
}

.orbit-two {
    width: 190px;
    height: 280px;
    transform: rotate(45deg);
}

.art-glow {
    position: absolute;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: #704cf5;
    filter: blur(75px);
    opacity: .35;
}

.art-book {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 135px;
    height: 165px;
    border: 1px solid #a995ff;
    border-radius: 12px 24px 24px 12px;
    background: linear-gradient(145deg, #7859ed, #30216e);
    box-shadow: 12px 15px 35px rgba(0, 0, 0, .4);
    transform: rotate(-8deg);
}

.art-book span {
    color: #fbd38d;
    font-size: 23px;
}

.art-book strong {
    font-size: 37px;
    font-weight: 900;
}

.art-book small {
    margin-top: 9px;
    color: #ddd5ff;
    font-size: 8px;
    line-height: 1.6;
    letter-spacing: 2px;
    text-align: center;
}

.art-chip {
    position: absolute;
    z-index: 2;
    padding: 10px 14px;
    border: 1px solid #48436f;
    border-radius: 9px;
    background: #171936;
    color: #d8d0ff;
    font-size: 10px;
    font-weight: 700;
    box-shadow: var(--shadow);
}

.chip-top {
    top: 28px;
    right: 0;
}

.chip-bottom {
    bottom: 20px;
    left: 0;
}

/* ---------- DASHBOARD METRICS ---------- */

.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin: 24px 0 38px;
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 17px;
    min-height: 112px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(145deg, #141a34, #10152a);
    transition: .2s ease;
}

.metric-card:hover {
    transform: translateY(-3px);
    border-color: #51428e;
}

.metric-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 13px;
    font-size: 22px;
}

.metric-violet {
    color: #b9a7ff;
    background: rgba(118, 87, 246, .18);
}

.metric-blue {
    color: #75c5ff;
    background: rgba(56, 165, 245, .15);
}

.metric-amber {
    color: #ffd17b;
    background: rgba(245, 158, 11, .15);
}

.metric-card p {
    margin: 0 0 5px;
    color: var(--text-muted);
    font-size: 12px;
}

.metric-card strong {
    display: block;
    color: white;
    font-size: 26px;
    font-weight: 850;
}

.metric-card small {
    color: #71809f;
    font-size: 10px;
}

/* ---------- DASHBOARD CONTENT ---------- */

.dashboard-content {
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: #0e1328;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 24px;
}

.section-kicker {
    color: #a38fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
}

.section-heading h3 {
    margin: 7px 0;
    color: white;
    font-size: 23px;
    font-weight: 850;
}

.section-heading p {
    margin: 0;
    color: var(--text-muted);
    font-size: 12px;
}

.count-pill {
    padding: 8px 13px;
    border: 1px solid #44377d;
    border-radius: 30px;
    background: #211b46;
    color: #c6baff;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

/* ---------- SEARCH TOOLBAR ---------- */

.library-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.search-field {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 400px;
    padding: 0 14px;
    border: 1px solid #303957;
    border-radius: 10px;
    background: #090e20;
    color: #9d8aff;
}

.search-field input {
    width: 100%;
    min-width: 0;
    padding: 12px 0;
    border: none;
    outline: none;
    background: transparent;
    color: white;
    font-size: 12px;
}

.search-field input::placeholder {
    color: #697592;
}

/* ---------- ACTIVITY GRID ---------- */

.activity-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.activity-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    min-height: 205px;
    padding: 21px;
    overflow: hidden;
    border: 1px solid #283252;
    border-radius: 15px;
    background: linear-gradient(145deg, #171e3a, #11172d);
    transition: .25s ease;
}

.activity-card:hover {
    transform: translateY(-4px);
    border-color: #7961d9;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .22);
}

.activity-card h4 {
    overflow-wrap: anywhere;
}

.loading-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    min-height: 110px;
    color: #9ba8c6;
    font-size: 12px;
}

.loading-orb {
    width: 15px;
    height: 15px;
    border: 2px solid #453b7b;
    border-top-color: #9c86ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ---------- MODAL ---------- */

#createActivityModal,
#createQuizModal {
    z-index: 100;
}

#createActivityModal > div,
#createQuizModal > div {
    border-radius: 18px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, .55);
}

#activityForm input,
#quizForm input,
#quizForm select,
#quizForm textarea {
    border-radius: 8px;
    transition: border-color .2s ease;
}

#activityForm input:focus,
#quizForm input:focus,
#quizForm select:focus,
#quizForm textarea:focus {
    border-color: #8066ff;
    box-shadow: 0 0 0 3px rgba(118, 87, 246, .12);
}

/* ---------- ACTIVITY DETAIL ---------- */

#viewActivityDetail > div:first-child {
    border-radius: 15px;
}

#quizGrid .activity-card {
    min-height: 215px;
}

/* ---------- SCROLLBAR ---------- */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #090e20;
}

::-webkit-scrollbar-thumb {
    border-radius: 10px;
    background: #34345d;
}

::-webkit-scrollbar-thumb:hover {
    background: #6855b7;
}

/* ---------- RESPONSIVE TABLET ---------- */

@media (max-width: 1024px) {
    .activity-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .welcome-art {
        transform: scale(.85);
    }

    .dashboard-welcome {
        padding: 32px;
    }
}

/* ---------- RESPONSIVE MOBILE ---------- */

@media (max-width: 700px) {
    main {
        padding: 14px !important;
    }

    .dashboard-welcome {
        grid-template-columns: 1fr;
        padding: 25px 21px;
    }

    .welcome-art {
        min-height: 200px;
        margin-top: 10px;
        transform: scale(.85);
    }

    .welcome-copy h2 {
        font-size: 29px;
    }

    .welcome-actions {
        flex-direction: column;
    }

    .welcome-actions a,
    .welcome-actions button {
        width: 100%;
    }

    .dashboard-metrics {
        grid-template-columns: 1fr;
        gap: 12px;
        margin: 18px 0 25px;
    }

    .metric-card {
        min-height: 90px;
        padding: 16px;
    }

    .dashboard-content {
        padding: 18px 14px;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .library-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .search-field {
        max-width: none;
    }

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

    .activity-card {
        min-height: 180px;
    }

    #createActivityModal > div,
    #createQuizModal > div {
        padding: 20px;
    }

    header .max-w-7xl {
        padding-left: 14px;
        padding-right: 14px;
    }
}

/* ---------- SMALL MOBILE ---------- */

@media (max-width: 400px) {
    .welcome-copy h2 {
        font-size: 25px;
    }

    .metric-card strong {
        font-size: 22px;
    }

    .section-heading h3 {
        font-size: 20px;
    }
}
