/* ==========================================================================
   Asian International Technologies Ltd. — Institutional Web Portal
   Client: Ministry of Information & Broadcasting (MoIB), Pakistan
   Project: Turnkey 8-Way NVIDIA H200 AI Supercomputer Quotation
   Styling: Mobile-First, High-Performance, Anti-Download Protected
   ========================================================================== */

:root {
  --bg-primary: #0A0E14;
  --bg-secondary: #121822;
  --bg-tertiary: #1A2230;
  --bg-card: #151D28;
  --brand-red: #D9251C;
  --brand-red-hover: #BA1C14;
  --brand-gold: #C7922C;
  --text-primary: #F7F3EC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(217, 37, 28, 0.35);
  --green-online: #10B981;
  --shadow-elevation: 0 20px 45px -10px rgba(0, 0, 0, 0.7), 0 0 1px 1px rgba(255, 255, 255, 0.06);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-touch-callout: none;
}

/* Background Subtle Mesh */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 50% 0%, rgba(217, 37, 28, 0.06) 0%, transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(199, 146, 44, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ================= Top Sticky Header ================= */
.app-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(18, 24, 34, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo-img {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.brand-title-group {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #FFFFFF;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-creed {
  font-size: 10px;
  color: var(--brand-gold);
  font-style: italic;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.security-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  color: #34D399;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background: #10B981;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.ref-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ================= Document Viewing Canvas ================= */
.main-viewport {
  position: relative;
  z-index: 10;
  padding: 20px 12px 100px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: calc(100vh - 60px);
}

/* Information Strip */
.document-meta-strip {
  width: 100%;
  max-width: 900px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--brand-red);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.meta-col h1 {
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 2px;
}

.meta-col p {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.meta-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-spec-drawer {
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-spec-drawer:hover {
  background: #222C3C;
  border-color: rgba(255, 255, 255, 0.2);
}

/* Document Stage & Pages */
.document-stage {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  transform-origin: top center;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.page-wrapper {
  position: relative;
  width: 100%;
  background: #FFFFFF;
  border-radius: 8px;
  box-shadow: var(--shadow-elevation);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.page-indicator-label {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 15;
  background: rgba(18, 28, 38, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-primary);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  pointer-events: none;
}

.page-image {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* The Invisible Glass Shield (Anti-Download Protection) */
.glass-shield {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.001);
  cursor: default;
  pointer-events: auto;
  -webkit-touch-callout: none;
}

/* Semi-transparent Forensic Watermark Overlay */
.watermark-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12;
  pointer-events: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding: 40px 0;
  opacity: 0.055;
  transform: rotate(-22deg) scale(1.3);
}

.watermark-line {
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 3px;
  color: #000000;
  text-transform: uppercase;
  user-select: none;
}

/* ================= Floating Control Bar (Mobile-Friendly) ================= */
.floating-control-dock {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  background: rgba(18, 24, 34, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 95vw;
}

.dock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dock-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
}

.dock-btn:active {
  transform: scale(0.92);
}

.dock-divider {
  width: 1px;
  height: 22px;
  background: var(--border-subtle);
}

.page-nav-badge {
  font-size: 12px;
  font-weight: 700;
  color: #FFFFFF;
  padding: 0 4px;
  min-width: 60px;
  text-align: center;
}

.zoom-level-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-gold);
  min-width: 44px;
  text-align: center;
}

.btn-contact-desk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-red);
  color: #FFFFFF;
  border: none;
  padding: 0 14px;
  height: 38px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.btn-contact-desk:hover {
  background: var(--brand-red-hover);
}

/* ================= Bottom Sheet / Quick Specs Drawer ================= */
.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.drawer-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.specs-drawer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 100%);
  width: 100%;
  max-width: 600px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.8);
  z-index: 210;
  padding: 20px;
  max-height: 85vh;
  overflow-y: auto;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-backdrop.active .specs-drawer {
  transform: translate(-50%, 0);
}

.drawer-handle {
  width: 44px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin: 0 auto 16px auto;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-title {
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
}

.drawer-subtitle {
  font-size: 12px;
  color: var(--brand-gold);
}

.drawer-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.specs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.spec-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 14px;
}

.spec-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 2px;
}

.spec-val {
  font-size: 13px;
  font-weight: 600;
  color: #FFFFFF;
}

.spec-val-highlight {
  color: var(--brand-red);
  font-size: 16px;
  font-weight: 700;
}

/* ================= Toast Notification (Anti-download warning) ================= */
.security-toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(217, 37, 28, 0.94);
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(217, 37, 28, 0.4);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 90vw;
  text-align: center;
}

.security-toast.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ================= Print Lockdown Rule ================= */
@media print {
  body * {
    display: none !important;
    visibility: hidden !important;
  }
  body {
    background: #FFFFFF !important;
  }
  body::after {
    content: "RESTRICTED INSTITUTIONAL PROPOSAL: Exporting, printing, or distribution of this document is prohibited under bilateral confidentiality agreements. Asian International Technologies Ltd. • Ref: AI-QTN-20261008-MOIB-H200-EXW";
    display: block !important;
    visibility: visible !important;
    padding: 80px 40px;
    font-size: 16pt;
    font-weight: bold;
    text-align: center;
    color: #D9251C;
    border: 3px solid #D9251C;
    margin: 50px auto;
    max-width: 600px;
  }
}

/* ================= Responsive Rules ================= */
@media (max-width: 768px) {
  .app-header {
    padding: 8px 12px;
  }
  .brand-logo-img {
    height: 28px;
  }
  .brand-creed {
    display: none;
  }
  .header-badges .ref-pill {
    display: none;
  }
  .document-meta-strip {
    flex-direction: column;
    align-items: flex-start;
  }
  .meta-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .main-viewport {
    padding: 12px 6px 90px 6px;
  }
  .floating-control-dock {
    bottom: 12px;
    padding: 4px 8px;
    gap: 4px;
  }
  .dock-btn {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }
  .btn-contact-desk {
    padding: 0 10px;
    font-size: 11px;
    height: 34px;
  }
}
