/*
 * File: smooth-transitions.css
 * Deskripsi: Menyediakan transisi dan animasi yang profesional dan elegan untuk aplikasi web.
 * Author: dimas
 * Tanggal: 3 Agustus 2025
 */

/* ==========================================================================
   Variabel Kustom
   ========================================================================== */
:root {
    /* Palet Warna */
    --color-primary: #007bff;
    --color-secondary: #6c757d;
    --color-accent: #28a745;
    --color-text-light: #343a40;
    --color-background-light: #dfdbdb;
    --color-card-background-light: #ffffff;
    --color-border-light: rgba(0, 0, 0, 0.1);

    /* Efek Bayangan */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);

    /* Durasi & Kurva Transisi */
    --transition-duration: 0.3s;
    --transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Mode Gelap (Dark Mode)
   ========================================================================== */
.dark {
    --color-primary: #87ceeb;
    --color-secondary: #adb5bd;
    --color-accent: #20c997;
    --color-text-light: #e9ecef;
    --color-background-light: #161a1d;
    --color-card-background-light: #212529;
    --color-border-light: rgba(255, 255, 255, 0.1);

    --shadow-sm: 0 1px 3px rgba(255, 255, 255, 0.08);
    --shadow-md: 0 4px 12px rgba(255, 255, 255, 0.12);
    --shadow-lg: 0 8px 24px rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   Pengaturan Global
   ========================================================================== */
html, body {
    /* Menggunakan Flexbox untuk layout yang terkontrol */
    display: flex;
    flex-direction: column;
    height: 100vh;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--color-text-light);
    background-color: var(--color-background-light);
    transition: background-color var(--transition-duration) var(--transition-timing-function),
                color var(--transition-duration) var(--transition-timing-function);
    /* Solusi untuk menghilangkan scrollbar dari body */
    overflow: hidden;
}

.main-container {
    /* Memastikan container ini mengambil sisa ruang dan bisa di-scroll */
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
    transition: background-color var(--transition-duration) var(--transition-timing-function);
}

/* ==========================================================================
   Animasi Utama (Saat Halaman Dimuat)
   ========================================================================== */
@keyframes fadeInSlideUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideInFromTop {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Komponen UI
   ========================================================================== */

/* Header & Judul */
.header-section {
    animation: slideInFromTop 0.5s var(--transition-timing-function) forwards;
}

h2, #jenisCount {
    animation: fadeInScale 0.4s var(--transition-timing-function) forwards;
    animation-delay: 0.2s;
    opacity: 0;
    color: var(--color-primary);
}

/* Tabel */

tr {
    animation: fadeInSlideUp 0.5s var(--transition-timing-function) forwards;
    opacity: 0;
    background-color: var(--color-card-background-light);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-duration) var(--transition-timing-function),
                box-shadow var(--transition-duration) var(--transition-timing-function);
}

/* Penundaan animasi untuk setiap baris tabel */
tr:nth-child(2) { animation-delay: 0.05s; }
tr:nth-child(3) { animation-delay: 0.1s; }
tr:nth-child(4) { animation-delay: 0.15s; }
tr:nth-child(5) { animation-delay: 0.2s; }
tr:nth-child(6) { animation-delay: 0.25s; }
tr:nth-child(7) { animation-delay: 0.3s; }
tr:nth-child(8) { animation-delay: 0.35s; }
tr:nth-child(9) { animation-delay: 0.4s; }
tr:nth-child(10) { animation-delay: 0.5s; }
tr:nth-child(11) { animation-delay: 0.55s; }
tr:nth-child(12) { animation-delay: 0.6s; }
tr:nth-child(13) { animation-delay: 0.65s; }
tr:nth-child(14) { animation-delay: 0.7s; }
tr:nth-child(15) { animation-delay: 0.75s; }
tr:nth-child(16) { animation-delay: 0.8s; }
tr:nth-child(17) { animation-delay: 0.85s; }
tr:nth-child(18) { animation-delay: 0.9s; }
tr:nth-child(19) { animation-delay: 0.95s; }

tr:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* Modal */
.modal-content {
    animation: modalFadeIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    box-shadow: var(--shadow-lg);
}
