/* ===================================================================
   LUXURY & EXECUTIVE DESIGN SYSTEM - CV BUANA KEMBAR SEJAHTERA
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Anton&family=Cinzel:wght@700;800;900&family=Oswald:wght@600;700&family=Outfit:wght@500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --navy-deep: #060b16;
  --navy-card: #0b1528;
  --cyan-accent: #06b6d4;
  --sky-accent: #0284c7;
  --gold-accent: #f59e0b;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #f1f5f9;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background-color: var(--navy-deep);
}

/* Background Canvas */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: auto;
}

/* Atmospheric Ambient Glows */
.ambient-glow-1 {
  position: fixed;
  top: -15%;
  left: 15%;
  width: 55vw;
  height: 55vw;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.14) 0%, transparent 68%);
  border-radius: 50%;
  filter: blur(90px);
  z-index: 1;
  pointer-events: none;
}

.ambient-glow-2 {
  position: fixed;
  bottom: -20%;
  right: 10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.12) 0%, rgba(99, 102, 241, 0.05) 50%, transparent 70%);
  border-radius: 50%;
  filter: blur(100px);
  z-index: 1;
  pointer-events: none;
}

/* Luxury Glass Card */
.luxury-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.82) 0%, rgba(11, 20, 38, 0.88) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Item Card in Catalog */
.catalog-item-card {
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.catalog-item-card:hover {
  transform: translateY(-2px);
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 8px 25px -4px rgba(0, 0, 0, 0.4);
}

/* Selected Item Glowing State */
.catalog-item-card.is-selected {
  background: linear-gradient(135deg, rgba(8, 47, 73, 0.75) 0%, rgba(12, 74, 110, 0.5) 100%);
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 0 25px -5px rgba(14, 165, 233, 0.35), inset 0 1px 0 rgba(186, 230, 253, 0.3);
}

/* Mode Switcher Nav Tabs */
.mode-tab-btn {
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  color: #94a3b8;
}

.mode-tab-btn:hover {
  color: #ffffff;
}

.mode-tab-btn.active {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Category Filter Tabs */
.category-tab-btn {
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.category-tab-btn:hover {
  transform: translateY(-1px);
}

/* Tactile Numeric Steppers */
.stepper-btn {
  transition: all 0.15s ease;
}
.stepper-btn:active {
  transform: scale(0.92);
}

/* Realistic A4 Paper Mockup for Screen */
.a4-mockup {
  width: 210mm;
  min-height: 297mm;
  padding: 16mm 18mm 16mm 18mm;
  margin: 0 auto;
  background: #ffffff;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #1e293b;
  position: relative;
  box-sizing: border-box;
  font-size: 8.5pt;
  line-height: 1.45;
}

/* Formal Double Divider Line */
.kop-divider-double {
  border: 0;
  border-top: 3px solid #0f2b48;
  border-bottom: 1.5px solid #d4af37;
  height: 6px;
  margin: 8px 0 12px 0;
}

/* Golden Double Divider Line exactly as shown in user reference image */
.kop-divider-gold {
  border: 0;
  border-top: 3px solid #b8860b;
  border-bottom: 1.5px solid #b8860b;
  height: 6px;
  margin: 8px 0 12px 0;
}

/* Kop Banner Card Design (Navy Curve Left + Gold Right) */
.kop-card-banner {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  border: 1.5px solid #0b1c3e;
  background: linear-gradient(125deg, #fde047 0%, #facc15 48%, #eab308 88%, #d97706 100%);
  box-shadow: 0 3px 10px -2px rgba(11, 28, 62, 0.25);
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

.kop-card-title {
  font-family: 'Oswald', 'Anton', Impact, 'Arial Narrow', sans-serif;
  font-weight: 700;
  color: #fde047;
  -webkit-text-stroke: 3.4px #071124;
  paint-order: stroke fill;
  text-shadow: 1.5px 1.5px 0 #071124;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

.kop-card-line {
  font-family: 'Plus Jakarta Sans', 'Outfit', sans-serif;
  font-weight: 800;
  color: #ffffff;
  -webkit-text-stroke: 2.3px #071124;
  paint-order: stroke fill;
  text-shadow: 0.8px 0.8px 0 #071124;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

/* Official Digital Seal Stamp */
.stamp-official {
  position: absolute;
  bottom: 8px;
  right: 28px;
  width: 98px;
  height: 98px;
  border: 2px solid rgba(2, 132, 199, 0.85);
  border-radius: 50%;
  color: #0284c7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 6.5px;
  font-weight: 800;
  transform: rotate(-12deg);
  pointer-events: none;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.08) 0%, transparent 70%);
  box-shadow: inset 0 0 0 1px rgba(2, 132, 199, 0.5);
  z-index: 10;
}

.stamp-official img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  opacity: 0.85;
  margin-bottom: 1.5px;
}

.stamp-official .stamp-title {
  border-top: 1px solid #0284c7;
  border-bottom: 1px solid #0284c7;
  padding: 1px 4px;
  margin: 1px 0;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

/* Watermark Background for A4 Preview and Print */
.a4-watermark-bg {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  height: 320px;
  opacity: 0.045;
  pointer-events: none;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.a4-watermark-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #0284c7;
}

/* Header Wave Curve Decor */
.header-wave-decor {
  position: absolute;
  top: 0;
  right: 0;
  width: 220px;
  height: 90px;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

/* Strikethrough diagonal line */
.strike-diagonal {
  position: relative;
  display: inline-block;
}
.strike-diagonal::after {
  content: '';
  position: absolute;
  top: 48%;
  left: -5%;
  width: 110%;
  height: 2px;
  background-color: #0f172a;
  transform: rotate(-6deg);
}

/* Multi-page Print Layout */
.print-page {
  page-break-after: always;
  break-after: page;
  position: relative;
  background: #ffffff;
  color: #0f172a;
  box-sizing: border-box;
}

.print-page:last-child {
  page-break-after: auto;
  break-after: auto;
}

/* Hidden Print Container in Normal View */
#print-document {
  display: none;
}

/* ATURAN KERTAS A4 & MARGIN 0 (MENGHILANGKAN HEADER TANGGAL/JUDUL & FOOTER URL BROWSER) */
@page {
  size: A4 portrait;
  margin: 0;
}

/* PRINT MEDIA QUERY FOR CLEAN A4 EXPORT (HANYA DOKUMEN UTAMA, TANPA HEADER/FOOTER BROWSER & WEB) */
@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  html, body {
    width: 100% !important;
    min-height: 100% !important;
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  /* Sembunyikan seluruh UI web, header navbar, footer web, modal, canvas latar, dsb */
  body > *:not(#print-document) {
    display: none !important;
  }

  .no-print,
  #bg-canvas,
  .ambient-glow-1,
  .ambient-glow-2,
  header,
  footer,
  nav,
  #master-item-modal,
  #view-katalog,
  #view-database,
  #view-preview {
    display: none !important;
  }

  /* Tampilkan HANYA dokumen penawaran utama di tengah halaman A4 dengan margin yang bersih */
  #print-document {
    display: block !important;
    position: relative !important;
    width: 210mm !important;
    max-width: 210mm !important;
    min-height: 297mm !important;
    margin: 0 auto !important;
    padding: 12mm 15mm 12mm 15mm !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
    color: #0f172a !important;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  #print-document .doc-sheet-clean {
    width: 100% !important;
    background: #ffffff !important;
    color: #0f172a !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  table {
    border-collapse: collapse !important;
    width: 100% !important;
  }

  th {
    background-color: #162d4a !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .doc-sheet-clean,
  .doc-sheet-clean *,
  .kop-card-banner,
  .kop-card-title,
  .kop-card-line,
  .kop-card-banner * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .a4-editable {
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
  }
}

/* Inline Editable Fields on A4 Preview (hidden automatically on print) */
.a4-editable {
  cursor: text;
  border-radius: 3px;
  transition: background-color 0.15s ease, outline-color 0.15s ease;
}

.a4-editable:hover {
  outline: 1px dashed #38bdf8;
  background-color: rgba(240, 249, 255, 0.75);
}

.a4-editable:focus {
  outline: 1.5px solid #2b6cb0;
  background-color: #f0f9ff;
}

@media print {
  .a4-editable {
    outline: none !important;
    background: transparent !important;
  }
}
