/* بوابة الأمن والسلامة المدرسية - الثانوية 152 بنات */

:root {
  --color-primary: #13B6A7;
  --color-primary-dark: #0F9B8E;
  --color-primary-light: #CFEFEA;
  --color-success: #2DBA63;
  --color-info: #2C9FD6;
  --color-warning: #E0A50F;
  --color-danger: #DC2626;
  --color-text-dark: #1F3340;
  --color-text-secondary: #6D7D85;
  --color-bg-soft: #F7FBFC;
  --color-border: #E6EDF1;
}

html, body {
  font-family: 'Tajawal', 'Cairo', system-ui, -apple-system, sans-serif;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
}

.font-tajawal { font-family: 'Tajawal', 'Cairo', sans-serif; }
.font-cairo { font-family: 'Cairo', 'Tajawal', sans-serif; }

/* الأقسام والبطاقات */
.section-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 1.25rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(15, 32, 39, 0.04);
  transition: box-shadow .2s;
}
.section-card:hover {
  box-shadow: 0 6px 16px rgba(15, 32, 39, 0.06);
}

.item-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  padding: 1rem;
  transition: all .2s;
}
.item-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

/* تقدم */
.progress-bar {
  height: 10px;
  background: #F1F5F9;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar > div {
  height: 100%;
  border-radius: 999px;
  transition: width .6s ease;
}

/* badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.badge-success { background:#DCFCE7; color:#15803D; }
.badge-warning { background:#FEF3C7; color:#92400E; }
.badge-danger  { background:#FEE2E2; color:#B91C1C; }
.badge-info    { background:#DBEAFE; color:#1D4ED8; }
.badge-normal  { background:#E2E8F0; color:#475569; }
.badge-internal { background:#EDE9FE; color:#5B21B6; }

/* التبويبات في لوحة التحكم */
.admin-tab {
  color: #475569;
  background: transparent;
  transition: all .15s;
  white-space: nowrap;
}
.admin-tab:hover { background:#F1F5F9; }
.admin-tab.active {
  background: var(--color-primary);
  color: #fff;
}

/* الأزرار العامة */
.btn-primary {
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  padding: .55rem 1.1rem;
  border-radius: .75rem;
  transition: background .15s;
}
.btn-primary:hover { background: var(--color-primary-dark); }

.btn-secondary {
  background: #fff;
  color: #334155;
  border: 1px solid #E2E8F0;
  font-weight: 700;
  padding: .55rem 1.1rem;
  border-radius: .75rem;
  transition: background .15s;
}
.btn-secondary:hover { background:#F8FAFC; }

.btn-danger {
  background: #FEE2E2;
  color: #B91C1C;
  font-weight: 700;
  padding: .45rem .9rem;
  border-radius: .65rem;
  transition: background .15s;
}
.btn-danger:hover { background:#FECACA; }

.input-field {
  width: 100%;
  padding: .65rem .85rem;
  border-radius: .75rem;
  border: 1px solid #E2E8F0;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
}
.input-field:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(19, 182, 167, .15);
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin-bottom: .25rem;
}

/* Toasts */
.toast {
  background: #1F3340;
  color: #fff;
  padding: .65rem 1.2rem;
  border-radius: .65rem;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(0,0,0,.15);
  animation: slideUp .25s ease;
}
.toast.toast-success { background:#15803D; }
.toast.toast-error   { background:#B91C1C; }

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* الجدول البسيط */
.simple-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.simple-table th {
  background: #F8FAFC;
  text-align: right;
  padding: 10px;
  font-weight: 700;
  color: #475569;
  border-bottom: 1px solid var(--color-border);
}
.simple-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}
.simple-table tbody tr:hover { background: #F8FAFC; }

/* Drag handle */
.drag-handle {
  cursor: grab;
  color: #94A3B8;
}
.drag-handle:active { cursor: grabbing; }

/* أزرار أيقونية صغيرة (في رؤوس الأقسام والبنود) */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #94A3B8;
  background: transparent;
  transition: all .12s;
  flex-shrink: 0;
}
.icon-btn:hover {
  background: #F1F5F9;
  color: #475569;
}

.sortable-ghost {
  opacity: .4;
  background:#F1F5F9 !important;
}

/* الطباعة */
@media print {
  body { background: #fff !important; }
  .no-print, .print\\:hidden { display: none !important; }
  #report-content {
    box-shadow: none !important;
    border-radius: 0 !important;
    max-width: 100% !important;
  }
  .item-card, .section-card {
    box-shadow: none !important;
    border: 1px solid #CBD5E1 !important;
    break-inside: avoid;
  }
}

/* بطاقات قابلة للطي في إعدادات الموقع */
.settings-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  user-select: none;
}
.settings-block-header:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
}
.settings-block-header h3 {
  font-weight: 800;
  color: var(--color-text-dark);
  font-size: 15px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.settings-block-header p {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 2px;
}
.settings-block-body {
  background: #fff;
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 1rem 1rem;
  padding: 1.25rem;
  margin-top: -8px;
  margin-bottom: 1rem;
}
.settings-block-body.hidden {
  display: none;
}
.chevron {
  transition: transform .25s ease;
}
.chevron.open {
  transform: rotate(180deg);
}

/* مُنتقي الأيقونات */
.icon-pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 36px;
  border-radius: 8px;
  background: #F8FAFC;
  color: #64748B;
  border: 1px solid transparent;
  transition: all .12s;
  font-size: 14px;
}
.icon-pick:hover {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}
.icon-pick.selected {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary-dark);
  box-shadow: 0 0 0 2px rgba(19, 182, 167, .25);
}

/* صف عنصر في القائمة (شريط معلومات/روابط فوتر) */
.settings-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .65rem .85rem;
  background: #F8FAFC;
  border: 1px solid var(--color-border);
  border-radius: .75rem;
}
.settings-list-row:hover {
  background: #fff;
  border-color: var(--color-primary-light);
}

/* responsive */
@media (max-width: 640px) {
  .section-card { padding: 1rem; }
  .settings-block-header { padding: .85rem 1rem; }
  .settings-block-body { padding: 1rem; }
}

/* ===== دورة الذكاء الاصطناعي ===== */
@keyframes bounce-in {
  0% { transform: translateY(20px) scale(.9); opacity: 0; }
  60% { transform: translateY(-4px) scale(1.02); opacity: 1; }
  100% { transform: translateY(0) scale(1); }
}
.animate-bounce-in { animation: bounce-in .4s ease-out both; }

.prompt-text { font-family: 'Tajawal', sans-serif; }

/* طباعة الشهادة */
@media print {
  @page { size: A4 landscape; margin: 0; }
  body { background: #fff !important; }
  #cert-print-area { box-shadow: none !important; width: 100% !important; }
}
