*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --saffron: #ff9933;
  --white: #ffffff;
  --green: #138808;
  --navy: #000080;
  --gold: #c8a415;
  --light-bg: #f5f5f0;
  --border: #c8b97a;
  --text: #1a1a1a;
  --muted: #555;
}

body {
  font-family: "Noto Sans", "Noto Sans Devanagari", sans-serif;
  background: var(--light-bg);
  color: var(--text);
  font-size: 14px;
}

/* UTILITY BAR */
.utility-bar {
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  padding: 4px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.utility-bar a {
  color: #ccd;
  text-decoration: none;
  margin-left: 10px;
}
.utility-bar a:hover {
  color: var(--saffron);
}

/* TRICOLOUR */
.tricolour-strip {
  display: flex;
  height: 5px;
}
.stripe.saffron,
.ft-stripe.saffron {
  background: var(--saffron);
  flex: 1;
}
.stripe.white,
.ft-stripe.white {
  background: var(--white);
  flex: 1;
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
}
.stripe.green,
.ft-stripe.green {
  background: var(--green);
  flex: 1;
}

/* HEADER */
.main-header {
  background: linear-gradient(135deg, #00004d 0%, #000080 60%, #00004d 100%);
  color: white;
  display: flex;
  align-items: center;
  padding: 16px 24px;
  gap: 20px;
  flex-wrap: wrap;
}
.emblem-img {
  width: 70px;
  height: 70px;
  filter: brightness(1.1);
}
.header-text {
  flex: 1;
  min-width: 200px;
}
.school-name-hindi {
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  font-family: "Noto Sans Devanagari", sans-serif;
}
.school-name-english {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-top: 2px;
}
.school-location {
  font-size: 12px;
  color: #b0b8d0;
  margin-top: 4px;
}
.header-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.badge {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
}
.header-info-box {
  font-size: 12px;
  color: #c0cadf;
  line-height: 1.9;
  text-align: right;
}

/* NAV */
.main-nav {
  background: var(--navy);
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
}
.main-nav ul {
  display: flex;
  list-style: none;
  flex-wrap: wrap;
}
.main-nav ul li a {
  display: block;
  padding: 12px 20px;
  color: #dde;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: background 0.2s;
}
.main-nav ul li a:hover {
  background: var(--saffron);
  color: white;
}

/* TICKER */
.ticker-bar {
  background: #fffbe6;
  border-bottom: 2px solid var(--gold);
  padding: 7px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}
.ticker-label {
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
  font-size: 12px;
}
.ticker-wrap {
  overflow: hidden;
  flex: 1;
}
.ticker-content {
  white-space: nowrap;
  animation: ticker 30s linear infinite;
  font-size: 13px;
  color: var(--navy);
}
@keyframes ticker {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* MAIN WRAPPER */
.main-wrapper {
  display: flex;
  gap: 20px;
  padding: 20px 16px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: flex-start;
}
.content-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* STATS BAR */
.stats-bar {
  background: var(--navy);
  color: white;
  display: flex;
  justify-content: space-around;
  padding: 16px;
  border-radius: 4px;
  flex-wrap: wrap;
  gap: 12px;
}
.stat-item {
  text-align: center;
}
.stat-num {
  display: block;
  font-size: 26px;
  font-weight: 700;
  color: var(--gold);
}
.stat-label {
  font-size: 11px;
  color: #aab;
}

/* SECTION CARDS */
.section-card {
  background: white;
  border: 1px solid var(--border);
  border-top: 4px solid var(--navy);
  padding: 0;
  border-radius: 2px;
}
.section-header {
  background: linear-gradient(90deg, var(--navy) 0%, #000055 100%);
  padding: 10px 18px;
}
.section-header h2 {
  color: white;
  font-size: 15px;
  letter-spacing: 0.5px;
}
.section-card > p,
.section-card
  > div:not(.section-header):not(.highlights-grid):not(.principal-block):not(
    .table-wrap
  ):not(.gallery-grid):not(.contact-grid) {
  padding: 16px 18px;
}
section.section-card > p {
  padding: 12px 18px 0;
  line-height: 1.7;
  color: var(--muted);
}
section.section-card > p + p {
  padding-top: 8px;
  padding-bottom: 0;
}

/* HIGHLIGHTS */
.highlights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 16px 18px;
}
.highlight-item {
  background: #f0f4ff;
  border: 1px solid #c8d0e8;
  padding: 10px;
  text-align: center;
  border-radius: 3px;
  font-size: 13px;
}

/* PRINCIPAL */
.principal-block {
  display: flex;
  gap: 20px;
  padding: 16px 18px;
  flex-wrap: wrap;
}
.principal-photo-wrap {
  text-align: center;
  min-width: 120px;
}
.principal-photo-placeholder {
  width: 100px;
  height: 120px;
  background: #e8eaf0;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin: 0 auto;
}
.principal-name {
  font-weight: 700;
  font-size: 13px;
  margin-top: 8px;
  color: var(--navy);
}
.principal-title {
  font-size: 11px;
  color: var(--muted);
}
.principal-message p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 10px;
}
.principal-sign {
  font-weight: 700;
  color: var(--navy);
  font-style: italic;
}

/* TABLE */
.table-wrap {
  padding: 16px 18px;
  overflow-x: auto;
}
.govt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.govt-table th {
  background: var(--navy);
  color: white;
  padding: 8px 12px;
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.3px;
}
.govt-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #e0dcc8;
}
.govt-table tr:nth-child(even) td {
  background: #f9f7f0;
}
.govt-table tr:hover td {
  background: #eef0ff;
}

/* NOTICES MAIN */
#notices-list-main {
  padding: 12px 18px;
}
.main-notice-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 3px;
  padding-left: 8px;
}
.main-notice-row:hover {
  background: #f0f4ff;
}
.main-notice-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.main-notice-title {
  font-size: 13px;
  color: var(--navy);
  font-weight: 600;
}
.main-notice-right {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.main-notice-arrow {
  font-size: 20px;
  color: var(--muted);
}
.loading-notices {
  padding: 12px;
  color: var(--muted);
  font-style: italic;
}

/* GALLERY */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 16px 18px;
}
.gallery-item {
  background: #e8eaf0;
  border: 1px solid var(--border);
  aspect-ratio: 4/3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.2s;
  border-radius: 2px;
}
.gallery-item span {
  font-size: 11px;
  color: var(--muted);
}
.gallery-item:hover {
  transform: scale(1.03);
}

/* CONTACT */
.contact-grid {
  display: flex;
  gap: 20px;
  padding: 16px 18px;
  flex-wrap: wrap;
}
.contact-info {
  flex: 1;
  min-width: 200px;
}
.contact-row {
  padding: 7px 0;
  border-bottom: 1px solid #eee;
  display: flex;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}
.map-placeholder {
  flex: 1;
  min-width: 200px;
  background: #e8eaf0;
  border: 2px dashed var(--border);
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 24px;
  border-radius: 3px;
}

/* SIDEBAR */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sidebar-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.sidebar-card-header {
  background: var(--navy);
  color: white;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.notice-list {
  list-style: none;
  padding: 8px 0;
}
.notice-item {
  padding: 9px 14px;
  border-bottom: 1px solid #f0ead8;
  cursor: pointer;
  transition: background 0.15s;
}
.notice-item:hover {
  background: #f5f0e8;
}
.notice-title-text {
  display: block;
  font-size: 12px;
  color: var(--navy);
  font-weight: 600;
  margin: 3px 0;
  line-height: 1.4;
}
.notice-date {
  font-size: 10px;
  color: var(--muted);
}
.notice-loading {
  padding: 12px 14px;
  color: var(--muted);
  font-style: italic;
  font-size: 12px;
}

/* NOTICE TAGS */
.notice-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.notice-tag.exam,
.modal-category-badge.exam {
  background: #fff3cd;
  color: #7d5a00;
  border: 1px solid #f0c040;
}
.notice-tag.holiday,
.modal-category-badge.holiday {
  background: #d4edda;
  color: #155724;
  border: 1px solid #80c080;
}
.notice-tag.urgent,
.modal-category-badge.urgent {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f08080;
}
.notice-tag.general,
.modal-category-badge.general {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #80c8d8;
}
.notice-tag.fee,
.modal-category-badge.fee {
  background: #e8d4f0;
  color: #4a1560;
  border: 1px solid #b080c8;
}

/* QUICK LINKS */
.quick-links {
  list-style: none;
  padding: 8px 0;
}
.quick-links li a {
  display: block;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--navy);
  text-decoration: none;
  border-bottom: 1px solid #f0ead8;
  transition: background 0.15s;
}
.quick-links li a:hover {
  background: #f5f0e8;
  color: var(--green);
}

/* EVENTS */
.events-list {
  list-style: none;
  padding: 8px 14px;
}
.events-list li {
  padding: 7px 0;
  border-bottom: 1px solid #f0ead8;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.event-date {
  background: var(--navy);
  color: white;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10px;
  white-space: nowrap;
}

/* FOOTER */
.main-footer {
  background: #00003a;
  color: #b0b8cc;
  margin-top: 20px;
}
.footer-tricolour {
  display: flex;
  height: 4px;
}
.footer-content {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  padding: 24px 20px;
}
.footer-col {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}
.footer-school-name {
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}
.footer-heading {
  color: white;
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 12px;
  letter-spacing: 0.5px;
}
.footer-col a {
  color: #90a0c0;
  text-decoration: none;
  font-size: 12px;
}
.footer-col a:hover {
  color: var(--saffron);
}
.footer-bottom {
  border-top: 1px solid #1a1a5a;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #7080a0;
  flex-wrap: wrap;
  gap: 8px;
}
.jai-hind {
  color: var(--saffron);
  font-weight: 700;
}

/* MODAL */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-box {
  background: #fffef5;
  border: 2px solid var(--border);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
  border-radius: 2px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--muted);
}
.modal-close:hover {
  color: red;
}
.modal-letterhead {
  text-align: center;
  margin-bottom: 12px;
}
.modal-school-name {
  font-family: "Noto Sans Devanagari", sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
}
.modal-school-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.modal-divider {
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--saffron),
    var(--white),
    var(--green)
  );
  margin: 10px 0;
}
.modal-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}
.modal-category-badge {
  display: inline-block;
  padding: 2px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 10px;
}
.modal-title {
  font-size: 17px;
  color: var(--navy);
  margin-bottom: 8px;
  line-height: 1.4;
}
.modal-issued {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
}
.modal-body {
  font-size: 13px;
  line-height: 1.85;
  color: var(--text);
  white-space: pre-wrap;
}
.modal-stamp {
  text-align: right;
  color: var(--green);
  font-weight: 700;
  font-size: 13px;
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  letter-spacing: 2px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.btn-whatsapp {
  background: #25d366;
  color: white;
  border: none;
  padding: 9px 18px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
}
.btn-print {
  background: var(--navy);
  color: white;
  border: none;
  padding: 9px 18px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .main-wrapper {
    flex-direction: column;
    padding: 12px;
  }
  .sidebar {
    width: 100%;
  }
  .highlights-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .main-header {
    padding: 12px;
    gap: 12px;
  }
  .school-name-hindi {
    font-size: 17px;
  }
  .school-name-english {
    font-size: 13px;
  }
  .header-info-box {
    text-align: left;
  }
}
