/* Google Fonts: Plus Jakarta Sans & Amiri for Arabic */
@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --color-primary-50: #f0f7ff;
  --color-primary-100: #e0f2fe;
  --color-primary-200: #bae6fd;
  --color-primary-300: #7dd3fc;
  --color-primary-400: #38bdf8;
  --color-primary-500: #0284c7;
  --color-primary-600: #0369a1;
  --color-primary-700: #075985;
  --color-primary-800: #0c4a6e;
  --color-primary-900: #0f2942;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 85px;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1e293b;
  background-color: #f8fafc;
  overflow-x: hidden;
}

/* Precise scroll margin so sticky header does not block section titles */
section[id] {
  scroll-margin-top: 90px;
}

.font-arabic {
  font-family: 'Amiri', serif;
  line-height: 1.6 !important;
}

/* Custom Soft Glassmorphism */
.glass-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(224, 242, 254, 0.8);
}

.glass-nav {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(186, 230, 253, 0.4);
}

/* Light Blue Accent Glow */
.glow-effect {
  position: relative;
}
.glow-effect::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 20%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, rgba(255, 255, 255, 0) 70%);
  filter: blur(50px);
  z-index: -1;
  pointer-events: none;
}

/* Swiper Carousel Customization */
.swiper-button-next,
.swiper-button-prev {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  width: 34px !important;
  height: 34px !important;
  border-radius: 9999px;
  color: var(--color-primary-700) !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15);
  transition: all 0.25s ease;
  border: 1px solid rgba(186, 230, 253, 0.6);
}

.swiper-button-next:after,
.swiper-button-prev:after {
  font-size: 14px !important;
  font-weight: 800;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
  background: #ffffff;
  color: var(--color-primary-600) !important;
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.25);
}

.swiper-pagination-bullet {
  width: 10px;
  height: 10px;
  background: #94a3b8;
  opacity: 0.6;
  transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
  width: 26px;
  border-radius: 6px;
  background: var(--color-primary-600) !important;
  opacity: 1;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #bae6fd;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #7dd3fc;
}

/* ==========================================================
   PRINT STYLES FOR 1-PAGE A4 PORTRAIT PDF EXPORT
   ========================================================== */
@media screen {
  .print-sheet {
    display: none !important;
  }
}

@page {
  size: A4 portrait !important;
  margin: 5mm 7mm 4mm 7mm !important;
}

@media print {
  *, *::before, *::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
    box-sizing: border-box !important;
    -webkit-text-size-adjust: none !important;
    text-size-adjust: none !important;
  }

  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 8.2pt !important;
    line-height: 1.25 !important;
    -webkit-text-size-adjust: none !important;
    text-size-adjust: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* Hide regular web elements on print */
  header,
  main,
  footer,
  #authGate,
  #imageModal,
  #toast,
  .no-print {
    display: none !important;
  }

  /* Dedicated 1-page modern portrait print layout filling the page naturally without sparse gaps */
  .print-sheet {
    display: block !important;
    width: 100% !important;
    max-width: 190mm !important;
    margin: 0 auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    page-break-after: avoid !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  /* Ensure multi-column grids do NOT wrap into single column on mobile */
  .print-sheet .grid {
    display: grid !important;
  }

  .print-sheet .grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .print-sheet .grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  /* Prevent page breaks inside cards */
  .print-sheet > div,
  .print-sheet div {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
}

/* ==========================================================
   AUTHENTICATION & SECURITY GATE
   ========================================================== */
body.locked {
  overflow: hidden !important;
}

body.locked #authGate {
  display: flex !important;
}

body.locked #appContent {
  display: none !important;
}

/* Prevent printing when locked */
@media print {
  body.locked .print-sheet,
  body.locked header,
  body.locked main,
  body.locked footer,
  body.locked #appContent {
    display: none !important;
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.animate-shake {
  animation: shake 0.4s ease-in-out;
}
