:root {
    --primary: #4F46E5;
    --primary-light: #818CF8;
    --bg-dark: #0F172A;
    --text-light: #F8FAFC;
    --text-muted: #94A3B8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --highlight: #10B981;
    --past: #475569;
    --danger: #EF4444;
    --shape-3-bg: #db2777;
}

body.theme-ruby {
    --primary: #E11D48;
    --primary-light: #FDA4AF;
    --highlight: #F43F5E;
    --shape-3-bg: #881337;
}

body.theme-forest {
    --primary: #059669;
    --primary-light: #6EE7B7;
    --highlight: #10B981;
    --shape-3-bg: #064E3B;
}

body.theme-sunset {
    --primary: #EA580C;
    --primary-light: #FDBA74;
    --highlight: #F97316;
    --shape-3-bg: #7C2D12;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Shapes */
.background-shapes {
    position: absolute;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
    opacity: 0.5;
    animation: float 10s ease-in-out infinite alternate;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--highlight);
    bottom: -50px;
    right: -50px;
    opacity: 0.4;
    animation: float 8s ease-in-out infinite alternate-reverse;
}

.shape-3 {
    width: 250px;
    height: 250px;
    background: var(--shape-3-bg);
    top: 40%;
    left: 40%;
    opacity: 0.3;
    animation: float 12s ease-in-out infinite alternate;
}

@keyframes float {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(30px) scale(1.1); }
}

/* Typography & Layout */
.text-center { text-align: center; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

/* Clock & Date */
#date-display {
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.clock {
    font-size: 4.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    margin: 0.5rem 0;
    line-height: 1;
}

/* Countdown */
.countdown-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

#next-period-label {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--primary-light);
}

.countdown {
    font-size: 3rem;
    font-weight: 600;
    color: var(--highlight);
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

/* Schedule List */
.schedule-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

.schedule-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.schedule-list::-webkit-scrollbar {
    width: 6px;
}
.schedule-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 6px;
}

.period-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.period-item.past {
    opacity: 0.4;
    background: transparent;
    text-decoration: line-through;
}

.period-item.current {
    background: rgba(79, 70, 229, 0.2);
    border-color: var(--primary);
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(79, 70, 229, 0.3);
}

.period-item.current .period-name {
    color: var(--primary-light);
    font-weight: 600;
}

.period-time {
    font-weight: 600;
    font-size: 1.1rem;
}

.period-name {
    font-size: 1rem;
    color: var(--text-light);
}

/* Admin Button */
.admin-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    z-index: 100;
}

.admin-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

/* Modals */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    width: 90%;
    max-width: 400px;
}

.admin-dashboard {
    max-width: 700px;
}

input[type="password"], input[type="text"], input[type="time"] {
    width: 100%;
    padding: 0.8rem;
    margin: 1rem 0;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 1.2rem;
    text-align: center;
    outline: none;
}

select.form-select {
    width: 100%;
    padding: 0.8rem;
    margin: 0.5rem 0 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 1rem;
    outline: none;
}

select.form-select option {
    background: var(--bg-dark);
}

input[type="text"], input[type="time"] {
    text-align: left;
    font-size: 1rem;
    margin: 0;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.btn {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover { background: #4338CA; }

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.2); }

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: 1px solid var(--danger);
}
.btn-danger:hover { background: var(--danger); color: white; }

.error-msg {
    color: var(--danger);
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* Admin Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.admin-period-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.admin-schedule-list {
    max-height: 40vh;
    overflow-y: auto;
    padding-right: 0.3rem;
}

.admin-schedule-list::-webkit-scrollbar {
    width: 4px;
}
.admin-schedule-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

@media (max-width: 600px) {
    .clock { font-size: 3.5rem; }
    .countdown { font-size: 2.5rem; }
    .glass-container { padding: 1.5rem; }

    /* Modal fullscreen pada mobile */
    .modal {
        align-items: flex-start;
        padding: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        min-height: auto;
    }

    .admin-dashboard {
        max-width: 100%;
        padding: 1.2rem;
        padding-bottom: 2rem;
    }

    .admin-dashboard h2 {
        font-size: 1.3rem;
    }

    /* Tabs menjadi scrollable horizontal */
    .tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0.4rem;
        padding-bottom: 0.5rem;
    }

    .tab-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    /* Period row vertical stacking pada mobile */
    .admin-period-row {
        grid-template-columns: 1fr 1fr auto;
        grid-template-rows: auto auto;
    }

    .admin-period-row input[type="text"] {
        grid-column: 1 / -1;
    }

    .admin-period-row input[type="time"] {
        font-size: 0.9rem;
        padding: 0.6rem;
    }

    .admin-period-row .btn-del {
        padding: 0.6rem;
        font-size: 0.8rem;
    }

    .admin-schedule-list {
        max-height: none;
    }

    /* Select tema */
    select.form-select {
        font-size: 0.9rem;
        padding: 0.7rem;
    }

    /* Tombol bawah */
    .modal-actions {
        gap: 0.5rem;
    }

    .btn {
        padding: 0.7rem;
        font-size: 0.9rem;
    }
}
