:root {
    /* Tema Starry Night Original */
    --primary-gradient: linear-gradient(135deg, #0f0f23 0%, #1a1a3e 25%, #2d1b69 50%, #1e3c72 75%, #2a5298 100%);
    --secondary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* Glassmorphism Vars */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(20px);
    
    /* Text & Colors */
    --text-primary: #ffffff;
    --text-secondary: #b8c6db;
    --accent-gold: #ffd700;
    
    /* Status Colors */
    --prio-high: #ff4757;  /* Merah */
    --prio-med: #ffa502;   /* Kuning */
    --prio-low: #2ed573;   /* Hijau */
    
    --shadow-light: 0 8px 32px rgba(0, 0, 0, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--primary-gradient);
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
    padding-bottom: 80px; /* Ruang untuk FAB */
}
/* --- FIX: INPUT TANGGAL POPUP --- */
input[type="date"],
input[type="datetime-local"] {
    position: relative;
    padding: 12px;
    color: white;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    /* Paksa browser menampilkan ikon kalender */
    color-scheme: dark; 
}

/* Memperbesar area klik ikon kalender */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: auto;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
}
/* --- ANIMASI BACKGROUND BINTANG --- */
#stars-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; pointer-events: none;
}
.star {
    position: absolute; background: white; border-radius: 50%;
    animation: twinkle 3s infinite ease-in-out;
}
@keyframes twinkle { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* --- LAYOUT UTAMA --- */
.app-container { max-width: 1200px; margin: 0 auto; padding: 20px; }

/* Header */
.main-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 30px; padding: 20px 0; border-bottom: 1px solid var(--glass-border);
}
.main-header h1 {
    font-size: 2rem; font-weight: 800;
    background: linear-gradient(to right, #ffd700, #ffffff);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.user-controls { display: flex; gap: 15px; align-items: center; }

/* Navigasi Tab */
.glass-nav {
    display: flex; justify-content: center; gap: 15px; margin-bottom: 30px;
    background: rgba(0, 0, 0, 0.2); padding: 8px; border-radius: 50px;
    width: fit-content; margin-left: auto; margin-right: auto;
    border: 1px solid var(--glass-border);
}
.nav-btn {
    background: transparent; border: none; color: var(--text-secondary);
    padding: 10px 25px; border-radius: 25px; cursor: pointer;
    font-weight: 600; transition: 0.3s; display: flex; align-items: center; gap: 8px;
}
.nav-btn:hover { color: white; background: rgba(255,255,255,0.1); }
.nav-btn.active {
    background: rgba(255, 215, 0, 0.15); color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

/* --- KARTU STATISTIK & DASHBOARD --- */
.stats-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px; margin-bottom: 30px;
}
.glass-card {
    background: var(--glass-bg); backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border); border-radius: 20px;
    padding: 24px; box-shadow: var(--shadow-light); transition: transform 0.3s;
}
.glass-card:hover { transform: translateY(-5px); border-color: rgba(255,255,255,0.2); }

.stat-info h3 { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 5px; }
.stat-number { font-size: 2rem; font-weight: 700; color: white; }

.dashboard-grid {
    display: grid; grid-template-columns: 1fr 1.5fr; gap: 24px;
}
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }

.card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid var(--glass-border);
}
.card-header h2 { font-size: 1.2rem; color: var(--accent-gold); }

/* --- LIST TUGAS --- */
.tasks-scroll-area { max-height: 500px; overflow-y: auto; padding-right: 5px; }

.task-item {
    background: rgba(255, 255, 255, 0.03); border: 1px solid var(--glass-border);
    border-radius: 12px; padding: 16px; margin-bottom: 12px;
    transition: 0.2s; cursor: pointer; position: relative;
    display: flex; justify-content: space-between; align-items: center;
}
.task-item:hover { background: rgba(255, 255, 255, 0.08); transform: translateX(5px); }

/* Warna Prioritas di Border Kiri */
.task-item.priority-high { border-left: 4px solid var(--prio-high); }
.task-item.priority-medium { border-left: 4px solid var(--prio-med); }
.task-item.priority-low { border-left: 4px solid var(--prio-low); }

.task-item.completed { opacity: 0.5; }
.task-item.completed .task-title { text-decoration: line-through; }

.task-title { font-weight: 600; font-size: 1.05rem; margin-bottom: 4px; }
.task-meta { font-size: 0.8rem; color: var(--text-secondary); display: flex; gap: 10px; }
.badge { padding: 4px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: bold; background: rgba(255,255,255,0.1); }

/* --- MODAL (POPUP) --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(8px);
    z-index: 1000; display: none; justify-content: center; align-items: center;
}
.modal-overlay.show { display: flex; animation: fadeIn 0.3s; }

.modal-glass {
    background: #151525; /* Solid dark base agar tulisan jelas */
    border: 1px solid var(--glass-border);
    width: 90%; max-width: 500px; padding: 30px; border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    position: relative; animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Header Modal & Close Button */
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid var(--glass-border);
}
.modal-header h2 { font-size: 1.5rem; color: white; }

.close-btn {
    background: rgba(255, 255, 255, 0.1); border: none; color: var(--text-secondary);
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; cursor: pointer; transition: 0.3s;
}
.close-btn:hover { background: var(--prio-high); color: white; transform: rotate(90deg); }

/* Form Elements */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 8px; color: var(--text-secondary); font-size: 0.9rem; }
input, select, textarea {
    width: 100%; padding: 12px 15px; background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border); border-radius: 12px;
    color: white; font-family: inherit; font-size: 1rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-gold); box-shadow: 0 0 10px rgba(255, 215, 0, 0.1); }

.btn-primary {
    width: 100%; padding: 14px; background: var(--secondary-gradient);
    color: white; border: none; border-radius: 12px; font-weight: 700;
    font-size: 1rem; cursor: pointer; transition: 0.3s; margin-top: 10px;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4); }

/* Detail Popup Styling */
.detail-item { margin-bottom: 15px; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 10px; }
.detail-label { display: block; font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 5px; }
.detail-value { font-size: 1.1rem; font-weight: 500; }
.status-actions { display: flex; gap: 10px; margin-top: 25px; }
.btn-action { flex: 1; padding: 12px; border: none; border-radius: 10px; font-weight: bold; cursor: pointer; color: #1a1a2e; }
.btn-complete { background: var(--prio-low); }
.btn-pending { background: var(--prio-med); }

/* Floating Button */
.fab-btn {
    position: fixed; bottom: 30px; right: 30px;
    width: 65px; height: 65px; border-radius: 50%;
    background: var(--secondary-gradient); color: white;
    border: none; font-size: 28px; cursor: pointer;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    transition: 0.3s; display: flex; align-items: center; justify-content: center;
}
.fab-btn:hover { transform: scale(1.1) rotate(90deg); }

/* Auth Pages */
.auth-wrapper { display: flex; justify-content: center; align-items: center; min-height: 80vh; }
.auth-card { width: 100%; max-width: 400px; text-align: center; }
.auth-switch { margin-top: 20px; font-size: 0.9rem; color: var(--text-secondary); }
.auth-switch a { color: var(--accent-gold); text-decoration: none; font-weight: bold; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
/* --- FIX: CALENDAR ICON VISIBILITY --- */
/* Membuat ikon kalender menjadi putih agar terlihat di background gelap */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* Memaksa browser menggunakan tema gelap untuk elemen input */
input[type="date"],
input[type="datetime-local"] {
    color-scheme: dark;
}

/* --- FIX: Z-INDEX MODAL --- */
/* Pastikan modal selalu di atas segalanya */
.modal-overlay {
    z-index: 9999 !important;
}

/* --- FIX: POSISI TOMBOL CLOSE --- */
.modal-header {
    position: relative; /* Penting untuk positioning */
}
.close-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    /* Reset style */
    background: rgba(255, 255, 255, 0.1);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    color: white;
}
.close-btn:hover {
    background: #ff4757;
    transform: translateY(-50%) rotate(90deg); /* Tetap di tengah vertikal saat hover */
}
/* --- NOTIFIKASI TOAST (NON-INTRUSIVE) --- */
.notification-overlay {
    position: fixed;
    top: 20px;
    right: 20px;
    width: auto;
    height: auto;
    background: transparent; /* Hapus background gelap */
    z-index: 10000;
    pointer-events: none; /* Klik tembus ke belakangnya */
    display: none; /* Default hidden */
}

.notification-overlay.show {
    display: flex;
    animation: slideInRight 0.3s ease-out forwards;
}

/* Kotak Pesannya */
.notification-box {
    background: rgba(15, 23, 42, 0.95); /* Warna gelap solid */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 5px solid #ffd700;
    padding: 15px 20px;
    border-radius: 8px;
    min-width: 300px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    pointer-events: auto; /* Kotaknya doang yang bisa diklik/disentuh */
    display: flex;
    align-items: center;
    gap: 15px;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}