:root {
    --primary-color: #3a86ff;
    --secondary-color: #8338ec;
    --dark-color: #1a1a2e;
    --light-color: #f8f9fa;
    --success-color: #06d6a0;
    --danger-color: #ef476f;
    --card-bg: rgba(255, 255, 255, 0.1);
    --card-back: #252547;
    --border-radius: 16px;
    --warning-color: #ffb703;
}

.empty-state {
    display: flex;
    flex-direction: column;
    justify-content: center; /* vertikal */
    align-items: center;     /* horizontal */
    text-align: center;
    height: 100%; /* penting kalau parent punya tinggi */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    color: var(--light-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.subtitle {
    font-size: 1rem;
    color: #a0a0c0;
    line-height: 1.5;
}

.card-container {
    perspective: 1000px;
    width: 100%;
    margin-bottom: 30px;
}

.card {
    width: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 0px;
}

.card.flipped {
    transform: rotateY(180deg);
}


.card-face {
    position: absolute;
    width: 100%;
    height: 650px;
    backface-visibility: hidden;
    border-radius: var(--border-radius);
    padding: 25px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.card-back {
    background: var(--card-back);
    transform: rotateY(180deg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.card-title {
    font-size: 1.4rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.flip-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--light-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.flip-btn:hover, .flip-btn:active {
    background: var(--primary-color);
}

/* Time Selection Styles */
.time-digital {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 0px 0px 15px 0px;
}

.time-input {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-label {
    font-size: 0.9rem;
    color: #a0a0c0;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.time-value {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #3a86ff, #8338ec);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}

.time-separator {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 15px;
}

.time-controls {
    justify-content: center;
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.time-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--light-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.time-btn:active {
    background: var(--primary-color);
    transform: scale(0.95);
}

/* Days Selection */
.days-selection {
    margin-bottom: 20px;
}

.days-label {
    font-size: 1rem;
    color: #a0a0c0;
    margin-bottom: 5px;
    display: block;
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.day-btn {
    padding: 12px 5px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #a0a0c0;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.day-btn:active {
    transform: scale(0.95);
}

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

.day-btn.weekend {
    color: #ffd166;
}

/* Control Buttons */
.control-buttons {
    display: flex;
    gap: 15px;
    margin-top: auto;
}

.btn {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn:active {
    transform: scale(0.95);
    opacity: 0.9;
}

.btn-primary {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--light-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Back Card Styles (Alarm List) */
.alarm-list {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 15px;
}

.alarm-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 10px;
}

.alarm-time {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 80px;
}

.alarm-days {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    flex: 1;
    margin: 0 15px;
}

.alarm-day {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 20px;
    background: rgba(58, 134, 255, 0.2);
    color: var(--primary-color);
}

.alarm-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: none;
    border: none;
    color: #a0a0c0;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
}

.action-btn:active {
    transform: scale(0.9);
}

.action-btn.delete:active {
    color: var(--danger-color);
}

.action-btn.update:active {
    color: var(--warning-color);
}

.empty-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-content: center;
    height: 100%;
    text-align: center;
    padding: 40px 20px;
    color: #a0a0c0;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: slideIn 0.3s ease, slideOut 0.3s ease 2.7s forwards;
    max-width: 300px;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.audio-selector {
    overflow-y: auto;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 15px;
}

.audio-options {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.audio-option {
    display: block;
    cursor: pointer;
}

.audio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.audio-option:has(input:checked) {
    background-color: #3a86ff20;
}

.audio-option-content {
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    color: #a0a0c0;
}

.audio-option-content i {
    font-size: 1.2rem;
    color: #3a86ff;
}

.audio-option-content span {
    font-size: 0.9rem;
    font-weight: 500;
}

.audio-option input[type="radio"]:checked + .audio-option-content {
    background: rgba(58, 134, 255, 0.15);
    border-color: #3a86ff;
    color: white;
}

.audio-option:hover .audio-option-content {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 480px) {
    .audio-options {
        grid-template-columns: 1fr;
    }
    
    .audio-option-content {
        padding: 10px;
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    h1 {
        font-size: 1.8rem;
    }
    
    .card-face {
        padding: 20px;
        height: 700px;
    }
    
    .time-value {
        font-size: 3rem;
    }
    
    .time-separator {
        font-size: 2.5rem;
    }
    
    .days-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .alarm-time {
        font-size: 1.3rem;
    }
    
    .alarm-days {
        margin: 0 10px;
    }
}

@media (max-width: 350px) {
    .time-value {
        font-size: 2.5rem;
    }
    
    .days-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}