/* ============================================================
   style.css — Catatan Wali Kelas | Premium Green-Gold Theme
   ============================================================ */

/* --- Google Fonts (via @import) --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* --- CSS Variables / Design Tokens --- */
:root {
    --hijau-tua:    #1B5E20;
    --hijau:        #2E7D32;
    --hijau-mid:    #388E3C;
    --hijau-muda:   #4CAF50;
    --emas-gelap:   #B8860B;
    --emas:         #DAA520;
    --emas-terang:  #FFD700;
    --kuning-pucat: #FFFDE7;
    --putih:        #FFFFFF;
    --teks-utama:   #1C2B1A;
    --teks-ringan:  #4E6B4A;
    --shadow-soft:  0 8px 32px rgba(0,0,0,0.18);
    --shadow-card:  0 20px 60px rgba(0,0,0,0.22), 0 0 0 1px rgba(218,165,32,0.12);
    --radius-lg:    20px;
    --radius-md:    12px;
    --radius-sm:    8px;
    --transition:   all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ======================
   1. GLOBAL / BODY
   ====================== */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    line-height: 1.6;
    color: var(--teks-utama);

    /* Animated Gradient Background — Hijau × Emas × Kuning */
    background: linear-gradient(
        135deg,
        #1B5E20  0%,
        #2E7D32  18%,
        #33691E  32%,
        #827717  48%,
        #B8860B  60%,
        #DAA520  74%,
        #FFD700  88%,
        #F9A825  100%
    );
    background-size: 400% 400%;
    animation: bgPulse 22s ease infinite;
}

@keyframes bgPulse {
    0%   { background-position: 0%   50%; }
    25%  { background-position: 50%  0%;  }
    50%  { background-position: 100% 50%; }
    75%  { background-position: 50%  100%;}
    100% { background-position: 0%   50%; }
}

/* ======================
   2. HEADER
   ====================== */
.header {
    background: rgba(10, 40, 10, 0.45);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1.5px solid rgba(255, 215, 0, 0.35);
    color: #fff;
    padding: 40px 24px 36px;
    text-align: center;
    box-shadow: 0 4px 24px rgba(0,0,0,0.25);
    position: relative;
    overflow: hidden;
}

/* Subtle glow bar at bottom of header */
.header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #FFD700, #DAA520, #FFD700, transparent);
}

.header h1 {
    margin: 0 0 6px;
    font-size: 2.2em;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.4), 0 0 40px rgba(255,215,0,0.2);
    background: linear-gradient(135deg, #FFD700, #FFFFFF, #DAA520);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    margin: 0;
    font-size: 1em;
    font-weight: 400;
    color: rgba(255,255,255,0.82);
    letter-spacing: 0.3px;
}

/* ======================
   3. MAIN CONTAINER
   ====================== */
.container {
    width: 93%;
    max-width: 1350px;
    margin: 32px auto 40px;
    padding: 36px 40px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(4px);
}

/* Section headings inside container */
.container > h2 {
    font-size: 1.15em;
    font-weight: 700;
    color: var(--hijau-tua);
    margin: 0 0 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(218,165,32,0.25);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ======================
   4. UTILITY BAR (Menu Alat Kerja)
   ====================== */
.utility-bar {
    background: linear-gradient(135deg, rgba(27,94,32,0.06) 0%, rgba(218,165,32,0.06) 100%);
    border: 1.5px solid rgba(218, 165, 32, 0.25);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-bottom: 28px;
    display: flex;
    align-items: stretch;
    gap: 0;
    flex-wrap: wrap;
}

/* Each group in the utility bar */
.utility-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 24px;
    flex: 1;
    min-width: 200px;
}

/* First group — no left padding */
.utility-group:first-child {
    padding-left: 0;
}

/* Last group — no right padding */
.utility-group:last-child {
    padding-right: 0;
}

/* Dividers between groups */
.utility-group + .utility-group {
    border-left: 1.5px solid rgba(218, 165, 32, 0.3);
}

/* Group label / title */
.utility-group-label {
    font-size: 0.7em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--emas-gelap);
    margin-bottom: 2px;
}

/* Group button row */
.utility-group-btns {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ======================
   5. BUTTONS
   ====================== */
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9em;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.1px;
}

.btn:active {
    transform: scale(0.97);
}

/* Download — Emas */
.btn-download {
    background: linear-gradient(135deg, #DAA520, #B8860B);
    color: #fff;
    box-shadow: 0 2px 8px rgba(184,134,11,0.3);
}
.btn-download:hover {
    background: linear-gradient(135deg, #FFD700, #DAA520);
    box-shadow: 0 4px 14px rgba(218,165,32,0.4);
    transform: translateY(-1px);
    color: #fff;
}

/* Upload — Hijau */
.btn-upload {
    background: linear-gradient(135deg, #2E7D32, #1B5E20);
    color: #fff;
    box-shadow: 0 2px 8px rgba(46,125,50,0.3);
}
.btn-upload:hover {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    box-shadow: 0 4px 14px rgba(76,175,80,0.35);
    transform: translateY(-1px);
}

/* Refresh Global — Kuning Emas */
.btn-refresh {
    background: linear-gradient(135deg, #FFD700, #F9A825);
    color: #1C2B1A;
    box-shadow: 0 2px 8px rgba(255,215,0,0.35);
    font-weight: 700;
}
.btn-refresh:hover {
    background: linear-gradient(135deg, #FFEE58, #FFD700);
    box-shadow: 0 4px 14px rgba(255,215,0,0.45);
    transform: translateY(-1px);
}

/* ======================
   6. ALERT / MESSAGE BOX
   ====================== */
.alert-message {
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(27,94,32,0.1), rgba(218,165,32,0.08));
    border: 1px solid rgba(46,125,50,0.3);
    border-left: 4px solid var(--hijau);
    color: #1B5E20;
    border-radius: var(--radius-sm);
    margin-bottom: 22px;
    font-weight: 500;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-message::before {
    content: '✅';
    font-size: 1.1em;
}

/* ======================
   7. DATA TABLE
   ====================== */
.section-title {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--hijau-tua);
    margin: 6px 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.data-table th,
.data-table td {
    border: 1px solid rgba(218, 165, 32, 0.15);
    padding: 13px 15px;
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    background: linear-gradient(135deg, #2E7D32, #1B5E20);
    color: #fff;
    font-weight: 700;
    font-size: 0.88em;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

/* Striped rows */
.data-table tbody tr:nth-child(even) td {
    background-color: rgba(255, 253, 231, 0.4);
}

.data-table tbody tr:hover td {
    background-color: rgba(255, 215, 0, 0.12) !important;
    transition: background-color 0.15s ease;
}

/* ======================
   8. CATATAN COLUMN
   ====================== */
/* ======================
   8. COLUMN WIDTHS
   ====================== */
.col-no     { width: 4%;  text-align: center; }
.col-nama   { width: 20%; font-weight: 500; }
.col-nilai  { width: 9%;  text-align: center; }
.col-catatan{ width: auto; }
.col-opsi   { width: 130px; text-align: center; white-space: nowrap; }

/* ======================
   8b. CATATAN COLUMN
   ====================== */
.col-catatan {
    font-size: 0.93em;
    line-height: 1.6;
    vertical-align: middle;
    padding: 13px 16px;
}

/* Legacy alias — keep for safety */
.catatan-kolom {
    font-size: 0.93em;
    line-height: 1.6;
    vertical-align: middle;
}

/* ======================
   8c. NOTE OPTIONS (Opsi column)
   ====================== */
.col-opsi {
    vertical-align: middle;
    padding: 10px 12px;
}

.note-options {
    display: flex;
    flex-direction: column;
    gap: 7px;
    align-items: stretch;
}

/* ======================
   8d. BADGE KATEGORI NILAI
   ====================== */
.badge-kategori {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-top: 2px;
}
.badge-a { background: #C8E6C9; color: #1B5E20; }
.badge-b { background: #FFF9C4; color: #827717; }
.badge-c { background: #FFF3E0; color: #E65100; }
.badge-d { background: #FFCCBC; color: #BF360C; }

/* --- Tombol Opsi Catatan --- */
.btn-opt {
    padding: 6px 13px;
    font-size: 0.8em;
    font-weight: 700;
    border-radius: 6px;
    border: 1.5px solid;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: var(--transition);
    outline: none;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-family: inherit;
}

.btn-opt-copy {
    background: #fff;
    color: #2E7D32;
    border-color: #2E7D32;
}
.btn-opt-copy:hover:not(:disabled) {
    background: #E8F5E9;
    box-shadow: 0 3px 8px rgba(46,125,50,0.18);
    transform: translateY(-1px);
}

.btn-opt-refresh {
    background: #fff;
    color: #B8860B;
    border-color: #DAA520;
}
.btn-opt-refresh:hover:not(:disabled) {
    background: #FFFDE7;
    box-shadow: 0 3px 8px rgba(218,165,32,0.22);
    transform: translateY(-1px);
}

.btn-opt:active:not(:disabled) {
    transform: scale(0.95);
    box-shadow: none;
}

.btn-opt:disabled {
    cursor: not-allowed;
    background: #F5F5F5;
    color: #BDBDBD;
    border-color: #E0E0E0;
    box-shadow: none;
}

/* ======================
   9. EMPTY STATE
   ====================== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #9E9E9E;
}
.empty-state .empty-icon {
    font-size: 3em;
    margin-bottom: 12px;
    display: block;
    opacity: 0.5;
}
.empty-state p {
    font-size: 1em;
    margin: 0;
}

/* ======================
   10. FOOTER
   ====================== */
.footer {
    text-align: center;
    padding: 22px 20px;
    margin-top: 10px;
    color: rgba(255,255,255,0.7);
    font-size: 0.85em;
    font-weight: 400;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
    letter-spacing: 0.2px;
}

/* ======================
   11. RESPONSIVE
   ====================== */
@media (max-width: 860px) {
    .header h1 { font-size: 1.6em; }
    .container  { width: 96%; padding: 24px 20px; }
    .utility-bar {
        flex-direction: column;
        gap: 20px;
    }
    .utility-group {
        padding: 0;
        border-left: none !important;
        border-top: 1.5px solid rgba(218,165,32,0.25);
        padding-top: 18px;
    }
    .utility-group:first-child {
        border-top: none;
        padding-top: 0;
    }
    /* Table: stack Opsi below on small screens */
    .col-opsi   { width: auto; }
    .note-options {
        flex-direction: row;
        justify-content: center;
    }
    .col-no, .col-nilai {
        font-size: 0.85em;
    }
}