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

:root {
  --bg-dark:          #2d3e5a;   /* primary dark navy — hero, cover, section headers */
  --bg-dark-mid:      #3a4f6e;   /* mid navy — cards on dark pages, info boxes */
  --bg-dark-deep:     #1e2d42;   /* deepest navy — footer, overlays */
  --bg-light:         #f5e6d0;   /* warm peach — content page background */
  --bg-light-deep:    #ede0cc;   /* deeper peach — gradient bottom */
  --accent:           #c2714f;   /* copper orange — diamonds, labels, CTAs, dates */
  --accent-hover:     #d4835f;   /* lighter orange — hover states */
  --accent-sand:      #e8c5a0;   /* sand — secondary text on dark pages */
  --text-on-dark:     #f0f4ff;   /* near white — headings on dark */
  --text-on-light:    #2d3e5a;   /* navy — body text on peach pages */
  --text-muted-dark:  #a0b4cc;   /* muted on dark */
  --text-muted-light: #6b7f96;   /* muted on peach */
  --border-dark:      rgba(255,255,255,0.1);
  --border-light:     rgba(45,62,90,0.15);
  --radius-card:      12px;
  --radius-btn:       6px;
}

/* Add bottom padding to body to account for fixed bottom nav on mobile */
body {
  font-family: 'Tajawal', 'Segoe UI', system-ui, sans-serif;
  direction: rtl;
  text-align: right;
  background: linear-gradient(180deg, #f5e6d0 0%, #ede0cc 100%);
  background-attachment: fixed;
  color: #2d3e5a;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}

@media (max-width: 991.98px) {
  body {
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
  }
}

.dark-mode-page {
  background: #2d3e5a;
  color: #f0f4ff;
}

/* Typographic Scale */
.page-title, .cover-title {
  font-family: 'Tajawal', sans-serif;
  font-weight: 800;
  font-size: 28px;
}
@media (min-width: 768px) {
  .page-title, .cover-title { font-size: 36px; }
}

.section-heading {
  font-family: 'Tajawal', sans-serif;
  font-weight: 700;
  font-size: 18px;
}
@media (min-width: 768px) {
  .section-heading { font-size: 22px; }
}

.card-title {
  font-family: 'Tajawal', sans-serif;
  font-weight: 700;
  font-size: 16px;
}
@media (min-width: 768px) {
  .card-title { font-size: 18px; }
}

.body-text, p {
  font-family: 'Tajawal', sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.8;
}
@media (min-width: 768px) {
  .body-text, p { font-size: 16px; }
}

.label-text, .tag-text {
  font-family: 'Tajawal', sans-serif;
  font-weight: 500;
  font-size: 12px;
}
@media (min-width: 768px) {
  .label-text, .tag-text { font-size: 13px; }
}

.date-number {
  font-family: 'Tajawal', sans-serif;
  font-weight: 700;
  color: #c2714f;
}

.brand-calligraphic {
  font-family: 'Amiri', serif;
  font-weight: 700;
}

/* Diamond Motif */
.dm {
  display: inline-block;
  width: 10px; height: 10px;
  background: #c2714f;
  transform: rotate(45deg);
  flex-shrink: 0;
  margin-left: 8px;
}

.dm-dark {
  background: #2d3e5a;
}

.dm-lg {
  width: 20px; height: 20px;
  background: #c2714f;
  transform: rotate(45deg);
}

.photo-diamond {
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  aspect-ratio: 1;
  object-fit: cover;
  width: 100%;
}

/* Corner decorations container */
.corner-decorations {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  pointer-events: none;
  overflow: hidden;
}
.corner-decorations .dm-lg {
  position: absolute;
}
.corner-tl { top: 20px; left: 20px; }
.corner-tr { top: 20px; right: 20px; background: #2d3e5a; }
.corner-bl { bottom: 20px; left: 20px; background: #3a4f6e; }
.corner-br { bottom: 20px; right: 20px; }

/* Section Label Pill */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #c2714f;
  color: #ffffff;
  font-family: 'Tajawal', sans-serif;
  font-size: 18px;
  font-weight: 700;
  padding: 6px 20px 6px 28px;
  border-radius: 5px;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%);
  margin-bottom: 12px;
}
.section-label::before {
  content: '';
  width: 10px; height: 10px;
  background: #fff;
  transform: rotate(45deg);
  flex-shrink: 0;
}

/* Dark Info Box */
.info-box {
  background: #3a4f6e;
  border-radius: 12px;
  padding: 16px 18px;
  color: #f0f4ff;
  font-family: 'Tajawal', sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.8;
  text-align: center;
  margin: 12px 0;
}

/* Orange Box */
.orange-box {
  background: #c2714f;
  border-radius: 14px;
  padding: 18px 20px;
  color: #ffffff;
  font-family: 'Tajawal', sans-serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 2;
  text-align: center;
  position: relative;
  margin-top: 16px;
}
.orange-box::before {
  content: '';
  position: absolute;
  top: -12px;
  right: 50%;
  transform: translateX(50%);
  border: 8px solid transparent;
  border-bottom-color: #c2714f;
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 16px;
  margin: 14px 0;
}
.feature-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.feature-title {
  font-family: 'Tajawal', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #2d3e5a;
  text-align: right;
  line-height: 1.5;
  display: flex;
  align-items: center;
}
.feature-line {
  width: 60%;
  height: 2px;
  background: #c2714f;
  border-radius: 1px;
  align-self: flex-end;
}

/* Photo Diamond Grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin: 12px 0;
}
.photo-cell {
  aspect-ratio: 1;
  overflow: hidden;
  position: relative;
  clip-path: polygon(50% 3%, 97% 50%, 50% 97%, 3% 50%);
}
.photo-cell img {
  width: 100%; height: 100%; object-fit: cover;
}
.photo-num {
  position: absolute;
  top: 20%; left: 50%;
  transform: translate(-50%, -50%);
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #c2714f;
  color: #fff;
  font-family: 'Tajawal', sans-serif;
  font-weight: 700;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.grid-center-label {
  background: #c2714f;
  color: #fff;
  font-family: 'Tajawal', sans-serif;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px;
  clip-path: polygon(50% 3%, 97% 50%, 50% 97%, 3% 50%);
}

/* Cover Page Layout */
.session-row {
  display: flex;
  align-items: stretch;
  border-radius: 6px;
  overflow: hidden;
  margin: 14px 0 10px;
  justify-content: center;
}
.session-number {
  background: #c2714f;
  color: #fff;
  font-size: 48px;
  font-weight: 800;
  padding: 8px 18px;
  font-family: 'Tajawal', sans-serif;
}
.session-text {
  background: #3a4f6e;
  color: #f0f4ff;
  font-size: 24px;
  font-weight: 700;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  font-family: 'Tajawal', sans-serif;
}
.cover-year {
  color: #c2714f;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

/* Footer / Contact Bar */
.footer {
  background: #1e2d42;
  border-radius: 12px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 12px;
  align-items: start;
}
.footer-divider {
  background: rgba(255,255,255,0.12);
  height: 100%;
}
.footer-heading {
  font-family: 'Tajawal', sans-serif;
  font-size: 16px; font-weight: 700;
  color: #f0f4ff;
  text-decoration: underline;
  text-underline-offset: 4px;
  margin-bottom: 6px;
}
.footer-value {
  font-size: 14px; color: #e8c5a0; line-height: 1.6;
}
.footer-phone {
  font-size: 20px; font-weight: 800;
  color: #c2714f;
  direction: ltr;
  display: block; margin-top: 6px;
  font-family: 'Tajawal', sans-serif;
}
.footer-cta {
  display: inline-flex; align-items: center; gap: 4px;
  background: #c2714f; color: #fff;
  font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 6px;
  margin-top: 6px; cursor: pointer;
}

/* Body Text Block (On Peach Pages) */
.peach-body-text {
  font-family: 'Tajawal', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #2d3e5a;
  line-height: 1.85;
  text-align: right;
}
.orange-subtitle {
  font-size: 18px; font-weight: 800; color: #c2714f; text-align: center;
}

/* Label List Items (Bullet-Style, Peach Pages) */
.label-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.label-list-item .label-text {
  font-family: 'Tajawal', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: #2d3e5a;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; background: #1e2d42; }
::-webkit-scrollbar-thumb { background: #c2714f; border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: #d4835f; }

/* Global components overwrites */
.btn-primary, .btn-success, .btn-info, .btn-warning, .btn-danger, .btn-outline-primary, .btn-outline-success {
  background-color: #c2714f !important;
  border-color: #c2714f !important;
  color: #fff !important;
  font-family: 'Tajawal', sans-serif;
  min-height: 44px; /* Ensure tap targets are large enough on mobile */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-primary:hover, .btn-success:hover, .btn-info:hover, .btn-warning:hover, .btn-danger:hover {
  background-color: #d4835f !important;
  border-color: #d4835f !important;
}

.card {
  background-color: #f5e6d0; /* default peach */
  color: #2d3e5a;
  border-radius: 12px;
  border: none;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.dark-mode-page .card {
  background-color: #3a4f6e !important;
  color: #f0f4ff !important;
}

header {
  background: #2d3e5a;
  border-bottom: 2px solid #c2714f;
}
.navbar-brand, .navbar-brand span {
  font-family: 'Amiri', serif;
  color: #c2714f !important;
  font-weight: 700;
}
.nav-link {
  font-family: 'Tajawal', sans-serif;
  color: #f0f4ff !important;
}
.nav-link:hover {
  color: #c2714f !important;
}

.table {
  color: #2d3e5a;
  margin-bottom: 0;
}
.dark-mode-page .table {
  color: #f0f4ff;
}

/* Modern Dashboard Additions */
.action-card {
  background-color: #ffffff;
  color: var(--bg-dark);
  border-radius: var(--radius-card);
  border: 2px solid rgba(194, 113, 79, 0.1);
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px rgba(0,0,0,0.04);
}
.dark-mode-page .action-card {
  background-color: var(--bg-dark-mid);
  color: var(--text-on-dark);
  border-color: rgba(255,255,255,0.05);
}
.action-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(194, 113, 79, 0.15);
  border-color: var(--accent);
}
.action-card .card-title {
  color: var(--bg-dark);
}
.dark-mode-page .action-card .card-title {
  color: var(--text-on-dark);
}

.action-icon-wrapper {
  background: rgba(194, 113, 79, 0.15);
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); /* diamond shape */
  margin-bottom: 8px;
  transition: all 0.3s ease;
}
.action-card:hover .action-icon-wrapper {
  background: var(--accent);
}
.action-icon {
  color: var(--accent);
  font-size: 24px;
  transition: all 0.3s ease;
}
.action-card:hover .action-icon {
  color: #fff;
}

.btn-modern {
  background-color: var(--accent);
  color: #ffffff !important;
  border-radius: 50px;
  font-family: 'Tajawal', sans-serif;
  font-weight: 700;
  border: none;
  padding: 8px 24px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(194, 113, 79, 0.2);
}
.btn-modern:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(194, 113, 79, 0.3);
}

.text-accent {
  color: var(--accent) !important;
}

.custom-table-card {
  background-color: #ffffff !important;
  border-radius: var(--radius-card);
  overflow: hidden;
}
.dark-mode-page .custom-table-card {
  background-color: var(--bg-dark-mid) !important;
}

/* Navbar Logo Adjustments */
.navbar-logo {
  height: 60px;
  width: auto;
  object-fit: contain;
  transition: all 0.3s ease;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}
.navbar-logo:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 6px 12px rgba(194, 113, 79, 0.4));
}

/* --- MOBILE SPECIFIC ENHANCEMENTS --- */
@media (max-width: 767.98px) {
  /* Logo scaling */
  .navbar-logo {
    height: 45px; /* Prevent stretching the header on small screens */
  }

  /* Compact Action Cards */
  .action-card {
    padding: 12px !important;
  }
  .action-icon-wrapper {
    width: 48px;
    height: 48px;
    margin-bottom: 4px;
  }
  .action-icon {
    font-size: 18px;
  }
  .action-card .card-title {
    font-size: 13px !important;
    margin-top: 8px !important;
    margin-bottom: 12px !important;
  }
  .btn-modern {
    padding: 6px 12px;
    font-size: 12px;
  }

  /* Compact Stats Boxes */
  .info-box {
    padding: 12px !important;
  }
  .info-box i.fa-2x {
    font-size: 1.5em; /* Scale down the icon */
  }
  .info-box .display-6 {
    font-size: 24px;
  }

  /* Table Card spacing */
  .custom-table-card .card-header {
    padding: 16px 12px 0 !important;
  }
  .custom-table-card .card-body {
    padding: 12px !important;
  }

  /* Fix overall spacing */
  .main-content {
    margin-top: 60px !important;
    padding-top: 10px !important;
  }
}
