/* * NUSANTARA SUPER APP - CUSTOM STYLES (FULL UPGRADE)
 * * Changelog:
 * 1) Frontend: No-Gap (Reset Brutal) & Typography (Prose) tetap ada.
 * 2) Console: Penambahan style khusus agar Tabel & Form RAPI (Anti-Berantakan).
 * 3) Mobile: Player memanjang (Portrait Mode) ala TikTok/Reels.
 */

/* =========================================================
   0. RESET BRUTAL (FRONTEND MOBILE FIX)
   Wajib agar tampilan mobile full screen tanpa celah.
========================================================= */
html {
  margin-top: 0 !important;
  padding-top: 0 !important;
  height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0 !important;
  padding: 0 !important;
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #f8fafc; /* Slate-50 */
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

/* Sembunyikan Admin Bar WordPress bawaan */
#wpadminbar {
  display: none !important;
}

/* =========================
   1. ALPINE.JS UTILITIES
========================= */
[x-cloak] {
  display: none !important;
}

/* =========================
   2. NATIVE APP FEEL (SCROLLBAR)
========================= */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* =========================
   3. PAYWALL / SMART LOCK
========================= */
.nsa-paywall-wrapper {
  position: relative;
  overflow: hidden;
}

.nsa-paywall-blur {
  filter: blur(4px);
  opacity: 0.6;
  pointer-events: none;
  user-select: none;
}

.nsa-paywall-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.9) 40%,
    rgba(255, 255, 255, 1) 100%
  );
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 2rem;
  z-index: 10;
}

/* =========================
   4. ANIMATIONS
========================= */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes zoomIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.animate-fade-in { animation: fadeIn 0.3s ease-out forwards; }
.animate-slide-up { animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-zoom-in { animation: zoomIn 0.2s ease-out forwards; }

/* =========================
   5. UTILITIES LAYOUT
========================= */
.nsa-table-container {
  overflow-x: auto;
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.pb-safe {
  padding-bottom: env(safe-area-inset-bottom);
}

.nsa-app-shell {
  width: 100%;
  height: 100%;
}

/* =========================
   6. FORM ELEMENTS GLOBAL
========================= */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Input Font Fix */
input, textarea, select {
  font-size: 14px !important; /* Diubah ke 14px agar pas di tabel console */
}
/* Khusus Mobile tetap 16px agar tidak zoom otomatis */
@media screen and (max-width: 768px) {
  input, textarea, select {
    font-size: 16px !important;
  }
}

/* =========================
   7. PRINT STYLES
========================= */
@media print {
  .no-print { display: none !important; }
  body { background-color: white; }
}

/* ==========================================================================
   8. ARTICLE TYPOGRAPHY RESTORE (FRONTEND)
   Agar tampilan berita (Single Post) rapi seperti di editor.
========================================================================== */
.prose {
    font-family: 'Inter', sans-serif;
    color: #334155;
    line-height: 1.8;
    font-size: 1.125rem;
}
.prose p { margin-bottom: 1.5em; }
.prose h1, .prose h2, .prose h3, .prose h4 {
    color: #0f172a;
    font-weight: 800;
    line-height: 1.3;
    margin-top: 2em;
    margin-bottom: 0.8em;
}
.prose h2 { font-size: 1.75em; border-bottom: 2px solid #f1f5f9; padding-bottom: 0.3em; }
.prose h3 { font-size: 1.5em; }
.prose ul, .prose ol { margin-bottom: 1.5em; padding-left: 1.5em; }
.prose ul { list-style-type: disc; }
.prose ol { list-style-type: decimal; }
.prose li { margin-bottom: 0.5em; }
.prose li::marker { color: #dc2626; font-weight: bold; }
.prose blockquote {
    font-style: italic; font-weight: 500; color: #1e293b;
    border-left: 4px solid #dc2626; background-color: #f8fafc;
    padding: 1.5em; margin: 2em 0; border-radius: 0 8px 8px 0;
}
.prose a { color: #dc2626; text-decoration: underline; font-weight: 600; text-underline-offset: 2px; }
.prose img, .prose iframe { margin: 2em auto; border-radius: 12px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); width: 100%; height: auto; }
.prose code { background-color: #f1f5f9; color: #dc2626; font-weight: 600; padding: 0.2em 0.4em; border-radius: 0.25rem; font-size: 0.875em; }


/* ==========================================================================
   9. CONSOLE / ADMIN FIX (TV STREAMING & DASHBOARD)
   Ini memperbaiki layout tabel yang berantakan di Console.
========================================================================== */

/* Wrapper Utama Console */
.nsa-console-box {
    background: #ffffff;
    border: 1px solid #e2e8f0; /* Slate 200 */
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-top: 24px;
}

/* Header & Tombol */
.nsa-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.nsa-btn-save {
    background-color: #dc2626 !important; /* Red 600 */
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 10px 24px !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.nsa-btn-save:hover { background-color: #b91c1c !important; }

/* Tabel Console yang Rapi */
.nsa-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.nsa-table th {
    background-color: #f8fafc; /* Slate 50 */
    color: #475569; /* Slate 600 */
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 700;
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.nsa-table td {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.nsa-table tr:last-child td { border-bottom: none; }
.nsa-table tr:hover { background-color: #f8fafc; }

/* Input Field di Console */
.nsa-input, .nsa-select {
    width: 100%;
    padding: 10px 12px !important;
    border: 1px solid #cbd5e1 !important; /* Slate 300 */
    border-radius: 6px !important;
    background-color: #fff !important;
    color: #1e293b !important;
    transition: all 0.2s;
}

.nsa-input:focus, .nsa-select:focus {
    border-color: #dc2626 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

/* Tombol Aksi Kecil */
.nsa-btn-add {
    width: 100%;
    padding: 12px;
    background-color: #f8fafc;
    border-top: 1px solid #e2e8f0;
    color: #475569;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.nsa-btn-add:hover { background-color: #f1f5f9; color: #dc2626; }

.nsa-remove {
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s;
}
.nsa-remove:hover { background-color: #fef2f2; }

/* =========================================================
   10. MOBILE PORTRAIT PLAYER FIX (TIKTOK STYLE)
   Membuat player memanjang vertikal saat di HP
========================================================= */
@media screen and (max-width: 768px) and (orientation: portrait) {
  
  .nsa-player-ratio {
    /* RUMUS TINGGI: (Tinggi / Lebar) * 100 
       - 16:9 (Default TV) = 56.25%
       - 9:16 (Full Portrait) = 177.77% 
       - 4:5 (Instagram Feed) = 125%
    */
    padding-top: 177.77% !important; /* Ubah jadi rasio 9:16 */
  }

  /* PENTING: PENGATURAN TAMPILAN VIDEO
     Pilih salah satu opsi di bawah (hapus tanda komentar/slash-bintang):
  */

  /* OPSI 1 (DEFAULT): Video Utuh (Ada Bar Hitam Atas-Bawah) */
  /* Cocok untuk TV Berita agar teks berjalan tidak terpotong */
  .nsa-video-layer, .nsa-iframe-layer {
      object-fit: contain !important;
      background-color: #000;
  }

  /* OPSI 2: Video Full Layar (Kiri-Kanan Terpotong/Zoom) */
  /* Cocok untuk konten hiburan/musik agar terlihat penuh */
  /* .nsa-video-layer, .nsa-iframe-layer {
      object-fit: cover !important;
  } 
  */
}