/* ==========================================================================
   منصة «تقاريري» المدرسية - أكاديمية مها للتقارير والخدمات الرقمية
   Taqariri - Maha Academy for Reports & Educational Services
   متجر: https://maha-alharthi.com/ | جوال: 0502191512
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --font-arabic: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --theme-shadow: rgba(37, 99, 235, 0.25);
}

* {
  font-family: var(--font-arabic);
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

body {
  direction: rtl;
  text-align: right;
  background-color: #f8fafc;
  color: #1e293b;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.dark ::-webkit-scrollbar-track {
  background: #0f172a;
}
.dark ::-webkit-scrollbar-thumb {
  background: #334155;
}

/* Card hover animation */
.card-hover {
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px -6px rgba(0, 0, 0, 0.09), 0 8px 12px -6px rgba(0, 0, 0, 0.04);
}

/* Bottom Safe Area for Mobile Navigation */
.pb-safe-bottom {
  padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
}

/* Mobile drawer animation */
.drawer-backdrop {
  transition: opacity 0.3s ease-in-out;
}

.drawer-panel {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Line clamp */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Modal Animations */
@keyframes modalScaleIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-animate-in {
  animation: modalScaleIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* AI Assistant Pulsing Badge */
.ai-badge {
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
  color: white;
  transition: all 0.2s ease;
}

.ai-badge:hover {
  transform: scale(1.04);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

/* Gallery image thumbnail */
.gallery-thumbnail-card {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.gallery-thumbnail-card:hover .gallery-overlay {
  opacity: 1;
}

.gallery-overlay {
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

/* ==========================================================================
   تنسيقات الطباعة الرسمية المعتمدة للتقارير المدرسية السعودية (Official Print)
   ========================================================================== */
#print-container {
  display: none;
}

@media print {
  /* إخفاء عناصر الموقع التفاعلية */
  body > *:not(#print-container) {
    display: none !important;
  }

  body {
    background-color: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt;
    margin: 0 !important;
    padding: 0 !important;
    direction: rtl !important;
  }

  #print-container {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 1.2cm 1.5cm !important;
    background: #ffffff !important;
  }

  .print-page {
    page-break-after: always;
    page-break-inside: avoid;
    border: 2px solid #1e293b;
    border-radius: 8px;
    padding: 20px;
    position: relative;
  }

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

  .print-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 12px;
    margin-bottom: 16px;
  }

  .print-header-side {
    width: 32%;
    font-size: 9.5pt;
    line-height: 1.5;
  }

  .print-header-center {
    width: 36%;
    text-align: center;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 14px;
  }

  .print-table th,
  .print-table td {
    border: 1px solid #94a3b8;
    padding: 7px 10px;
    font-size: 10pt;
    text-align: right;
  }

  .print-table th {
    background-color: #f1f5f9 !important;
    font-weight: 700;
    color: #0f172a;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-section-title {
    font-size: 11pt;
    font-weight: 800;
    color: #1e3a8a;
    border-bottom: 1.5px solid #cbd5e1;
    padding-bottom: 4px;
    margin: 14px 0 8px 0;
  }

  .print-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 14px 0;
  }

  .print-gallery img {
    width: 100%;
    height: 175px;
    object-fit: cover;
    border: 1px solid #64748b;
    border-radius: 6px;
  }

  .print-signatures {
    display: flex;
    justify-content: space-between;
    margin-top: 35px;
    padding-top: 15px;
    page-break-inside: avoid;
  }

  .print-signature-box {
    text-align: center;
    width: 30%;
  }

  .print-signature-line {
    margin-top: 40px;
    border-top: 1px dashed #64748b;
  }

  .print-footer-tag {
    position: absolute;
    bottom: 8px;
    left: 20px;
    font-size: 8pt;
    color: #94a3b8;
  }
}
