* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.page {
    display: block;
}

.hidden {
    display: none !important;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.header h1 {
    color: white;
    font-size: 24px;
    font-weight: 600;
}

h1, h2 {
    color: #1e3c72;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

h2 {
    font-size: 20px;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #1e3c72;
}

input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e7ff;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

input[type="password"]:focus {
    outline: none;
    border-color: #2a5298;
}

.password-display {
    margin-top: 8px;
    padding: 8px;
    background: #f8fafc;
    border-radius: 6px;
    text-align: center;
}

.password-display small {
    color: #64748b;
    font-size: 14px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    min-height: 48px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: #2a5298;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #1e3c72;
}

.btn-secondary {
    background: #64748b;
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-warning {
    background: #f59e0b;
    color: white;
    width: 100%;
    margin-bottom: 12px;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-danger {
    background: #ef4444;
    color: white;
    width: 100%;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-control {
    background: #2a5298;
    color: white;
    width: 48px;
    height: 48px;
    font-size: 20px;
    font-weight: bold;
    padding: 0;
    border-radius: 50%;
}

.btn-control:hover {
    background: #1e3c72;
}

.time-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    gap: 20px;
}

.time-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.time-control label {
    font-size: 14px;
    margin: 0;
    color: #64748b;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.time-display {
    font-size: 32px;
    font-weight: bold;
    color: #1e3c72;
    min-width: 60px;
    text-align: center;
    padding: 8px;
    background: #f8fafc;
    border-radius: 8px;
}

.time-separator {
    font-size: 32px;
    font-weight: bold;
    color: #1e3c72;
    margin-top: 32px;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#statusDisplay {
    background: #f8fafc;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    text-align: center;
}

#statusDisplay p {
    color: #64748b;
    font-size: 16px;
}

#lastSchedule {
    color: #1e3c72;
    font-weight: 600;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 12px;
    margin: 20px;
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.modal-content h3 {
    color: #1e3c72;
    margin-bottom: 16px;
}

.modal-content p {
    color: #64748b;
    margin-bottom: 24px;
    font-size: 16px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-actions .btn {
    flex: 1;
    min-width: 100px;
}

.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #10b981;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    animation: slideDown 0.3s ease;
}

.notification.error {
    background: #ef4444;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Responsive design */
@media (max-width: 480px) {
    .container {
        padding: 16px;
    }
    
    .card {
        padding: 20px;
    }
    
    .time-selector {
        gap: 16px;
    }
    
    .control-group {
        gap: 12px;
    }
    
    .time-display {
        font-size: 28px;
        min-width: 50px;
    }
    
    .btn-control {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    
    .header h1 {
        font-size: 20px;
    }
}

/* Touch improvements */
@media (pointer: coarse) {
    .btn {
        min-height: 48px;
    }
    
    .btn-control {
        min-width: 48px;
        min-height: 48px;
    }
}