/* =========================================================
   STYLES.CSS - TEMA PANTAI & BIOLUMINESCENCE GLOW
   ========================================================= */

/* --- VARIABEL WARNA (LIGHT MODE - TEMA PANTAI SIANG) --- */
:root {
    /* Opasitas diturunkan agar latar belakang pantai lebih terlihat nyata */
    --card-bg: rgba(255, 255, 255, 0.75); 
    --text-main: #004d40;
    --text-muted: #00796b;
    --border-color: rgba(128, 203, 196, 0.6);
    --input-bg: rgba(241, 248, 233, 0.85);
    
    /* Warna Glow & Aksen */
    --glow-primary: #00bcd4; 
    --glow-shadow: 0 0 8px rgba(0, 188, 212, 0.6);
    --glow-hover: 0 0 15px rgba(0, 188, 212, 0.9);
    
    --btn-edit: #26a69a;
    --btn-delete: #ff7043;
    
    --nav-bg: rgba(255, 255, 255, 0.85);
    --footer-bg: rgba(178, 223, 219, 0.85);
    
    --overlay-bg: rgba(224, 242, 241, 0.4); /* Overlay transparan agar pantai sangat jelas */
}

/* --- VARIABEL WARNA (DARK MODE - TEMA PANTAI MALAM BIOLUMINESENSI) --- */
[data-theme="dark"] {
    /* Opasitas diturunkan */
    --card-bg: rgba(28, 37, 65, 0.75);
    --text-main: #e0fbfc;
    --text-muted: #98c1d9;
    --border-color: rgba(58, 80, 107, 0.6);
    --input-bg: rgba(17, 24, 39, 0.85);
    
    /* Warna Glow & Aksen (Neon Bioluminescence) */
    --glow-primary: #00f2fe;
    --glow-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
    --glow-hover: 0 0 18px rgba(0, 242, 254, 0.9);
    
    --btn-edit: #00e5ff;
    --btn-delete: #ff5252;
    
    --nav-bg: rgba(28, 37, 65, 0.85);
    --footer-bg: rgba(11, 19, 43, 0.85);
    
    --overlay-bg: rgba(11, 19, 43, 0.5); /* Overlay transparan malam */
}

/* --- GLOBAL RESET & TYPOGRAPHY --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

body {
    /* Background Pantai Kualitas Tinggi */
    background-image: url('https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.3; 
    font-size: 14px;
    padding-bottom: 110px; 
}

/* Overlay agar background tetap jelas namun text tetap terbaca */
.bg-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--overlay-bg);
    z-index: -1;
    backdrop-filter: blur(1px); /* Blur diperkecil agar gambar jelas */
}

.app-container {
    max-width: 950px; 
    margin: 0 auto;
    padding: 15px;
    position: relative;
    min-height: 100vh;
}

/* --- EFEK GLOW UMUM --- */
.glow-border {
    border: 1px solid var(--glow-primary);
    box-shadow: var(--glow-shadow);
}

.glow-effect:hover {
    box-shadow: var(--glow-hover);
}

/* --- EFEK SHIMMERING PUTIH (JUDUL & LOGO) --- */
/* (Nama class tetap dipertahankan shimmer-gold agar tidak perlu edit index.html) */
.shimmer-gold {
    background: linear-gradient(90deg, var(--glow-primary) 0%, #FFFFFF 50%, var(--glow-primary) 100%);
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    /* Kata 'reverse' dihapus agar pergerakan kembali dari Kiri ke Kanan */
    animation: shimmerEffect 3s linear infinite;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Override ikon dalam shimmer agar warnanya ikut transparan dan terpengaruh gradient */
.shimmer-gold .logo-icon {
    color: inherit;
    text-shadow: none; 
    font-size: 28px; /* Memperbesar icon logo selaras dengan text */
}

@keyframes shimmerEffect {
    to {
        background-position: -200% center;
    }
}


/* --- HEADER & PENCARIAN --- */
.glow-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0 12px 0; 
    margin-bottom: 15px;
    position: relative;
    border-bottom: 1px solid var(--glow-primary);
    box-shadow: 0 4px 6px -6px var(--glow-primary);
}

h1 {
    font-size: 24px; /* DIUBAH: Font lebih besar agar jelas terbaca */
    font-weight: 800; /* DIUBAH: Font lebih tebal (Extra Bold) */
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

/* Wrapper Search */
.search-wrapper {
    position: absolute;
    right: 45px; /* Berada di sebelah tombol toggle tema */
    width: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.search-wrapper.active {
    width: calc(100vw - 80px); /* Memanjang menutupi judul & tombol search */
    max-width: 700px;
    opacity: 1;
}

#searchInput {
    width: 100%;
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid #FFFFFF; /* Garis pencarian ikut putih menyesuaikan tema */
    background-color: var(--card-bg);
    color: var(--text-main);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    outline: none;
    font-size: 13px;
    font-weight: 500;
}

.title-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Class tambahan untuk menghilangkan tombol search secara instan saat diklik */
.hide-element {
    display: none !important;
}

.icon-btn {
    background: var(--card-bg);
    border: 1px solid var(--glow-primary);
    color: var(--glow-primary);
    font-size: 14px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    outline: none;
    z-index: 11; 
}


/* --- TAB KONTEN --- */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- KARTU (CARD) --- */
.card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    backdrop-filter: blur(8px); /* Efek blur kaca (Glassmorphism) */
}

.table-card {
    padding: 5px; 
}


/* --- FORM STYLES --- */
form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px; 
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: span 2;
}

label {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-muted);
}

.glow-input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--input-bg);
    color: var(--text-main);
    font-size: 13px;
    outline: none;
    transition: all 0.3s ease;
}

.glow-input:focus {
    border-color: var(--glow-primary);
    box-shadow: var(--glow-shadow);
}

textarea.glow-input {
    resize: vertical;
    min-height: 50px;
}

button.submit-btn {
    grid-column: span 2;
    background-color: transparent;
    color: var(--glow-primary);
    border: 1px solid var(--glow-primary);
    box-shadow: var(--glow-shadow);
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

button.submit-btn:hover {
    background-color: var(--glow-primary);
    color: #fff;
    box-shadow: var(--glow-hover);
}


/* --- TABEL KHUSUS --- */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

/* Format Rata Tengah dan No-Wrap pada Seluruh Tabel */
.center-table th, .center-table td {
    text-align: center;
    vertical-align: middle; /* Memastikan semuanya sejajar lurus secara vertikal */
}

.nowrap-table th, .nowrap-table td {
    white-space: nowrap;
}

/* Garis Pemisah Glow untuk Tabel */
.glow-table th, .glow-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    font-size: 13px;
}

.glow-table th:last-child, .glow-table td:last-child {
    border-right: none;
}

th {
    background-color: rgba(0, 188, 212, 0.2);
    font-weight: 700;
    color: var(--glow-primary);
    text-shadow: 0 0 3px rgba(0, 188, 212, 0.3);
}

.nota-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid var(--glow-primary);
    box-shadow: 0 0 5px rgba(0,188,212,0.3);
}

.nota-thumb:hover {
    transform: scale(1.15);
}

/* Tombol Aksi - Rata Vertikal Sempurna (FIXED) */
.action-btns {
    text-align: center;
    vertical-align: middle;
    white-space: nowrap; /* Mencegah tombol turun ke baris baru */
}

.action-btns button {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    margin: 0 6px; /* Sebagai pengganti properti 'gap' sebelumnya */
    transition: transform 0.2s, text-shadow 0.2s;
    display: inline-flex; 
    align-items: center;
    justify-content: center;
}

.btn-edit { color: var(--btn-edit); }
.btn-delete { color: var(--btn-delete); }

.btn-edit:hover { 
    transform: scale(1.2);
    text-shadow: 0 0 8px var(--btn-edit); 
}
.btn-delete:hover { 
    transform: scale(1.2);
    text-shadow: 0 0 8px var(--btn-delete); 
}


/* --- NAVIGASI BAWAH --- */
.bottom-nav {
    position: fixed;
    bottom: 30px; 
    left: 0;
    width: 100%;
    background-color: var(--nav-bg);
    border-top: 1px solid var(--glow-primary);
    box-shadow: 0 -2px 10px rgba(0, 188, 212, 0.2);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 50;
    backdrop-filter: blur(5px);
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    flex: 1;
    font-weight: 600;
}

.nav-item i {
    font-size: 18px;
}

.nav-item.active, .nav-item:hover {
    color: var(--glow-primary);
    text-shadow: 0 0 8px rgba(0,188,212,0.6);
}


/* --- FOOTER --- */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background-color: var(--footer-bg);
    color: var(--text-muted);
    text-align: center;
    font-size: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 49;
    backdrop-filter: blur(5px);
}


/* --- MODAL IMAGE PREVIEW --- */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0; top: 0; width: 100%; height: 100%; 
    background-color: rgba(0,0,0,0.85); 
    backdrop-filter: blur(5px);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 85vh;
    border-radius: 8px;
    margin-top: 40px;
    box-shadow: var(--glow-shadow);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 25px;
    color: var(--glow-primary);
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    text-shadow: var(--glow-shadow);
}


/* --- CUSTOM POPUP (ALERT & CONFIRM) --- */
.custom-popup-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.custom-popup-overlay.show {
    display: flex;
}

.custom-popup-box {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    width: 300px;
    text-align: center;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.custom-popup-box h3 {
    margin-bottom: 10px;
    color: var(--glow-primary);
    font-size: 16px;
}

.custom-popup-box p {
    font-size: 13px;
    margin-bottom: 20px;
    color: var(--text-main);
}

.popup-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.popup-actions button {
    padding: 8px 20px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
}

.btn-cancel {
    border-color: var(--btn-delete) !important;
    color: var(--btn-delete) !important;
}

.btn-cancel:hover { background: var(--btn-delete); color: #fff !important; }

.btn-ok {
    border-color: var(--glow-primary) !important;
    color: var(--glow-primary) !important;
}

.btn-ok:hover { background: var(--glow-primary); color: #fff !important; }


/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    form { grid-template-columns: 1fr; }
    .form-group.full-width { grid-column: span 1; }
    button.submit-btn { grid-column: span 1; }
    .search-wrapper.active { width: calc(100vw - 60px); right: 40px; }
}