/* =========================================================
   SOBAT INKLUSI — GLOBAL DESIGN SYSTEM
   Satu CSS untuk seluruh halaman project
========================================================= */

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

:root {
    --primary: #087fc1;
    --primary-dark: #075b8c;
    --primary-soft: #eaf7ff;
    --info: #18b7d8;
    --success: #28a866;
    --warning: #f59e0b;
    --danger: #dc3545;
    --sidebar-width: 260px;
    --bg: #f5f8fc;
    --surface: #ffffff;
    --text: #172033;
    --muted: #667085;
    --border: #e6ebf2;
    --radius: 18px;
    --shadow: 0 10px 30px rgba(15, 23, 42, .06);
    --shadow-hover: 0 16px 36px rgba(15, 23, 42, .10);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Plus Jakarta Sans', Arial, sans-serif;
    overflow-x: hidden;
    padding-bottom: 64px;
}

a { transition: .2s ease; }

img { max-width: 100%; height: auto; }

/* =========================================================
   SIDEBAR
========================================================= */
.sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    width: var(--sidebar-width) !important;
    min-width: var(--sidebar-width) !important;
    height: 100vh !important;
    min-height: 100vh !important;
    padding: 18px 12px !important;
    display: flex !important;
    flex-direction: column !important;
    background: linear-gradient(180deg, #0b82c3 0%, #075b91 100%) !important;
    color: #fff;
    overflow: hidden auto !important;
    z-index: 1040 !important;
    box-shadow: 5px 0 22px rgba(2, 47, 74, .14);
}

.sidebar-brand {
    flex: 0 0 auto;
    text-align: center;
    padding: 4px 8px 16px;
}

.sidebar-brand-link {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.sidebar-logo {
    display: block !important;
    width: 76px !important;
    height: 76px !important;
    max-width: 76px !important;
    max-height: 76px !important;
    object-fit: contain !important;
    background: #fff;
    border: 3px solid rgba(255,255,255,.92);
    border-radius: 18px !important;
    box-shadow: 0 7px 20px rgba(0,0,0,.16);
}

.sidebar-title {
    margin-top: 11px;
    color: #fff;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 800;
    letter-spacing: .8px;
}

.sidebar-user {
    display: flex !important;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    margin: 4px 2px 8px !important;
    padding: 12px !important;
    border-radius: 14px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.08);
}

.sidebar-user-icon {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 30px;
}

.sidebar-avatar {
    width: 38px !important;
    height: 38px !important;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,.85);
}

.sidebar-user-info { min-width: 0; }

.sidebar-user-name {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    margin-top: 2px;
    color: rgba(255,255,255,.72);
    font-size: 11px;
}

.sidebar-login-status {
    flex: 0 0 auto;
    padding: 2px 12px 13px;
    color: rgba(255,255,255,.78);
    font-size: 10px;
}

.sidebar-login-status i {
    margin-right: 5px;
    color: #35d27a;
    font-size: 7px;
}

.sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 0 10px;
    scrollbar-width: thin;
}

.sidebar-section-title {
    margin: 7px 6px 8px !important;
    padding: 0 6px !important;
    color: rgba(255,255,255,.62) !important;
    font-size: 10px !important;
    line-height: 1.4;
    font-weight: 800 !important;
    letter-spacing: .8px;
}

.sidebar-section-title i { margin-right: 5px; }

.sidebar-nav a {
    display: flex !important;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 3px 0 !important;
    padding: 11px 12px !important;
    border-radius: 11px !important;
    color: rgba(255,255,255,.86) !important;
    text-decoration: none !important;
    font-size: 13px !important;
    font-weight: 500;
}

.sidebar-nav a i {
    flex: 0 0 22px;
    width: 22px;
    margin: 0 !important;
    text-align: center;
    font-size: 15px;
}

.sidebar-nav a span {
    min-width: 0;
    line-height: 1.35;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,.12) !important;
    color: #fff !important;
    transform: translateX(2px);
}

.sidebar-nav a.active {
    background: rgba(255,255,255,.18) !important;
    color: #fff !important;
    font-weight: 700 !important;
    box-shadow: inset 3px 0 0 #fff;
}

.sidebar-bottom {
    flex: 0 0 auto;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,.14);
}

.sidebar-logout {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin: 4px 0 !important;
    padding: 11px 12px !important;
    border-radius: 11px;
    color: rgba(255,255,255,.88) !important;
    background: rgba(0,0,0,.12);
    text-decoration: none !important;
    font-size: 13px;
}

.sidebar-logout i { width: 22px; text-align: center; }
.sidebar-logout:hover { background: rgba(220,53,69,.9); color: #fff !important; }

/* Compatibility for older sidebar markup */
.sidebar > a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,.86);
    text-decoration: none;
}

/* =========================================================
   MAIN CONTENT / BOOTSTRAP GRID NORMALIZATION
========================================================= */
.main-content {
    position: relative;
    margin-left: var(--sidebar-width) !important;
    width: calc(100% - var(--sidebar-width)) !important;
    max-width: none !important;
    min-height: 100vh;
    padding: 28px !important;
    background: var(--bg);
}

/* Remove Bootstrap's 25% offset effect when sidebar is fixed */
.main-content.offset-md-3,
.main-content.offset-lg-2 {
    margin-left: var(--sidebar-width) !important;
}

/* Pages that use a normal container inside main */
.main-content > .container,
.main-content > .container-fluid {
    max-width: 1240px;
    margin-left: auto;
    margin-right: auto;
}

/* =========================================================
   PAGE HEADER
========================================================= */
.page-header {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-left: 4px solid var(--primary) !important;
    border-radius: var(--radius) !important;
    padding: 22px 24px !important;
    margin-bottom: 22px !important;
    box-shadow: var(--shadow) !important;
}

.page-header h3,
.page-header h4 { color: var(--text); }
.page-header p { color: var(--muted); }

/* =========================================================
   CARDS / WIDGETS
========================================================= */
.card-custom,
.table-container,
.card-chart,
.card-widget,
.card-modern,
.test-card,
.question-card,
.quiz-card,
.test-header,
.submit-area,
.score-box,
.doc-card,
.testi-card {
    border: 1px solid var(--border) !important;
    background: var(--surface) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow) !important;
}

.card-custom:hover,
.card-modern:hover,
.test-card:hover,
.doc-card:hover,
.testi-card:hover {
    box-shadow: var(--shadow-hover) !important;
}

.card-widget,
.card-chart,
.card-custom,
.table-container { padding: 22px !important; }

.card-widget .h3 { font-size: 1.7rem; }

/* =========================================================
   FORM
========================================================= */
.form-label {
    color: #344054 !important;
    font-size: .82rem !important;
    font-weight: 700 !important;
    margin-bottom: 7px !important;
}

.form-control,
.form-select {
    min-height: 44px;
    border-color: #d8e0ea !important;
    border-radius: 10px !important;
    color: var(--text);
    box-shadow: none !important;
}

textarea.form-control { min-height: 110px; }

.form-control:focus,
.form-select:focus {
    border-color: #58b9e8 !important;
    box-shadow: 0 0 0 .2rem rgba(8,127,193,.12) !important;
}

.btn-custom,
.btn-blue-custom {
    border: 0 !important;
    color: #fff !important;
    background: linear-gradient(135deg, #087fc1, #18a9dc) !important;
    font-weight: 700;
}

.btn-custom:hover,
.btn-blue-custom:hover {
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(8,127,193,.22);
}

/* =========================================================
   TABLE
========================================================= */
.table-container { overflow-x: auto; }
.table { margin-bottom: 0; }
.table thead th {
    background: #f7f9fc !important;
    color: #667085 !important;
    border-bottom: 1px solid var(--border) !important;
    font-size: .78rem;
    font-weight: 800;
    white-space: nowrap;
}
.table tbody td {
    vertical-align: middle;
    font-size: .86rem;
    border-color: #eef1f5;
}

/* =========================================================
   AUTH / LOGIN / REGISTER
========================================================= */
.auth-section {
    width: 100%;
    min-height: 100vh;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 30px 16px !important;
    background:
        radial-gradient(circle at 10% 10%, rgba(24,183,216,.12), transparent 32%),
        radial-gradient(circle at 90% 90%, rgba(8,127,193,.10), transparent 34%),
        #f5f8fc !important;
}

.auth-card {
    position: relative;
    z-index: 2;
    width: 100% !important;
    max-width: 430px !important;
    margin: 0 auto !important;
    padding: 32px !important;
    background: #fff !important;
    border: 1px solid var(--border) !important;
    border-radius: 22px !important;
    box-shadow: 0 24px 60px rgba(15,23,42,.10) !important;
}

.auth-card img {
    width: 76px !important;
    height: 76px !important;
    max-width: 76px !important;
    max-height: 76px !important;
    object-fit: contain !important;
    background: #fff;
    border: 3px solid #087fc1 !important;
    border-radius: 18px !important;
}

.auth-card .input-group-text {
    background: #fff;
    border-color: #d8e0ea;
}

.auth-card .btn-outline-toggle {
    border-color: #d8e0ea;
    background: #fff;
}

/* Legacy auth background: keep it controlled if used */
.bg-section {
    min-height: 100vh;
    position: relative;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

/* =========================================================
   QUIZ / TEST
========================================================= */
.test-wrapper {
    width: 100%;
    max-width: 920px !important;
    margin: 0 auto;
}

.test-header,
.submit-area,
.score-box { padding: 26px !important; }

.option-label,
.quiz-option-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 13px 15px !important;
    margin-top: 9px;
    border: 1px solid #dbe2ea !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: var(--text);
    cursor: pointer;
}

.option-label:hover,
.quiz-option-label:hover {
    background: #f5fbff !important;
    border-color: #72c3e8 !important;
}

.score-number {
    color: var(--primary) !important;
}

/* =========================================================
   GALLERY / MEDIA / IFP
========================================================= */
.gallery-grid,
.testi-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.doc-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.embed-wrapper {
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}

.embed-iframe {
    display: block;
    width: 100%;
    height: 75vh;
    min-height: 520px;
    border: 0;
}

.wordwall-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.wordwall-wrapper iframe {
    width: 100%;
    max-width: 900px;
    height: 600px;
    min-height: 520px;
    border: 0;
    border-radius: 14px;
    background: #fff;
}

/* =========================================================
   CHARTS
========================================================= */
.canvas-container {
    position: relative;
    width: 100%;
    height: 300px;
    min-height: 260px;
}

.canvas-container canvas {
    max-width: 100% !important;
}

/* =========================================================
   FOOTER
========================================================= */
.fixed-footer {
    position: fixed !important;
    left: var(--sidebar-width) !important;
    right: 0;
    bottom: 0;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: rgba(255,255,255,.94);
    border-top: 1px solid var(--border);
    box-shadow: 0 -5px 20px rgba(15,23,42,.04);
    z-index: 1030;
    font-size: .78rem;
}

/* =========================================================
   MOBILE
========================================================= */
.sidebar-overlay {
    display: none;
}

@media (max-width: 767.98px) {
    .sidebar {
        width: min(84vw, 320px) !important;
        min-width: 0 !important;
        transform: translateX(-105%);
        transition: transform .25s ease;
        box-shadow: 8px 0 28px rgba(15,23,42,.18);
    }

    .sidebar.sidebar-show { transform: translateX(0); }

    .sidebar-overlay.show {
        display: block !important;
        position: fixed;
        inset: 0;
        background: rgba(15,23,42,.45);
        z-index: 1030;
    }

    .main-content,
    .main-content.offset-md-3,
    .main-content.offset-lg-2 {
        width: 100% !important;
        margin-left: 0 !important;
        padding: 72px 16px 78px !important;
    }

    .main-content > .container,
    .main-content > .container-fluid {
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
    }

    .sidebar-toggle {
        position: fixed !important;
        top: 14px;
        left: 14px;
        z-index: 1050;
        width: 44px;
        height: 44px;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        border: 0;
        box-shadow: 0 8px 20px rgba(8,127,193,.20);
    }

    .page-header {
        padding: 18px !important;
    }

    .card-widget,
    .card-chart,
    .card-custom,
    .table-container { padding: 18px !important; }

    .canvas-container { height: 270px; }

    .fixed-footer {
        left: 0 !important;
        font-size: .7rem;
        text-align: center;
    }

    .auth-section {
        padding: 20px 12px !important;
    }

    .auth-card {
        max-width: 100% !important;
        padding: 24px 20px !important;
        border-radius: 18px !important;
    }
}

/* =========================================================
   PRINT
========================================================= */
@media print {
    .sidebar,
    .sidebar-overlay,
    .sidebar-toggle,
    .fixed-footer,
    .btn,
    button,
    form,
    .d-print-none {
        display: none !important;
    }

    .main-content,
    .main-content.offset-md-3,
    .main-content.offset-lg-2 {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body { padding: 0 !important; background: #fff !important; }
}


/* =========================================================
   COMPATIBILITY PATCH — MARKUP LAMA
   Mencegah logo membesar dan menjaga layout tetap konsisten
   ========================================================= */
.sidebar .logo-container,
.sidebar .logo-container img,
.sidebar > .logo-container img,
.sidebar .img-fluid {
    max-width: 76px !important;
}

.sidebar .logo-container {
    width: 100% !important;
    text-align: center !important;
}

.sidebar .logo-container img,
.sidebar > .logo-container img {
    width: 76px !important;
    height: 76px !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
}

.sidebar > div {
    max-width: 100%;
}

@media (min-width: 768px) {
    .container-fluid > .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .main-content {
        flex: 0 0 auto !important;
    }
}

@media (max-width: 767.98px) {
    .sidebar .logo-container img,
    .sidebar > .logo-container img,
    .sidebar .img-fluid {
        width: 68px !important;
        height: 68px !important;
    }
}
