/* =====================================================
   IMAGE GALLERY SECTION
===================================================== */
/* ---------- Layout & Base Styles ---------- */
.image-gallery {
  direction: ltr;
  display: flex;
  gap: 20px;
  justify-content: center;
  max-width: 900px;
  margin: 15px auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
  margin-bottom: 0;
}
.image-gallery::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari */
}
.gallery-item {
  border: 1px solid #ddd;
  border-radius: 1rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  /* image zoom ko box ke andar rakhega */
  max-width: 280px;
  /* desktop ke liye */
}
.gallery-item img {
  width: 100%;
  height: auto;
  /* 🔹 Stretching fix */
  display: block;
  /* 🔹 Inline gap remove */
  border-radius: 1rem;
  transition: transform 0.4s ease;
  cursor: pointer;
  will-change: transform;
}
.gallery-item img:hover {
  transform: scale(1.05);
  /* Sirf image zoom hogi */
}
/* ---------- Popup Modal ---------- */
.popup-modal {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0,0,0,0.9);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 1000;
  padding-top: 40px;
}
.popup-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.popup-content {
  max-width: 90%;
  max-height: 80vh;
  border-radius: 1rem;
  object-fit: contain;
  box-shadow: var(--shadow);
}
/* Close Button */
.popup-modal .close {
  position: absolute;
  top: -40px;
  right: 40px;
  font-size: 28px;
  background-color: rgba(0, 0, 0, 0.6);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  border: none;
  cursor: pointer;
}
/* Navigation buttons */
.popup-modal .prev,
.popup-modal .next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 35px;
  height: 35px;
  border-radius: 50%;
  border: none;
  font-size: 20px;
  font-weight: bold;
  color: var(--white);
  background: rgba(0,0,0,0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  transition: background 0.3s ease;
}
.popup-modal .prev:hover,
.popup-modal .next:hover {
  background: rgba(0,0,0,0.7);
}
.popup-modal .prev {
  left: 7%;
}
.popup-modal .next {
  right: 7%;
}
#popupCaption {
  text-align: center;
  color: var(--white);
  margin-top: 15px;
  font-size: 16px;
}
@media (max-width: 768px) {
  .image-gallery {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
  }
  .gallery-item {
    flex: 0 0 100%;
    /* 🔹 Pure width le mobile pe */
    max-width: none;
    /* 🔹 Desktop ka 280px restriction hata diya */
    scroll-snap-align: center;
    display: flex;
    justify-content: center;
  }
  .gallery-item img {
    max-width: 90%;
    margin: 0 auto;
  }
  .popup-modal .prev {
    left: 7%;
  }
  .popup-modal .next {
    right: 7%;
  }
}
/* ---------- Gallery Indicators ---------- */
.gallery-indicators {
  direction: ltr;
  text-align: center;
  margin-top: -15px;
}
@media (min-width: 769px) {
  .gallery-indicators {
    display: none;
  }
}
.gallery-indicators .indicator-dot {
  display: inline-block;
  width: 40px;
  height: 6px;
  background: #ccc;
  border-radius: 3px;
  margin: 0 6px;
  transition: background-color 0.3s ease;
  cursor: pointer;
}
.gallery-indicators .indicator-dot:hover {
  background-color: #666;
}
.gallery-indicators .indicator-dot.active {
  background: var(--heading-text);
}
/* Optional: Mobile spacing & sizing adjustment */
@media (max-width: 768px) {
  .gallery-indicators .indicator-dot {
    width: 50px;
    margin: 0 4px;
  }
}
/* =====================================================
   Video Card Styles
===================================================== */
.video-card {
  width: 100%;
  margin: 0;
  padding: 20px 0;
  background: var(--white);
  border-radius: 0;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.video-inner {
  max-width: 900px;
  /* Desktop ke liye max width */
  margin: 0 auto;
  padding: 0 20px;
}
/* Row & Column Layout (default: mobile stacked) */
.video-row {
  display: flex;
  flex-direction: column;
  /* mobile default */
  gap: 20px;
}
.video-col {
  flex: 1;
}
.video-left {
  order: 2;
  /* Mobile: video niche */
}
.video-right {
  order: 1;
  /* Mobile: text upar */
}
.video-content {
  text-align: center;
}
.video-heading {
  color: var(--heading-text);
  margin-bottom: 10px;
  font-weight: bold;
}
.video-text {
  text-align: justify;
  font-size: 1.4rem;
}
/* Responsive Video Wrapper */
.video-wrapper {
  position: relative;
  aspect-ratio: 16 / 9;
  background-color: #e6f4ec;
  border-radius: 0.7rem;
  overflow: hidden;
  max-width: 100%;
  margin: 0 auto;
}
.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
/* Mobile (≤ 768px) */
@media (max-width: 768px) {
  .video-heading {
    font-size: 1.4rem;
  }
  .video-text {
    font-size: 1.3rem;
  }
  .video-content {
    text-align: right;
    /* Urdu ke liye */
  }
}
/* Desktop (≥900px) */
@media (min-width: 900px) {
  .video-row {
    flex-direction: row-reverse;
    /* video left, text right */
    align-items: center;
  }
  .video-left {
    order: 1;
    /* Desktop par video left */
    flex: 1.2;
  }
  .video-right {
    order: 2;
    /* Desktop par text right */
    flex: 1;
    padding-right: 30px;
    /* Urdu text ke liye spacing */
  }
  .video-content {
    text-align: right;
    /* Urdu text ke liye alignment */
  }
}
/* =====================================================
   About Us Popup Card Section
===================================================== */
.cards-container {
  max-width: 900px;
  margin: auto;
  padding: 15px 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.custom-card {
  width: calc(33.333% - 13.33px);
  background: var(--white);
  border: 1px solid #ddd;
  border-radius: 1rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-image {
  width: 100%;
  height: 200px;
  object-fit: contain;
  background-color: var(--notice-background);
  display: block;
  transition: transform 0.3s ease;
}
.custom-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}
.custom-card:hover .card-image {
  transform: scale(1.05);
}
.card-content {
  padding: 15px 20px;
  text-align: justify;
}
.about-card-content h3 {
  margin: 0 0 10px;
  background: var(--primary-green);
  color: var(--white);
  font-size: 1.5rem;
  text-align: center;
  display: block;
  padding: 10px 15px;
  position: relative;
  z-index: 1;
}
/* Excerpt/Text */
.card-excerpt {
  font-size: 1.1rem;
  color: var(--muted-text);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  padding: 0 10px;
}
/* Modal base */
.custom-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 100000;
}
.custom-modal.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-content {
  background: var(--white);
  border-radius: 10px;
  padding: 20px;
  max-width: 700px;
  width: 90%;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  position: relative;
  z-index: 1000000;
  text-align: justify;
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
}
@media (max-width: 768px) {
  .modal-content {
    font-size: 1.3rem;
  }
}
.custom-modal.active .modal-content {
  transform: scale(1);
}
/* Circular Sticky Close Button */
.close-btn {
  position: sticky;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  font-size: 22px;
  line-height: 40px;
  text-align: center;
  cursor: pointer;
  background: var(--heading-text);
  color: var(--white);
  border-radius: 50%;
  z-index: 1000001;
  display: inline-block;
  margin-left: auto;
  box-shadow: var(--shadow);
  transition: background 0.3s ease, transform 0.2s ease;
  font-weight: bold;
}
.close-btn:hover {
  background: #ffb3b3;
  transform: scale(1.15);
}
.close-btn:active {
  transform: scale(1.05);
}
.author-block {
  text-align: center;
  margin-top: 20px;
}
.author-block h4 {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0;
}
.author-block p {
  font-size: 1.3rem;
  color: #444;
  text-align: center;
}
.quote-mark {
  font-size: 1.5rem;
  color: #999;
  font-weight: bold;
}
/* ---------- Responsive Horizontal Layout ---------- */
@media (max-width: 768px) {
  .custom-card {
    width: 100%;
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
  }
  .card-image {
    width: 35%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
  }
  .card-content {
    flex: 1;
    padding: 0 10px;
  }
  .about-card-content h3 {
    font-size: 1.2rem;
    padding: 8px;
    margin: 0 0 8px;
  }
  .card-excerpt {
    font-size: 1.2rem;
    line-height: 1.4;
    min-height: auto;
  }
}
/* =====================================================
   📥 Downloads - Solid Blue + Image Overlay
===================================================== */
.downloads-section {
  padding: 20px;
}
.downloads-grid {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.download-card {
  position: relative;
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  background: var(--heading-text) url(/assets/images/khanqah_pattern.svg);
  background-size: inherit;
  background-blend-mode: overlay;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.download-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  background-color: var(--info-blue-hover);
}
.content-action-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  /* dono center mein laayega */
  align-items: center;
  /* vertical center */
  gap: 12px;
  /* dono ke beech gap */
  flex-direction: row;
  /* h3 text right side, icon left side */
}
.download-card h4 {
  margin: 0;
  color: var(--white);
  font-size: 1.5rem;
  font-weight: 400;
  white-space: nowrap;
  /* prevent wrapping */
}
.icon-btn {
  border-radius: 30px;
  padding: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}
.icon-btn .download-icon {
  width: 20px;
  height: 20px;
  stroke: var(--white);
  transition: stroke 0.3s ease;
}
.icon-btn:hover .download-icon {
  stroke: var(--white);
}
/* Responsive */
@media (max-width: 768px) {
  .downloads-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
}
/* =====================================================
   PDF MODAL
===================================================== */
.pdf-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
  padding: 20px;
}
/* Modal Content */
.pdf-modal-content {
  background-color: var(--white);
  width: 100%;
  max-width: 1000px;
  max-height: 100%;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
/* PDF Viewer */
.pdf-modal-content iframe {
  width: 100%;
  height: 80vh;
  border: none;
}
/* Footer Buttons Container */
.pdf-modal-footer {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 15px;
  background-color: #f9f9f9;
}
/* Mobile Responsive */
@media (max-width: 768px) {
  .pdf-modal-content iframe {
    height: 30vh;
  }
}
/* =====================================================
   Accordion - Smooth Open/Close
===================================================== */
.accordion {
  max-width: 900px;
  margin: 15px auto;
  /* auto = center align */
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  /* ✅ Safe gap from edges */
  padding: 0 10px;
}
@media (max-width: 768px) {
  .accordion {
    margin: 15px 10px;
    /* Add left and right margin */
  }
}
/* ---------- Accordion Header / Accordion Item ---------- */
.accordion-item {
  border-top: 1px solid #ddd;
}
.accordion-header {
  background: var(--white);
  width: 100%;
  padding: 15px;
  text-align: right;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  border: none;
  outline: none;
  font-family: 'Roboto', sans-serif;
  /* Heading font */
  transition: background 0.3s, box-shadow 0.3s;
  position: relative;
}
/* Hover Effect */
.accordion-header:hover {
  background: var(--notice-background);
}
/* Active/Open Header Style */
.accordion-header.active {
  background-color: var(--white);
  color: var(--heading-text);
  box-shadow: var(--shadow);
}
/* Mobile sticky header when active */
@media (max-width: 768px) {
  .accordion-header.active {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    box-shadow: var(--shadow);
  }
}
/* Arrow Indicator */
.accordion-header .arrow-icon {
  transition: transform 0.3s ease;
  display: inline-flex;
  margin-left: 10px;
  float: left;
}
.accordion-header.active .arrow-icon {
  transform: rotate(-180deg);
}
/* ---------- Accordion Content ---------- */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  background: var(--white);
  padding: 0 15px;
  /* spacing for readability */
}
.accordion-content.open {
  padding: 15px 15px;
}
/* ---------- Table Styling ---------- */
.dept-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}
.dept-table th,
.dept-table td {
  font-size: 1.5rem;
  font-weight: normal;
  border: 1px solid #ddd;
  padding: 2px 12px;
  text-align: center;
}
.dept-table th {
  background-color: #2e8b57;
  color: white;
}
.dept-table td {
  text-align: right;
  font-size: 1.3rem;
}
/* Intro Row Custom Style */
.dept-table .intro-row th {
  background-color: #e6f4ec;
  color: #212121;
  padding: 15px 20px;
  font-size: 1.3rem;
  text-align: justify;
}
/* ---------- Accordion Title ---------- */
.accordion-title-wrapper {
  text-align: center;
}
.accordion-title {
  text-align: center;
  font-weight: bold;
  color: var(--heading-text);
  margin-bottom: 20px;
  padding: 20px 10px 10px;
  position: relative;
  display: inline-block;
}
/* =====================================================
/* Page Instructions Notice
===================================================== */
.page-instruction-notice {
  background-color: var(--notice-background);
  padding: 20px;
  margin: 30px auto;
  line-height: 1.9;
  max-width: 900px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.page-instruction-notice h2.notice-title {
  margin-bottom: 15px;
  color: var(--heading-text);
  font-weight: bold;
  text-align: center;
}
.page-instruction-notice h3.notice-title {
  font-size: 20px;
  margin-bottom: 15px;
  color: var(--primary-green);
  font-weight: bold;
  text-align: center;
}
.page-instruction-notice ul.notice-list {
  padding-right: 25px;
}
.page-instruction-notice ul {
  padding-right: 25px;
  margin-bottom: 15px;
}
.page-instruction-notice li {
  margin-bottom: 10px;
  line-height: 1.9;
  color: var(--heading-text);
  font-size: 1.3rem;
  /* ya px me jo size chaho */
}
.page-instruction-notice hr {
  border: none;
  border-top: 1px solid #2e8b57;
  margin: 25px 0;
}
@media (max-width: 768px) {
  .page-instruction-notice {
    font-size: 15px;
    padding: 15px;
  }
  .page-instruction-notice h2.notice-title {
    font-size: 18px;
  }
}
/* =====================================================
   Contact Form
===================================================== */
.contact-form-container {
  max-width: 700px;
  margin: 40px auto;
  padding: 30px;
  background: var(--white);
  border-radius: 10px;
  box-shadow: var(--shadow);
  direction: rtl;
}
.contact-form-container h2 {
  text-align: center;
  margin-bottom: 25px;
  color: #2e8b57;
}
.contact-form-container label {
  display: block;
  margin-top: 15px;
  margin-bottom: 5px;
  font-weight: bold;
  color: #222;
}
.contact-form-container input,
.contact-form-container textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  box-sizing: border-box;
}
.contact-form-container textarea {
  resize: vertical;
  min-height: 150px;
}
.contact-message {
  max-width: 700px;
  margin: 20px auto;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  font-size: 16px;
  font-weight: bold;
}
.contact-message.success {
  background: #e6f4ec;
  border: 1px solid var(--heading-text);
  color: #155724;
}
.contact-message.error {
  background: #ffe8e8;
  border: 1px solid #ffb3b3;
  color: #721c24;
}
/* =====================================================
   WhatsApp Box
===================================================== */
.whatsapp-box {
  max-width: 500px;
  margin: 20px auto;
  background-color: #e9f7ef;
  border: 2px solid #25d366;
  border-radius: 10px;
  padding: 20px;
  text-align: right;
  direction: rtl;
}
.urdu-text {
  font-size: 18px;
  color: #1c1c1c;
  margin-bottom: 15px;
}
.button-wrapper {
  text-align: center;
  /* ✅ Center the button */
}
.whatsapp-button {
  display: inline-block;
  background-color: #25d366;
  color: var(--white);
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  font-size: 16px;
  transition: background-color 0.3s ease;
}
.whatsapp-button i {
  margin-left: 8px;
}
.whatsapp-button:hover {
  background-color: #1da851;
}
@media (max-width: 768px) {
  .whatsapp-box {
    padding: 15px;
    margin: 10px 15px;
  }
  .urdu-text {
    font-size: 16px;
  }
  .whatsapp-button {
    font-size: 14px;
    padding: 8px 16px;
  }
}
/* =====================================================
   Google Map
===================================================== */
.google-map-container {
  max-width: 900px;
  margin: 10px auto;
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  padding: 0 10px;
}
/* =====================================================
   Form Container
===================================================== */
.form-box, .application-form-box {
  margin: 40px auto;
  background: var(--white);
  padding: 20px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.form-box {
  max-width: 600px;
}
.application-form-box {
  max-width: 900px;
}
.form-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.form-group {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
}
.form-group input {
  width: 100%;
  height: 48px;
  padding: 10px 14px;
  font-size: 16px;
  line-height: 1.4;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-sizing: border-box;
}

/* =========================
   Required field ke liye red star
========================= */
.form-group:has(input[required]) > label::after,
.form-group:has(select[required]) > label::after,
.form-group:has(textarea[required]) > label::after {
  content: " *";
  color: var(--alert-error-border);
  font-size: 0.7em;       /* star ko thoda chhota kar dega */
  font-weight: normal;    /* bold na ho */
  vertical-align: super;  /* thoda upar uth jaayega (superscript effect) */
  margin-right: 3px;      /* Urdu/RTL spacing ke liye */
}

/* =========================
   Unified Form Inputs
========================= */
input,
textarea,
select {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: 'JameelNooriNastaleeq', serif;
  font-size: 1rem;
  box-sizing: border-box;
  direction: rtl;
  text-align: right;
  transition: border-color 0.3s, background-color 0.3s;
  background-color: var(--white) !important;
}
/* Focus States */
input:focus,
textarea:focus,
select:focus {
  border-color: var(--footer-hover-green);
  background-color: var(--white);
  outline: none;
}
/* Select Specific Styles */
select {
  padding-left: 32px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='7' viewBox='0 0 12 7' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231c5a2b' stroke-width='2' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  background-size: 12px;
}
/* Placeholder Styling */
input::placeholder,
textarea::placeholder {
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  color: #999;
  text-align: left;
  direction: ltr;
}
/* LTR Overrides */
.ltr-input,
input[dir="ltr"],
textarea[dir="ltr"],
select[dir="ltr"] {
  direction: ltr!important;
  text-align: left!important;
  font-family: 'Roboto', sans-serif!important;
}
/* Error & success styling */
input.invalid,
select.invalid {
  border: 1px solid var(--invalid-input);
}
input.valid,
select.valid {
  border: 1px solid var(--valid-input);
}
/* On hover of invalid input */
input.invalid:hover,
select.invalid:hover {
  border-color: var(--invalid-input);
}
/* Error message styling */
.error-message {
  color: var(--invalid-input);
  font-size: 13px;
  margin-top: 4px;
  text-align: right;
}
/* =========================
   Form Titles
========================= */
.form-title,
.form-subtitle,
.form-note {
  text-align: center;
  margin-bottom: 10px;
}
.form-title {
  font-weight: bold;
}
.form-subtitle {
  font-size: 18px;
  color: #666;
}
.form-note {
  font-size: 1.3rem;
  color: #999;
}
/* Section Heading Style */
.form-section-title {
  background: #e6f4ec;
  padding: 12px;
  border-radius: 6px;
  margin-top: 30px;
  margin-bottom: 15px;
  font-weight: 600;
  text-align: center;
  color: #1F2937;
  border: 1px solid #d1e1fd;
}
/* Checkbox Styling */
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #2e8b57;
  vertical-align: middle;
  margin-right: 8px;
  margin-left: 8px;
}
/* =========================
   Table
========================= */
.table-data {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}
.table-data th,
.table-data td {
  border: 1px solid #ddd;
  padding: 8px 12px;
}
.table-data th {
  background: #f0f0f0;
}
/* =========================
   Photo Placeholder
========================= */
.photo-placeholder {
  border: 1px dashed #888;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  background: #fafafa;
}
.photo-placeholder.small {
  width: 80px;
  height: 100px;
  font-size: 11px;
}
.photo-placeholder.large {
  width: 100px;
  height: 120px;
  font-size: 12px;
}
/* =========================
   Header Notice Section Styles
========================= */
.full-width-notice-wrapper {
  width: 100%;
  background: var(--notice-background);
  border-top: 1px solid var(--background-light);
  border-bottom: 1px solid var(--background-light);
  padding: 1px 0;
}
.header-notice-board {
  background: var(--white);
  margin: 15px auto;
  padding: 10px 20px;
  max-width: 900px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}
.header-notice-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.header-notice-text {
  flex: 1;
  font-size: 1.3rem;
  color: var(--heading-text);
  text-align: right;
  transition: opacity 0.3s ease;
}
.header-notice-text a {
  text-decoration: none;
  color: var(--heading-text);
  font-weight: 500;
}
.header-notice-controls {
  display: flex;
  gap: 8px;
}
.header-notice-controls button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  background-color: #ddd;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.header-notice-controls button.active {
  background-color: var(--heading-text);
}
/* Header Notice Responsive (Mobile) */
@media (max-width: 768px) {
  .header-notice-container {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  .header-notice-text {
    text-align: center;
    width: 100%;
  }
  .header-notice-controls {
    justify-content: center;
  }
  .header-notice-board {
    margin: 15px 10px;
  }
}
/* =========================
   Success
========================= */
.success-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 80vh;
  background: #f9f9f9;
}
.success-card {
  background: white;
  padding: 40px;
  border-radius: 12px;
  text-align: center;
  box-shadow: var(--shadow);
  max-width: 500px;
  width: 100%;
}
.success-icon {
  font-size: 60px;
  color: #28a745;
  margin-bottom: 20px;
}
.success-card h2 {
  color: var(--heading-text);
  margin-bottom: 15px;
}
.app-number {
  font-size: 18px;
  margin: 15px 0;
  color: #000;
}
.note {
  color: #666;
  font-size: 14px;
  margin-bottom: 25px;
}
.home-btn {
  display: inline-block;
  padding: 10px 20px;
  background: #28a745;
  color: var(--white);
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.3s;
}
.home-btn:hover {
  background: #1c5a2b;
}
/* =========================
   Error + Result + Alerts
========================= */
.error-box,
.result-box,
.alert {
  max-width: 600px;
  margin: 20px auto;
  padding: 20px;
  text-align: center;
  border-radius: 8px;
}
.error-box {
  background: #ffe8e8;
  border: 1px solid #ffb3b3;
  color: red;
}
.result-box {
  background: #f0f8ff;
  border: 1px solid #b3d9ff;
}
.status-text {
  font-weight: bold;
}
.status-text.green {
  color: green;
}
.status-text.red {
  color: red;
}
.status-text.orange {
  color: orange;
}
.alert-success {
  background: #e6ffe6;
  border: 1px solid #b3ffb3;
  color: #2e8b57;
}
.alert-error {
  background: #ffe8e8;
  border: 1px solid #ffb3b3;
  color: #b30000;
}
.alert-info {
  background: #f0f8ff;
  border: 1px solid #b3d9ff;
  color: #004085;
}
/* ---------- No Result Message ---------- */
.no-result {
  text-align: center;
  background: var(--alert-error-bg);
  color: var(--alert-error-text);
  padding: 20px;
  border: 1px solid var(--alert-error-border);
  border-radius: 8px;
  font-size: 18px;
  margin-bottom: 20px;
}

/* ===========================
  Result Screen Styles
=========================== */
.preview-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
  background: #f9f9f9;
  min-height: 100vh;
  direction: rtl;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;  /* Scroll vertical allow करें */
}

.preview-card {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  max-width: 210mm;
  width: 100%;
  box-sizing: border-box;
  overflow: visible;
  max-height: none;
}

/* ===========================
   Letterhead (screen)
=========================== */
.JamiaLetterhead {
  position: relative;
  width: calc(100% + 60px); /* override card padding */
  margin-left: -30px;
  margin-right: -30px;
  box-sizing: border-box;
  text-align: center;
  max-width: none;
}

/* Responsive */
@media (max-width: 768px) {
  .preview-container {
    padding: 20px 10px;
  }

  .preview-card {
    padding: 15px;
  }

  .JamiaLetterhead {
    width: calc(100% + 30px);
    margin-left: -15px;
    margin-right: -15px;
  }
}

/* ===========================
   Table Styles
=========================== */
.student-info-table,
.marks-table,
.summary-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 1.1rem;
  text-align: right;
}

/* Student Info Table Specific Styling */
.student-info-table td {
  border: 1px solid #ddd; /* Outer borders */
  padding: 8px 10px;
  vertical-align: middle;
}

/* Label column should be narrower */
.student-info-table td.label-cell {
  width: 1%; /* Shrink label cells */
  white-space: nowrap;
}

/* Ensure row starts and ends with borders */
.student-info-table td:first-child {
  border-right: 1px solid #ddd;
}

.student-info-table td:last-child {
  border-right: 1px solid #ddd;
}

/* Marks & Summary Table Styling */
.marks-table td,
.marks-table th,
.summary-table td,
.summary-table th {
  border: 1px solid #ddd;
  padding: 10px;
  vertical-align: middle;
}

.marks-table th {
  background-color: #f0f8ff;
  color: #1c5a2b;
}

/* Minimum Marks Banner */
.min-marks-banner {
  color: var(--muted-text);
}

/* Colon after label */
.label::after {
  content: ":";
  margin-left: 6px;
}

/* ===========================
   Responsive Styling
=========================== */
@media screen and (max-width: 768px) {
  .student-info-table {
    width: 100%;
    border-collapse: collapse;
  }

  .student-info-table tr {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 10px;
    border: none;
  }

  .student-info-table tr > td {
    display: block;
    box-sizing: border-box;
    border: 1px solid #ddd;
    padding: 8px 10px;
  }

  /* हर जोड़े के लिए अलग लाइन */
  .student-info-table tr > td:nth-child(odd),
  .student-info-table tr > td:nth-child(even) {
    width: 50%;
  }

  /* लेबल स्टाइल */
  .student-info-table tr > td.label-cell {
    white-space: nowrap;
    font-weight: bold;
    padding-right: 10px;
    width: 40%;
  }

  /* वैल्यू स्टाइल */
  .student-info-table tr > td.value-cell {
    width: 60%;
    min-width: 0;
    overflow-wrap: break-word;
  }
}


/* ===========================
   Footer (for screen)
=========================== */
.print-footer {
  display: none;
}

/* ===========================
   Print Styles
=========================== */
@media print {
  html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: white;
  }

  @page {
    size: A4 portrait;
    margin: 0mm 0mm 10mm 0mm; /* we'll handle margins with container spacing */
  }

  body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
  }

  .JamiaLetterhead {
    position: fixed;
    top: 10mm;
    left: 0;
    width: 210mm;
    height: auto;
    box-sizing: border-box;
    z-index: 1000;
    background: white;
    padding: 0;
    margin: 0;
    text-align: center;
  }

  .JamiaLetterhead img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain;
  }

  .preview-container {
    margin-top: 150px; /* Reserve space for fixed letterhead */
    margin-bottom: 100px; /* Reserve space for footer */
    padding: 0 20mm !important;
    background: none !important;
    min-height: auto !important;
  }

  .preview-card {
    background: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
  }

  .button-container,
  .btn {
    display: none !important;
  }

  .print-footer {
    display: flex !important;
    position: absolute;
    bottom: 0;
    left: 20mm;
    right: 20mm;
    justify-content: space-between;
    font-size: 10px;
    border-top: 1px solid #ccc;
    padding-top: 5px;
    background: white;
    direction: ltr;
    z-index: 999;
  }

  .footer-left {
    text-align: left;
  }

  .footer-right {
    text-align: right;
  }

    body {
    counter-reset: page 1;
  }

  .page-number::after {
    content: counter(page);
  }
}
/* Hide mobile letterhead by default */
.mobile-letterhead {
  display: none;
}

/* Show mobile letterhead & hide desktop one on small screens */
@media (max-width: 768px) {
  .desktop-letterhead {
    display: none !important;
  }

  .mobile-letterhead {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    object-fit: contain;
  }
}
@media print {
  .desktop-letterhead {
    display: block !important;
  }

  .mobile-letterhead {
    display: none !important;
  }
}
