/* --- CSS VARIABLES & RESET --- */
:root {
    --primary-color: #0056b3; /* Biru Utama */
    --primary-dark: #004494;
    --primary-light: #e3f2fd;
    --accent-color: #0288d1;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --white: #ffffff;
    --bg-body: #f1f5f9;
    
    /* Status Colors */
    --success: #10b981; 
    --danger: #ef4444;  
    --info: #3b82f6;    
    --gray: #94a3b8;

    --border-radius: 8px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-dark);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- HEADER & NAVIGATION --- */
header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.container {
    width: 95%;
    max-width: 1300px;
    margin: 0 auto;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.brand i {
    color: var(--primary-light);
}

/* Clock Styling */
.clock-container {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(5px);
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-links button, .nav-links a {
    text-decoration: none;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: inline-block;
}

.nav-links button:hover, .nav-links a:hover, .nav-links button.active {
    background-color: var(--white);
    color: var(--primary-color);
    border-color: var(--white);
    font-weight: 600;
}

/* --- MAIN CONTENT AREAS --- */
main {
    flex: 1;
    padding: 2rem 0;
}

.view-section {
    display: none; /* Hidden by default */
    animation: fadeIn 0.4s ease-in-out;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    margin-bottom: 2rem;
    text-align: center;
}

.section-header h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-light);
}

/* --- LOGIN FORM --- */
.login-container {
    max-width: 400px;
    margin: 3rem auto;
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
}
.login-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* --- ADMIN DASHBOARD --- */
.admin-controls {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-danger {
    background-color: var(--danger);
    color: var(--white);
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn-edit {
    background-color: #f59e0b;
    color: var(--white);
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    margin-right: 5px;
}

/* --- TABLE STYLING (ADMIN) --- */
.table-responsive {
    overflow-x: auto;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px; /* Force scroll on small mobile */
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

th {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 600;
}

tr:hover {
    background-color: #f8fafc;
}

/* --- CARDS (PUBLIC VIEW) --- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s;
    border-top: 4px solid var(--primary-color);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
}

.card-header {
    padding: 1.5rem;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin: 0;
    padding-right: 10px;
}

.card-body {
    padding: 1.5rem;
    flex: 1;
}

.info-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.info-row i {
    color: var(--primary-color);
    width: 24px;
    margin-top: 4px;
}

.info-row span.date-text {
    display: block;
    font-weight: 600;
}

.info-row span.full-date {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 400;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fafafa;
}

/* --- DATE STATUS COLORS (Untuk Isian Tanggal) --- */
.date-past { color: var(--danger); } /* Merah */
.date-today { color: var(--success); } /* Hijau */
.date-future { color: var(--primary-color); } /* Biru */

/* --- STATUS BADGES (Untuk Hasil Akhir) --- */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Update Warna Sesuai Request */
.status-proses { background-color: #e2e8f0; color: #475569; } /* Abu-abu untuk Proses */

.status-menang { 
    background-color: #dbeafe; /* Biru Muda */
    color: #1e40af;    /* Biru Tua */
}

.status-lulus-pq { 
    background-color: #dcfce7; /* Hijau Muda */
    color: #166534;    /* Hijau Tua */
}

.status-kalah { 
    background-color: #fee2e2; /* Merah Muda */
    color: #991b1b;    /* Merah Tua */
}

.status-tidak-lulus-pq { 
    background-color: #fee2e2; /* Merah Muda */
    color: #991b1b;    /* Merah Tua */
}
/* Warna untuk Status Batal/Cancel */
.status-batal { 
    background-color: #f1f5f9; /* Abu-abu Muda */
    color: #475569;          /* Abu-abu Gelap */
    border: 1px solid #cbd5e1;
}
/* --- MODAL --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal.open {
    display: flex;
}

.modal-content {
    background-color: var(--white);
    width: 95%;
    max-width: 600px;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background-color: #f8fafc;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.btn-secondary {
    background-color: #e2e8f0;
    color: var(--text-dark);
}
.btn-secondary:hover { background-color: #cbd5e1; }

/* --- TOAST NOTIFICATION --- */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
}
.toast {
    background: var(--white);
    color: var(--text-dark);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-top: 10px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-left: 5px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.3s ease-out;
    min-width: 250px;
}
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* --- EMPTY STATE --- */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-light);
}
.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #cbd5e1;
}

/* Footer */
footer {
    background-color: var(--text-dark);
    color: #94a3b8;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: auto;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .nav-wrapper {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .clock-container {
        justify-content: center;
        margin-bottom: 0.5rem;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
    }
    .nav-links {
        justify-content: center;
    }
    .admin-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .admin-controls h3 { text-align: center; }
}
/* --- FLOATING CONTROL BUTTON --- */
.control-panel {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-control {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background-color: var(--primary-color);
    color: var(--white);
    font-size: 1.5rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-control:hover {
    transform: scale(1.1);
    background-color: var(--primary-dark);
}

.btn-control.active {
    background-color: var(--danger); /* Merah jika mode Stop */
}