/* ==========================================================================
   BANNER SLIDER MANAGEMENT CSS - SMKN 1 CIKAMPEK ADMIN
   Spesifik untuk Modul Pengelolaan Komponen Banner (banner.html)
   ========================================================================== */

/* 1. HIGHLIGHT ACTIVE MENU */
nav ul li a[href="banner.html"] {
    background-color: var(--sidebar-active) !important;
    color: var(--white) !important;
    font-weight: bold;
}

/* 2. MAIN HEADER BUTTONS & UTILITIES */
main#content button {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 10px 18px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

main#content button:hover {
    background-color: var(--primary-hover);
}

main#content button:active {
    transform: scale(0.98);
}

/* 3. Sleek Card Layout Form Container (#area-form) */
#area-form {
    background-color: var(--white) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--border-radius) !important;
    box-shadow: var(--box-shadow) !important;
    padding: 24px !important;
    max-width: 550px !important;
    margin-bottom: 30px !important;
    animation: slideDown 0.25s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

#area-form h3 {
    margin-top: 0;
    color: #0f172a;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

/* Form Input & Fields Styling */
#form-banner label {
    font-weight: 600;
    font-size: 0.88rem;
    color: #334155;
    margin-bottom: 6px;
    display: inline-block;
}

#form-banner input[type="text"],
#form-banner input[type="number"] {
    padding: 10px 14px !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--border-radius-sm) !important;
    font-size: 0.95rem !important;
    outline: none !important;
    background-color: #f8fafc !important;
    color: #0f172a !important;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

#form-banner input[type="text"]:focus,
#form-banner input[type="number"]:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
    background-color: var(--white) !important;
}

/* Aturan Khusus Urutan & Checkbox */
#form-banner input[type="number"] {
    text-align: center;
    font-weight: 600;
}

#form-banner label:has(input[type="checkbox"]) {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
}

#form-banner input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Tombol Aksi di Dalam Form */
#btn-simpan {
    background-color: var(--primary-color) !important;
}

#btn-simpan:hover {
    background-color: var(--primary-hover) !important;
}

#area-form button[type="button"] {
    background-color: #e2e8f0 !important;
    color: #475569 !important;
    margin-left: 8px;
}

#area-form button[type="button"]:hover {
    background-color: #cbd5e1 !important;
}

/* 4. MODERNIZED DATA TABLE DESIGN */
table {
    width: 100% !important;
    border-collapse: collapse !important;
    border: none !important;
    background-color: var(--white) !important;
    border-radius: var(--border-radius) !important;
    overflow: hidden !important;
    box-shadow: var(--box-shadow) !important;
    margin-top: 15px !important;
}

table th {
    background-color: #f8fafc !important;
    color: #475569 !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    font-size: 0.78rem !important;
    letter-spacing: 0.5px !important;
    padding: 14px 18px !important;
    border-bottom: 2px solid var(--border-color) !important;
}

table td {
    padding: 14px 18px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    color: var(--text-main) !important;
    font-size: 0.95rem !important;
    vertical-align: middle !important;
}

table tbody tr:hover {
    background-color: #f8fafc !important;
}

table tbody tr:last-child td {
    border-bottom: none !important;
}

/* Gambar Thumbnail Di Dalam Tabel */
.img-thumbnail {
    max-width: 120px;
    max-height: 70px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    padding: 2px;
    background-color: var(--white);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.img-thumbnail:hover {
    transform: scale(1.06);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Status Badges (Aktif / Non-Aktif) */
table td span[style*="color:green"] {
    background-color: #dcfce7 !important;
    color: #166534 !important;
    padding: 4px 12px !important;
    border-radius: 50px !important;
    font-size: 0.82rem !important;
    display: inline-block;
}

table td span[style*="color:red"] {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
    padding: 4px 12px !important;
    border-radius: 50px !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    display: inline-block;
}

/* Tombol Aksi di Dalam Baris Tabel */
table td button {
    padding: 6px 14px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    border-radius: var(--border-radius-sm) !important;
    border: 1px solid transparent !important;
}

table td button:nth-of-type(1) { /* Tombol Edit */
    background-color: #f0fdf4 !important;
    color: #166534 !important;
    border-color: #bbf7d0 !important;
    margin-right: 6px;
}

table td button:nth-of-type(1):hover {
    background-color: #dcfce7 !important;
}

table td button:nth-of-type(2) { /* Tombol Hapus */
    background-color: #fef2f2 !important;
    color: #991b1b !important;
    border-color: #fee2e2 !important;
}

table td button:nth-of-type(2):hover {
    background-color: #fee2e2 !important;
}

/* 5. MODERN ZOOM MODAL IMAGE OVERLAY */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(15, 23, 42, 0.85) !important; /* Backdrop gelap modern */
    backdrop-filter: blur(4px); /* Efek blur halus di belakang gambar */
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 80%;
    max-height: 80vh;
    border-radius: var(--border-radius) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
    animation: zoomEffect 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes zoomEffect {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f5f9 !important;
    font-size: 42px !important;
    font-weight: 300 !important;
    transition: color 0.2s, transform 0.2s;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #94a3b8 !important;
    transform: rotate(90deg);
}

/* ==========================================================================
   RESPONSIVE — MOBILE & TABLET
   Breakpoints: ≤768px (tablet), ≤480px (mobile)
   ========================================================================== */

/* ── TABLET (≤768px) ──────────────────────────────────────────────────────── */
@media (max-width: 768px) {

  /* Form container — full width, kurangi padding */
  #area-form {
    max-width: 100% !important;
    padding: 18px !important;
    margin-bottom: 20px !important;
  }

  #area-form h3 {
    font-size: 1.05rem;
    margin-bottom: 16px;
  }

  /* Tombol utama header — full width */
  main#content > button,
  main#content > div > button {
    width: 100%;
    justify-content: center;
    margin-bottom: 8px;
  }

  /* Form buttons row — stack jika perlu */
  #area-form > div[style*="display:flex"],
  #area-form > div[style*="display: flex"] {
    flex-wrap: wrap;
    gap: 8px;
  }

  #btn-simpan,
  #area-form button[type="button"] {
    flex: 1 1 auto;
    margin-left: 0 !important;
    min-width: 100px;
    text-align: center;
  }

  /* ── TABLE: scroll horizontal pada layar kecil ── */
  .table-responsive-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
  }

  /* Jika wrapper belum ada di HTML, paksa table scroll sendiri */
  table {
    min-width: 620px !important; /* paksa scroll horizontal */
    box-shadow: none !important; /* shadow sudah di wrapper */
    border-radius: 0 !important;
    margin-top: 0 !important;
  }

  table th {
    padding: 11px 12px !important;
    font-size: 0.72rem !important;
    white-space: nowrap;
  }

  table td {
    padding: 11px 12px !important;
    font-size: 0.88rem !important;
  }

  /* Thumbnail lebih kecil */
  .img-thumbnail {
    max-width: 80px;
    max-height: 50px;
  }

  /* Tombol aksi di baris tabel — lebih compact */
  table td button {
    padding: 5px 10px !important;
    font-size: 0.78rem !important;
  }

  /* Modal image — lebih besar di tablet */
  .modal-content {
    max-width: 92% !important;
    max-height: 75vh;
  }

  .close {
    top: 14px;
    right: 20px;
    font-size: 36px !important;
  }
}

/* ── MOBILE (≤480px) ──────────────────────────────────────────────────────── */
@media (max-width: 480px) {

  /* Form container */
  #area-form {
    padding: 14px !important;
    border-radius: 10px !important;
  }

  #area-form h3 {
    font-size: 1rem;
    margin-bottom: 14px;
    padding-bottom: 10px;
  }

  /* Form labels & inputs */
  #form-banner label {
    font-size: 0.83rem;
  }

  #form-banner input[type="text"],
  #form-banner input[type="number"] {
    padding: 9px 12px !important;
    font-size: 0.9rem !important;
  }

  /* Checkbox label — text kecil */
  #form-banner label:has(input[type="checkbox"]) {
    font-size: 0.85rem;
  }

  /* Tombol form — full width stack */
  #btn-simpan,
  #area-form button[type="button"] {
    width: 100%;
    margin-left: 0 !important;
    margin-top: 6px;
    padding: 10px 14px;
    font-size: 0.88rem;
  }

  /* Table min-width lebih sempit biar tidak scroll terlalu jauh */
  table {
    min-width: 520px !important;
  }

  table th {
    padding: 10px 10px !important;
    font-size: 0.68rem !important;
    letter-spacing: 0.3px !important;
  }

  table td {
    padding: 10px 10px !important;
    font-size: 0.82rem !important;
  }

  /* Thumbnail lebih kecil lagi */
  .img-thumbnail {
    max-width: 60px;
    max-height: 40px;
    border-radius: 4px;
  }

  /* Tombol aksi tabel — sangat compact */
  table td button {
    padding: 4px 8px !important;
    font-size: 0.75rem !important;
    margin-right: 4px;
  }

  /* Badge status */
  table td span[style*="color:green"],
  table td span[style*="color:red"] {
    padding: 3px 8px !important;
    font-size: 0.75rem !important;
  }

  /* Modal full screen di mobile */
  .modal {
    padding-top: 40px;
  }

  .modal-content {
    max-width: 96% !important;
    max-height: 70vh;
    border-radius: 10px !important;
  }

  .close {
    top: 10px;
    right: 14px;
    font-size: 30px !important;
  }
}

/* ── UTILITY: Wrapper scrollable untuk table (tambahkan di HTML) ───────────
   Pakai dengan membungkus <table> dengan:
   <div class="table-scroll-wrap"> ... </table> </div>
   ─────────────────────────────────────────────────────────────────────────── */
.table-scroll-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin-top: 15px;
}

/* Jika table ada di dalam .table-scroll-wrap, reset shadow & margin tabel */
.table-scroll-wrap table {
  margin-top: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}