/* Ali Bin Usman Institute - Main Stylesheet */

:root {
  --navy: #002B5C;
  --navy-dark: #001a38;
  --maroon: #A51C30;
  --maroon-dark: #8a1728;
  --white: #FFFFFF;
  --off-white: #F7F8FA;
  --text: #1A1A2E;
  --muted: #5A6270;
  --border: #E2E6ED;
  --shadow: 0 4px 20px rgba(0, 43, 92, 0.1);
  --shadow-lg: 0 8px 32px rgba(0, 43, 92, 0.15);
  --header-height: 72px;
  --transition: 0.3s ease;
  --radius: 8px;
  --max-width: 1200px;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  line-height: 1.7;
  background: var(--white);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  color: var(--navy);
  margin-bottom: 12px;
}

.section-header .divider {
  width: 60px;
  height: 4px;
  background: var(--maroon);
  margin: 0 auto 16px;
  border-radius: 2px;
}

.section-header p {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--white);
  border-bottom: 2px solid var(--navy);
  z-index: 1000;
  transition: box-shadow var(--transition);
}

.header.scrolled {
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo img {
  width: 48px;
  height: auto;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-text .name {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}

.logo-text .location {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-desktop a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--navy);
  position: relative;
  padding: 4px 0;
  transition: color var(--transition);
}

.nav-desktop a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--maroon);
  transition: width var(--transition);
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--maroon);
}

.nav-desktop a:hover::after,
.nav-desktop a.active::after {
  width: 100%;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--navy);
  transition: transform var(--transition), opacity var(--transition);
  border-radius: 1px;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-mobile {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: var(--white);
  border-bottom: 2px solid var(--navy);
  padding: 16px 24px 24px;
  box-shadow: var(--shadow);
  z-index: 999;
}

.nav-mobile.open {
  display: block;
}

.nav-mobile a {
  display: block;
  padding: 14px 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--navy);
  border-bottom: 1px solid var(--border);
  transition: color var(--transition);
}

.nav-mobile a:last-child {
  border-bottom: none;
}

.nav-mobile a:hover,
.nav-mobile a.active {
  color: var(--maroon);
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  margin-top: var(--header-height);
  background:
    linear-gradient(135deg, rgba(0, 43, 92, 0.55) 0%, rgba(0, 26, 56, 0.72) 100%),
    url('../images/hero-bg-sunset.svg') center/cover no-repeat;
}

.hero-content {
  max-width: 800px;
  padding: 40px 24px;
  animation: fadeUp 1s ease-out;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-badge {
  display: inline-block;
  background: var(--maroon);
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 8px 20px;
  border-radius: 50px;
  margin-bottom: 24px;
}

.hero h1 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
}

.hero .subtitle {
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  opacity: 0.95;
  margin-bottom: 12px;
  font-weight: 400;
}

.hero .tagline {
  font-size: 1rem;
  opacity: 0.85;
  margin-bottom: 36px;
}

.hero .subtitle-through {
  margin-bottom: 4px;
}

.hero .act-line {
  font-weight: 700;
  opacity: 1;
  margin-bottom: 36px;
}

.btn {
  display: inline-block;
  padding: 14px 32px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius);
  transition: all var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--maroon);
  color: var(--white);
  border-color: var(--maroon);
}

.btn-primary:hover {
  background: var(--maroon-dark);
  border-color: var(--maroon-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(165, 28, 48, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
  margin-left: 12px;
}

.btn-outline:hover {
  background: var(--white);
  color: var(--navy);
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
}

.hero-scroll svg {
  width: 28px;
  height: 28px;
  opacity: 0.7;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* About */
.about {
  background: var(--off-white);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.about-text p {
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 20px;
}

.about-text p:last-of-type {
  margin-bottom: 32px;
}

.about-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--navy);
  box-shadow: var(--shadow);
}

.badge svg {
  width: 18px;
  height: 18px;
  color: var(--maroon);
  flex-shrink: 0;
}

.about-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.about-logo-card {
  background: var(--white);
  border: 3px solid var(--maroon);
  border-radius: 16px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.about-logo-card img {
  width: 160px;
  margin: 0 auto 16px;
}

.about-logo-card h3 {
  font-family: 'Merriweather', Georgia, serif;
  color: var(--navy);
  font-size: 1.1rem;
}

.about-pillars {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 100%;
}

.pillar {
  background: var(--white);
  padding: 20px 16px;
  border-radius: var(--radius);
  text-align: center;
  border-left: 4px solid var(--navy);
  box-shadow: var(--shadow);
}

.pillar:nth-child(even) {
  border-left-color: var(--maroon);
}

.pillar-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.pillar h4 {
  font-size: 0.85rem;
  color: var(--navy);
  font-weight: 600;
}

/* Programs */
.programs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.program-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--navy);
  transition: transform var(--transition), box-shadow var(--transition);
}

.program-card:nth-child(even) {
  border-top-color: var(--maroon);
}

.program-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.program-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: var(--off-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.program-icon svg {
  width: 32px;
  height: 32px;
  color: var(--navy);
}

.program-card:nth-child(even) .program-icon svg {
  color: var(--maroon);
}

.program-card h3 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.15rem;
  color: var(--navy);
  margin-bottom: 12px;
}

.program-card p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

/* Contact */
.contact {
  background: var(--off-white);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--white);
  padding: 20px 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform var(--transition);
}

.contact-item:hover {
  transform: translateX(4px);
}

.contact-icon {
  width: 48px;
  height: 48px;
  background: var(--navy);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-icon svg {
  width: 22px;
  height: 22px;
  color: var(--white);
}

.contact-item:nth-child(even) .contact-icon {
  background: var(--maroon);
}

.contact-details h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 600;
}

.contact-details a,
.contact-details p {
  font-size: 1.05rem;
  color: var(--navy);
  font-weight: 500;
}

.contact-details a:hover {
  color: var(--maroon);
}

.contact-social {
  background: var(--white);
  padding: 40px 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}

.contact-social h3 {
  font-family: 'Merriweather', Georgia, serif;
  color: var(--navy);
  margin-bottom: 8px;
}

.contact-social > p {
  color: var(--muted);
  margin-bottom: 28px;
  font-size: 0.95rem;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.social-link {
  width: 52px;
  height: 52px;
  background: var(--navy);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.social-link:nth-child(even) {
  background: var(--maroon);
}

.social-link:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 43, 92, 0.3);
}

.social-link svg {
  width: 24px;
  height: 24px;
  color: var(--white);
}

.contact-map {
  margin-top: 24px;
  border-radius: var(--radius);
  overflow: hidden;
  height: 200px;
  background: var(--off-white);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border);
}

.contact-map p {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Footer */
.footer {
  background: var(--navy);
  color: var(--white);
  padding: 48px 24px 24px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.footer-logo img {
  width: 56px;
}

.footer-logo h3 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.2rem;
}

.footer-chartered {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 6px;
}

.footer-recognition {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 24px;
}

.footer-divider {
  width: 80px;
  height: 2px;
  background: var(--maroon);
  margin: 0 auto 24px;
}

.footer-copyright {
  font-size: 0.85rem;
  opacity: 0.75;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 43, 92, 0.8);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--white);
  border-radius: 16px;
  max-width: 700px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  overflow-anchor: none;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--white);
  border-radius: 16px 16px 0 0;
  z-index: 10;
}

.modal-header h3 {
  font-family: 'Merriweather', Georgia, serif;
  color: var(--navy);
  font-size: 1.25rem;
  margin: 0;
}

.modal-close {
  width: 40px;
  height: 40px;
  background: var(--off-white);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--navy);
}

.modal-close:hover {
  background: var(--maroon);
  color: var(--white);
  transform: rotate(90deg);
}

.modal-close svg {
  width: 24px;
  height: 24px;
}

.modal-body {
  padding: 32px;
}

.modal-body h4 {
  font-family: 'Merriweather', Georgia, serif;
  color: var(--navy);
  font-size: 1.1rem;
  margin-bottom: 16px;
  margin-top: 24px;
}

.modal-body h4:first-child {
  margin-top: 0;
}

.modal-body ul {
  list-style: disc;
  padding-left: 24px;
  margin-bottom: 16px;
}

.modal-body li {
  margin-bottom: 8px;
  color: var(--text);
  line-height: 1.6;
}

.modal-body p {
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 16px;
}

.program-card {
  cursor: pointer;
}

/* Table Styles for Scheme of Studies */
.modal-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  border-radius: 8px;
  overflow: hidden;
}

.modal-body thead {
  background: var(--navy);
  color: var(--white);
}

.modal-body th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-body td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-body tbody tr:nth-child(even) {
  background: var(--off-white);
}

.modal-body tbody tr:hover {
  background: rgba(165, 28, 48, 0.05);
}

.modal-body .category-general {
  color: #2E7D32;
  font-weight: 500;
}

.modal-body .category-major {
  color: var(--maroon);
  font-weight: 600;
}

.modal-body .category-id {
  color: #1565C0;
  font-weight: 500;
}

.modal-body .category-certification {
  color: #E65100;
  font-weight: 600;
}

.modal-body .category-capstone {
  color: #6A1B9A;
  font-weight: 600;
}

.modal-body .category-field {
  color: #00838F;
  font-weight: 600;
}

.modal-body .category-core {
  color: #5D4037;
  font-weight: 500;
}

.modal-body .category-specialization {
  color: #4527A0;
  font-weight: 600;
}

.modal-body .category-research {
  color: #F57F17;
  font-weight: 600;
}

.modal-body .category-cp {
  color: #006064;
  font-weight: 600;
}

.modal-body .num-cell {
  text-align: center;
  font-weight: 600;
  color: var(--navy);
}

.modal-body .note-box {
  background: var(--off-white);
  border-left: 4px solid var(--navy);
  border-radius: 6px;
  padding: 14px 16px;
  margin: 16px 0;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
}

.modal-body .note-box strong {
  color: var(--navy);
}

.modal-body .specialization-detail ul {
  padding: 4px 16px 16px 40px;
  margin: 0;
}

.modal-body .credit-hours {
  text-align: center;
  font-weight: 600;
  color: var(--navy);
}

.modal-body .semester-header {
  background: var(--off-white);
  color: var(--navy);
  padding: 12px 16px;
  font-weight: 700;
  border-radius: 6px;
  border-left: 4px solid var(--maroon);
  margin: 24px 0 12px 0;
}

.modal-body .program-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.modal-body .meta-stat {
  flex: 1 1 120px;
  text-align: center;
  background: var(--off-white);
  border: 1px solid var(--border);
  border-top: 3px solid var(--maroon);
  border-radius: 8px;
  padding: 14px 12px;
}

.modal-body .meta-value {
  display: block;
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}

.modal-body .meta-label {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}

.modal-body .specialization-accordion {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-body .specialization-detail {
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  text-align: left;
}

.modal-body .specialization-detail + .specialization-detail {
  margin-top: 0;
}

.modal-body .specialization-detail summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 14px 16px;
  font-weight: 600;
  color: var(--navy);
  text-align: left;
  border-left: 4px solid var(--maroon);
  transition: background var(--transition);
}

.modal-body .specialization-detail table td:first-child {
  text-align: left;
}

.modal-body .specialization-detail summary::-webkit-details-marker {
  display: none;
}

.modal-body .specialization-detail summary::before {
  content: '+';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 10px;
  font-size: 1rem;
  color: var(--maroon);
  flex-shrink: 0;
}

.modal-body .specialization-detail[open] summary::before {
  content: '\2212';
}

.modal-body .specialization-detail summary:hover {
  background: rgba(165, 28, 48, 0.05);
}

.modal-body .specialization-detail .spec-count {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--white);
  background: var(--maroon);
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

.modal-body .specialization-detail table {
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

.modal-body .specialization-detail .spec-note {
  margin: 0;
  padding: 10px 16px 0 16px;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--muted);
}

/* Responsive */
@media (max-width: 1024px) {
  .programs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .section {
    padding: 60px 0;
  }

  .nav-desktop {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .logo-text .name {
    font-size: 0.8rem;
  }

  .logo-text .location {
    font-size: 0.7rem;
  }

  .logo img {
    width: 40px;
  }

  .hero {
    min-height: calc(100vh - var(--header-height));
    min-height: calc(100dvh - var(--header-height));
  }

  .btn-outline {
    margin-left: 0;
  }

  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .about-visual {
    order: -1;
  }

  .about-logo-card {
    padding: 28px;
  }

  .about-logo-card img {
    width: 120px;
  }

  .programs-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }

  .contact-social {
    padding: 32px 24px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .header-inner {
    padding: 0 16px;
  }

  .about-pillars {
    grid-template-columns: 1fr;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 280px;
    text-align: center;
  }
}
