:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --sidebar-width: 240px;
    --topbar-height: 60px;
    --bg-soft: #f4f6fb;
}

* { box-sizing: border-box; }

body {
    background-color: var(--bg-soft);
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
}

/* ---------- Login Page ---------- */
.login-wrapper {
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color), #7c3aed);
}

.login-card {
    width: 100%;
    max-width: 400px;
    border-radius: 16px;
}

.login-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.toggle-password { cursor: pointer; }

#loginBtn { padding: 10px; border-radius: 8px; }

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: #111827;
    color: #fff;
    z-index: 1040;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    font-weight: 700;
    font-size: 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-menu {
    list-style: none;
    padding: 10px 0;
    margin: 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
    background: rgba(79, 70, 229, 0.2);
    color: #fff;
    border-left: 3px solid var(--primary-color);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1030;
}

/* ---------- Main Content ---------- */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.topbar {
    height: var(--topbar-height);
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 1020;
}

/* ---------- Mobile Responsive ---------- */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .sidebar-overlay.show {
        display: block;
    }
    .main-content {
        margin-left: 0;
    }
}

.card { border-radius: 12px; }

/* ================= Public Result Page ================= */
.result-page {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    background: linear-gradient(-45deg, #1e1b4b, #4338ca, #7c3aed, #db2777);
    background-size: 400% 400%;
    animation: gradientShift 12s ease infinite;
}

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.result-bg-glow {
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    max-width: 150vw;
    max-height: 150vw;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 70%);
    animation: pulseGlow 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
    50%      { opacity: 1;   transform: translateX(-50%) scale(1.1); }
}

.result-title {
    color: #fff;
    font-weight: 800;
    letter-spacing: 1px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

.result-subtitle {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
}

.result-card {
    max-width: 560px;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 24px;
    padding: 36px 28px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.35);
    animation: cardFloat 5s ease-in-out infinite;
}

@keyframes cardFloat {
    0%, 100% { transform: translateY(0px); }
    50%      { transform: translateY(-8px); }
}

.slot-badge {
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 30px;
    letter-spacing: 0.3px;
}

.value-circle {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 100px;
    margin: 0 auto;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.4);
}

.value-circle.reveal {
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
    0%   { transform: scale(0.4); opacity: 0; }
    60%  { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); }
}

.value-label {
    text-align: center;
    margin-top: 8px;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 1px;
}

.timer-label {
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.timer-display {
    font-size: 42px;
    font-weight: 800;
    color: #1e1b4b;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
    transition: color 0.3s ease;
}

.timer-display.timer-urgent {
    color: #dc2626;
    animation: timerPulse 1s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.08); }
}

.btn-history {
    background: linear-gradient(90deg, #111827, #374151);
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 10px 26px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-history:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.25);
}

@media (max-width: 575.98px) {
    .result-card { padding: 28px 18px; }
    .timer-display { font-size: 32px; }
    .value-circle { font-size: 22px; }
}
