:root {
    /* Color Palette */
    --primary-color: #1A365D; /* Deep Ocean Blue */
    --secondary-color: #2A4365;
    --accent-color: #D69E2E; /* Gold */
    --accent-light: #F6E05E;
    --bg-dark: #0A192F;
    --bg-light: #F7FAFC;
    --text-primary: #E2E8F0;
    --text-secondary: #A0AEC0;
    --success: #38A169;
    --danger: #E53E3E;
    
    /* Glassmorphism */
    --glass-bg: rgba(26, 54, 93, 0.4);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    --glass-blur: blur(10px);
    
    /* Typography */
    --font-family: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, var(--bg-dark), var(--primary-color));
    color: var(--text-primary);
    min-height: 100vh;
    padding-bottom: 70px; /* Space for bottom nav */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.hidden {
    display: none !important;
}

/* App Container */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    min-height: 100vh;
    background-color: transparent;
}

/* Typography & Utilities */
h1 { font-size: 1.5rem; font-weight: 600; }
h2 { font-size: 1.25rem; font-weight: 500; }
h3 { font-size: 1.125rem; font-weight: 500; }
p { font-size: 0.875rem; color: var(--text-secondary); }
.w-full { width: 100%; }

/* Glassmorphism Utilities */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 16px;
    padding: 1rem;
}

/* Header */
.header {
    padding: 1.5rem 1.25rem;
}

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

.greeting p.date {
    color: var(--accent-light);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.profile-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.profile-icon svg {
    width: 20px;
    height: 20px;
    color: var(--accent-light);
}

/* Next Prayer Card - Hero */
.next-prayer-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(214, 158, 46, 0.2), rgba(26, 54, 93, 0.5));
    border: 1px solid rgba(214, 158, 46, 0.3);
    position: relative;
    overflow: hidden;
}

.next-prayer-card::before {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 150px; height: 150px;
    background: radial-gradient(circle, rgba(214, 158, 46, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
}

.prayer-info, .prayer-countdown {
    position: relative;
    z-index: 1;
}

.prayer-info .label {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.prayer-info h2 {
    font-size: 2rem;
    font-weight: 700;
    margin: 4px 0;
    color: var(--accent-light);
}

.prayer-info .time {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
}

.prayer-countdown {
    font-size: 1.5rem;
    font-weight: 300;
    font-variant-numeric: tabular-nums;
}

/* Main Content */
.main-content {
    padding: 0 1.25rem;
}

/* Banners */
.install-banner {
    background: rgba(42, 67, 101, 0.6);
    backdrop-filter: blur(5px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.install-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.install-icon {
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    display: flex; justify-content: center; align-items: center;
}
.install-icon svg { width: 18px; height: 18px; color: var(--accent-light); }
.install-text h3 { font-size: 1rem; }
.install-text p { font-size: 0.75rem; }

/* Buttons */
.btn-primary {
    background: var(--accent-color);
    color: var(--bg-dark);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    font-family: var(--font-family);
}
.btn-primary:active { transform: scale(0.95); }
.btn-primary.btn-small { padding: 0.5rem 1rem; font-size: 0.8rem; }

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 1rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-family);
}
.btn-secondary:active { background: rgba(255,255,255,0.2); }

.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-success, .btn-danger {
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    flex: 1;
    transition: transform 0.2s;
}
.btn-success:active, .btn-danger:active { transform: scale(0.95); }
.btn-success svg, .btn-danger svg { width: 20px; height: 20px; }

.btn-text {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    padding: 4px;
    transition: color 0.2s, transform 0.2s;
}
.icon-btn:hover, .icon-btn:active {
    color: var(--accent-light);
}
.icon-btn.spinning {
    animation: spin 1s linear infinite;
}
.icon-btn svg { width: 20px; height: 20px; }

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

/* Schedule Section */
.schedule-section {
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

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

.prayer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: rgba(26, 54, 93, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.prayer-item.active {
    background: rgba(214, 158, 46, 0.15);
    border-color: rgba(214, 158, 46, 0.4);
    transform: scale(1.02);
}

.prayer-item.sunah {
    background: rgba(56, 161, 105, 0.1);
    border-left: 3px solid var(--success);
}

.prayer-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.prayer-icon {
    width: 32px; height: 32px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
}
.prayer-icon svg { width: 16px; height: 16px; color: var(--text-secondary); }
.prayer-item.active .prayer-icon svg { color: var(--accent-light); }
.prayer-item.sunah .prayer-icon svg { color: var(--success); }

.prayer-name { font-weight: 500; font-size: 1.05rem; }
.prayer-item.sunah .prayer-name::after {
    content: 'Sunah';
    font-size: 0.65rem;
    background: rgba(56, 161, 105, 0.2);
    color: var(--success);
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    vertical-align: middle;
}

.prayer-time {
    font-weight: 600;
    font-size: 1.1rem;
    font-variant-numeric: tabular-nums;
}

.prayer-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}
.status-badge.sudah { background: rgba(56, 161, 105, 0.2); color: #68D391; }
.status-badge.belum { background: rgba(229, 62, 62, 0.2); color: #FC8181; }

/* Test section */
.test-section {
    margin-bottom: 2rem;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 70px;
    background: rgba(10, 25, 47, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    gap: 4px;
    transition: color 0.2s;
    width: 60px;
}

.nav-item svg { width: 24px; height: 24px; transition: transform 0.2s; }
.nav-item span { font-size: 0.7rem; font-weight: 500; }

.nav-item.active { color: var(--accent-light); }
.nav-item.active svg { transform: translateY(-2px); }

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    opacity: 1;
    transition: opacity 0.3s ease;
}

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

.modal-content {
    width: 100%;
    max-width: 400px;
    text-align: center;
    padding: 2rem 1.5rem;
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.hidden .modal-content {
    transform: scale(0.9);
}

.modal-icon {
    width: 64px; height: 64px;
    background: rgba(214, 158, 46, 0.2);
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    margin: 0 auto 1.5rem;
    color: var(--accent-light);
}
.modal-icon svg { width: 32px; height: 32px; }

.modal-content h2 { margin-bottom: 0.5rem; font-size: 1.5rem; }
.modal-content p { margin-bottom: 2rem; font-size: 1rem; line-height: 1.5; }

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.modal-close {
    margin-top: 1rem;
}

/* Page transitions */
.page {
    display: none;
    animation: fadeIn 0.3s ease;
}
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Fix for main content hiding pages */
.main-content, #history-page, #settings-page { display: block; }
#history-page, #settings-page { display: none; }

/* Settings Form */
.form-input {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}
.form-input:focus {
    border-color: var(--accent-light);
}

/* History Table */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(26, 54, 93, 0.2);
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    text-align: center;
    color: var(--text-primary);
}

.history-table th, .history-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
}

.history-table th {
    background: rgba(0, 0, 0, 0.2);
    color: var(--accent-light);
    font-weight: 500;
}

.history-table td.status-icon {
    font-size: 1.2rem;
}
.history-table td.status-icon.sudah { color: var(--success); }

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}
.toggle-switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  transition: .4s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px; width: 16px;
  left: 3px; bottom: 3px;
  background-color: var(--text-secondary);
  transition: .4s;
}
input:checked + .slider { background-color: var(--accent-color); border-color: var(--accent-color); }
input:checked + .slider:before { transform: translateX(26px); background-color: var(--bg-dark); }
.slider.round { border-radius: 24px; }
.slider.round:before { border-radius: 50%; }
