:root {
    --stai-green: #0b8457;
    --stai-green-dark: #054d34;
    --stai-green-light: #12a86d;
    --stai-gold: #e0b13c;
    --stai-gold-light: #f5d78a;
    --stai-bg: #f5f8f7;
    --stai-text: #1c2a26;
    --stai-muted: #6b7c77;
    --radius-lg: 18px;
    --radius-md: 12px;
    --shadow-soft: 0 4px 20px rgba(6, 61, 44, 0.08);
    --shadow-hover: 0 12px 30px rgba(6, 61, 44, 0.16);
}

body {
    background-color: var(--stai-bg);
    background-image: radial-gradient(circle at top right, rgba(11, 132, 87, 0.06), transparent 45%),
        radial-gradient(circle at bottom left, rgba(224, 177, 60, 0.08), transparent 40%);
    background-attachment: fixed;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--stai-text);
}

h1, h2, h3, h4, h5, h6, .sidebar-brand {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    letter-spacing: -0.01em;
}

/* ===== Sidebar ===== */
.sidebar-stai {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    background: linear-gradient(180deg, var(--stai-green-dark), var(--stai-green));
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.12);
    overflow-y: auto;
    z-index: 1040;
    padding: 1.25rem 0;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 1.25rem 1.1rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff !important;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
}

.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 0 0.75rem;
}

.sidebar-nav li {
    margin-bottom: 0.25rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 600;
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.sidebar-nav form {
    margin: 0;
}

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    color: rgba(255, 255, 255, 0.85);
    background: transparent;
    border: none;
    text-align: left;
    font: inherit;
    font-weight: 600;
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-logout-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.main-content-wrap {
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content-wrap main {
    flex: 1 1 auto;
}

.mobile-topbar {
    display: none;
    align-items: center;
    gap: 10px;
    background: linear-gradient(90deg, var(--stai-green-dark), var(--stai-green));
    color: #fff;
    font-weight: 700;
    padding: 0.7rem 1rem;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.sidebar-toggle-btn {
    background: rgba(255, 255, 255, 0.18);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    font-size: 1.25rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1030;
}

@media (max-width: 991.98px) {
    .sidebar-stai {
        transform: translateX(-100%);
    }

    .sidebar-stai.show {
        transform: translateX(0);
    }

    .main-content-wrap {
        margin-left: 0;
    }

    .mobile-topbar {
        display: flex;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

/* ===== Top-bar untuk pengunjung publik (belum login) ===== */
.guest-navbar {
    background: linear-gradient(90deg, var(--stai-green-dark), var(--stai-green));
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
    padding: 0.6rem 0;
    z-index: 1020;
}

.guest-navbar .navbar-brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    gap: 10px;
}

.guest-navbar .nav-link {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    padding: 0.5rem 0.9rem;
}

.guest-navbar .nav-link:hover,
.guest-navbar .nav-link.active {
    color: #fff;
}

.guest-navbar .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.4);
}

.guest-navbar .navbar-toggler-icon {
    filter: invert(1) grayscale(100%) brightness(2);
}

.brand-logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-right: 10px;
    border-radius: 50%;
    background: #fff;
    padding: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ===== Buttons ===== */
.btn {
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
    transform: scale(0.97);
}

.btn-stai {
    background: linear-gradient(135deg, var(--stai-green-light), var(--stai-green-dark));
    border: none;
    color: #fff;
    box-shadow: 0 4px 14px rgba(6, 61, 44, 0.25);
}

.btn-stai:hover {
    background: linear-gradient(135deg, var(--stai-green), var(--stai-green-dark));
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(6, 61, 44, 0.3);
}

.btn-outline-stai {
    border: 2px solid var(--stai-green);
    color: var(--stai-green);
    background: #fff;
}

.btn-outline-stai:hover {
    background-color: var(--stai-green);
    color: #fff;
    transform: translateY(-2px);
}

.btn-warning {
    background: linear-gradient(135deg, #ffd76a, var(--stai-gold));
    border: none;
    color: var(--stai-green-dark);
    box-shadow: 0 4px 14px rgba(224, 177, 60, 0.4);
}

.btn-warning:hover {
    color: var(--stai-green-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(224, 177, 60, 0.5);
}

.btn-lg {
    padding: 0.85rem 1.75rem;
    border-radius: var(--radius-lg);
}

/* ===== Cards ===== */
.card-stai {
    border: none;
    border-top: 4px solid var(--stai-gold);
    box-shadow: var(--shadow-soft);
    border-radius: var(--radius-lg);
    background: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-stai:hover {
    box-shadow: var(--shadow-hover);
}

.card-hover-lift:hover {
    transform: translateY(-6px);
}

.icon-badge {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(11, 132, 87, 0.12), rgba(224, 177, 60, 0.18));
    color: var(--stai-green-dark);
    font-size: 1.75rem;
    margin: 0 auto 1rem;
}

/* ===== Hero ===== */
.hero-stai {
    background: linear-gradient(135deg, var(--stai-green-dark) 0%, var(--stai-green) 55%, var(--stai-green-light) 100%);
    color: #fff;
    padding: 90px 0 100px;
    border-radius: 0 0 40px 40px;
    position: relative;
    overflow: hidden;
}

.hero-stai::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.14) 1.5px, transparent 1.5px);
    background-size: 26px 26px;
    opacity: 0.5;
}

.hero-stai .container {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    backdrop-filter: blur(4px);
}

.stat-strip {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hover);
    padding: 1.75rem 1rem;
    margin-top: -70px;
    position: relative;
    z-index: 2;
}

.stat-strip .stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--stai-green-dark);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.stat-strip .stat-label {
    color: var(--stai-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

/* ===== Forms ===== */
.form-control, .form-select {
    border-radius: var(--radius-md);
    border: 1.5px solid #e1e8e5;
    padding: 0.65rem 1rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--stai-green);
    box-shadow: 0 0 0 0.2rem rgba(11, 132, 87, 0.15);
}

.form-label {
    font-weight: 600;
    color: var(--stai-text);
    font-size: 0.92rem;
}

/* ===== Quiz / Game UI ===== */
.pin-display {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 0.4rem;
    color: var(--stai-green-dark);
    background: #fff;
    border: 3px dashed var(--stai-gold);
    border-radius: var(--radius-lg);
    padding: 10px 20px;
    display: inline-block;
    box-shadow: var(--shadow-soft);
}

.timer-circle {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: 5px solid var(--stai-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--stai-green-dark);
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.option-btn {
    min-height: 100px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.option-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
    filter: brightness(1.05);
}

.option-btn:disabled {
    opacity: 0.85;
}

.option-color-0 { background: linear-gradient(135deg, #ef4759, #c8102e); }
.option-color-1 { background: linear-gradient(135deg, #2d7ff9, #1368ce); }
.option-color-2 { background: linear-gradient(135deg, #f5b301, #d89e00); }
.option-color-3 { background: linear-gradient(135deg, #37ad16, #26890c); }

.participant-badge {
    background: linear-gradient(135deg, var(--stai-green-light), var(--stai-green-dark));
    color: #fff;
    border-radius: 50px;
    padding: 7px 16px;
    margin: 4px;
    display: inline-block;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 3px 8px rgba(6, 61, 44, 0.2);
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
    font-weight: 600;
    transition: transform 0.15s ease;
}

.leaderboard-item:hover {
    transform: translateX(3px);
}

.leaderboard-item:nth-child(1) { border-left: 5px solid gold; }
.leaderboard-item:nth-child(2) { border-left: 5px solid silver; }
.leaderboard-item:nth-child(3) { border-left: 5px solid #cd7f32; }

.poll-bar-bg {
    background: #eef2f0;
    border-radius: 50px;
    overflow: hidden;
    height: 28px;
}

.poll-bar-fill {
    background: linear-gradient(90deg, var(--stai-green-light), var(--stai-green));
    height: 100%;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    padding-left: 10px;
    white-space: nowrap;
    transition: width 0.4s ease;
}

/* ===== Footer ===== */
.footer-stai {
    background: linear-gradient(180deg, var(--stai-green-dark), #032018);
    color: rgba(255, 255, 255, 0.85);
    padding: 40px 0 24px;
    margin-top: 70px;
}

.footer-stai a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
}

.footer-stai a:hover {
    color: var(--stai-gold-light);
}

.footer-stai hr {
    border-color: rgba(255, 255, 255, 0.15);
}

/* ===== Misc ===== */
.badge {
    border-radius: 50px;
    font-weight: 600;
    padding: 0.45em 0.85em;
}

.fade-in-up {
    animation: fadeInUp 0.5s ease both;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 767px) {
    .hero-stai { padding: 60px 0 90px; border-radius: 0 0 28px 28px; }
    .stat-strip { margin-top: -50px; }
    .pin-display { font-size: 2.2rem; letter-spacing: 0.25rem; }
}
