/* =========================================================
   DIGISERV / SIAY NHS BASE CSS (ORGANIZED)
   ========================================================= */

/* ===== 1) ROOT VARIABLES / THEME ===== */
:root{
  --primary-color:#800000; /* Maroon */
  --accent-color:#ffc107;
  --light-bg:#f8f9fa;
  --text-color:#212529;
}

/* ===== 2) GLOBAL RESETS / BASE ===== */
html, body { height: 100%; }

body{
  font-family:'Inter',sans-serif;
  background-color:var(--light-bg);
  color:var(--text-color);
}

/* Page shell variant */
body.page-shell {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #e3f2fd 0, #f5f7fb 45%, #ffffff 100%);
  color: #1f2933;
}

/* smoother text */
body, input, button {
  -webkit-font-smoothing: antialiased;
}

/* ===== 4) TOP HEADER ===== */
.top-header {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  backdrop-filter: blur(10px);
  color: var(--text-color);
}

.top-header .contact-link {
  color: var(--text-color);
  text-decoration: none;
  position: relative;
  font-weight: 500;
}

.top-header .contact-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #1d4ed8, #0ea5e9);
  transition: width 0.2s ease-out;
}

.top-header .contact-link:hover::after {
  width: 100%;
}

/* (optional) keeps icon + text spacing consistent for the rotator link */
#contact-rotator-wrap .contact-link{
  gap: .25rem;
}

/* ===== 5) UTILITIES (SHADOWS / SPACING) ===== */
.soft-shadow {
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.soft-shadow-top {
  box-shadow: 0 -4px 14px rgba(15, 23, 42, 0.06);
}

/* Page content spacing */
.page-content {
  padding-top: 1.4rem;
}

/* ===== 6) MAIN NAVBAR (NEW) ===== */
.main-navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: linear-gradient(120deg, #1d4ed8 0%, #0f766e 55%, #047857 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(16px);
}

.main-navbar .container {
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

/* Brand */
.brand-logo-wrap {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.4rem;
}

.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.school-name {
  font-size: 1.05rem;
  letter-spacing: 0.03em;
}

.school-tagline {
  font-size: 0.75rem;
  color: rgba(226, 232, 240, 0.9);
}

/* Nav links */
.nav-links .nav-link {
  position: relative;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding-inline: 1rem;
  color: rgba(241, 245, 249, 0.9);
}

.nav-links .nav-link:hover,
.nav-links .nav-link:focus {
  color: #ffffff;
}

.nav-link-animated::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.25rem;
  width: 0;
  height: 2px;
  border-radius: 999px;
  transform: translateX(-50%);
  background: #fbbf24;
  transition: width 0.25s ease-out;
}

.nav-link-animated:hover::after,
.nav-link-animated:focus::after,
.nav-links .nav-link.active::after {
  width: 60%;
}

/* Highlight pill for DigiServ */
.nav-pill-highlight {
  padding-inline: 1.1rem;
  margin-left: 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(248, 250, 252, 0.9);
  background: rgba(15, 23, 42, 0.22);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.18);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-pill-highlight:hover {
  background: rgba(15, 23, 42, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
}

/* Toggle */
.nav-toggle {
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
}

/* ===== 7) FOOTER (NEW - compact & uniform) ===== */
.site-footer {
  background: #0b1220; /* same family as your UI dark tones */
  color: rgba(226, 232, 240, 0.92);
  padding: .7rem 0;       /* smaller height */
  font-size: 0.85rem;     /* slightly smaller text */
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.site-footer .container {
  gap: .35rem !important; /* tighter spacing */
}

.site-footer span {
  opacity: 0.9;
  line-height: 1.3;
}

.footer-credit {
  font-weight: 600;
  font-size: 0.82rem;
  color: rgba(251, 191, 36, 0.9); /* matches your nav underline accent */
  letter-spacing: 0.02em;
}

/* mobile: center + tighter */
@media (max-width: 576px) {
  .site-footer {
    padding: .6rem 0;
    text-align: center;
    font-size: 0.82rem;
  }
  .footer-credit {
    font-size: 0.8rem;
  }
}

/* ===== 8) TOASTS ===== */
.toast-container{ margin-top:70px; }

@media (max-width:576px){
  .toast-container{
    margin-top:60px;
    right:.5rem !important;
    left:.5rem;
  }
}

/* ===== 9) REVEAL / SCROLL ANIMATIONS ===== */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.5s ease-out,
    transform 0.5s ease-out,
    box-shadow 0.3s ease-out;
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Card reveal hover */
.reveal-on-scroll.card,
.card.reveal-on-scroll {
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.card.reveal-on-scroll.is-visible:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.12);
}

/* ===== 10) SERVICES SECTION ===== */
.services-section {
  padding: 60px 0;
  background: #f5f7fb;
}

.services-header {
  margin-bottom: 2.5rem;
}

.services-header h2 {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
}

.services-kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 0.35rem;
}

.services-title {
  font-size: clamp(1.6rem, 2.4vw, 2rem);
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: #111827;
}

.services-underline {
  width: 64px;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #f97316);
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.services-subtitle {
  max-width: 540px;
  margin: 0 auto;
  font-size: 0.95rem;
  color: #6b7280;
}

/* Grid layout */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.75rem;
}

/* One item wrapper */
.service-item {
  text-decoration: none;
  color: inherit;
}

/* Card */
.service-card {
  height: 100%;
  background: #ffffff;
  border-radius: 1.5rem;
  padding: 1.9rem 1.9rem 2.1rem;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  transform-origin:center;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

/* Disabled/future state */
.service-card-disabled {
  opacity: 0.7;
  cursor: default;
}

/* Circular icon container */
.service-icon {
  width: 125px;
  height: 125px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 0%, #ffffff, #e5edff);
  box-shadow: 0 10px 25px rgba(37, 99, 235, .25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.service-icon img {
  max-width: 78%;
  max-height: 78%;
  object-fit: contain;
}

/* Text */
.service-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
  color: #111827;
}

.service-label {
  font-size: 0.95rem;
  line-height: 1.4;
  color: #6b7280;
  margin-bottom: 0.75rem;
}

/* CTA */
.service-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #2563eb;
}

/* Hover effects */
.service-item:hover .service-icon {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.service-item:hover .service-card:not(.service-card-disabled) {
  transform: translateY(-4px);
  box-shadow: 0 24px 55px rgba(15, 23, 42, 0.14);
}

.service-item:hover .service-card:not(.service-card-disabled) .service-cta {
  color: #1d4ed8;
}

/* ===== 11) MODALS / BUTTONS (GLOBAL UI) ===== */
.modal-header{ background-color:var(--primary-color); }

.btn-primary{
  background-color:var(--primary-color);
  border-color:var(--primary-color);
}
.btn-primary:hover{
  background-color:#a83232;
  border-color:#a83232;
}

.form-text a{
  color:var(--primary-color);
  font-weight:500;
}
.form-text a:hover{
  text-decoration:underline;
}

/* ===== 12) PAGE-LOAD ANIMATIONS ===== */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.985); }
  to   { opacity: 1; transform: scale(1); }
}

.animate-fade-down {
  animation: fadeDown 0.5s ease-out forwards;
  opacity: 0;
}

.animate-fade-up {
  animation: fadeUp 0.5s ease-out forwards;
  opacity: 0;
}

.animate-fade-in {
  animation: fadeIn 0.55s ease-out forwards;
  opacity: 0;
}

/* Delay helpers */
.animation-delay-1 { animation-delay: 0.12s; }
.animation-delay-2 { animation-delay: 0.22s; }
.animation-delay-3 { animation-delay: 0.32s; }

/* ===== 12.5) TOP HEADER ICON ROTATOR (EMAIL -> FB -> YAHOO) ===== */
.icon-rotator{
  width: 1.1em;
  height: 1.1em;           /* shows 1 icon only */
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}

/* Pause slideshow when hovering the email/facebook/yahoo area */
#contact-rotator-wrap:hover .icon-track {
  animation-play-state: paused;
}

/* Smooth cross-fade for the changing text */
#contact-rotator-wrap .contact-text {
  display: inline-block;
  opacity: 1;
  transition: opacity 220ms ease;
}

#contact-rotator-wrap .contact-text.is-fading {
  opacity: 0;
}

.icon-track{
  display: flex;
  flex-direction: column;  /* stack icons vertically */
  align-items: center;
  will-change: transform;
  animation: iconSlideUp 6s infinite; /* 3 items x 2 seconds each */
}

.icon-track > i{
  height: 1.1em;
  line-height: 1.1em;
}

/* Synced to JS at 2s and 4s marks (33.333% and 66.666%) */
@keyframes iconSlideUp{
  /* 0s - 2s: show email */
  0%, 30% { transform: translateY(0); }
  33.333% { transform: translateY(-1.1em); }

  /* 2s - 4s: show facebook */
  33.333%, 63% { transform: translateY(-1.1em); }
  66.666% { transform: translateY(-2.2em); }

  /* 4s - 6s: show yahoo */
  66.666%, 96% { transform: translateY(-2.2em); }
  100% { transform: translateY(0); }
}


/* ===== 13) REDUCED MOTION SUPPORT ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }

  /* stop the top-bar slideshow too */
  .icon-track { animation: none !important; transform: none !important; }
}
