/* ============================================================
   components.css — Navbar, Footer, Cards, Buttons, Shared UI
   Wekan Kasarani School, Mwiki
   ============================================================ */

/* ===================== NAVBAR ===================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-dark);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.35);
  transition: background var(--transition);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}

.nav-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.nav-logo-text .school-name {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--primary);
  letter-spacing: 0.01em;
}

.nav-logo-text .school-sub {
  font-family: 'Roboto', sans-serif;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.05em;
}

/* Nav Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-links a {
  padding: 0.5rem 0.85rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.82);
  border-radius: 6px;
  transition: all var(--transition);
  position: relative;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0.85rem;
  right: 0.85rem;
  height: 2px;
  background: var(--primary);
  border-radius: 99px;
}

/* Right side controls */
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
}

.lang-toggle button {
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.65);
  padding: 0.35rem 0.65rem;
  min-height: 32px;
  transition: all var(--transition);
}

.lang-toggle button.active {
  background: var(--primary);
  color: var(--bg-dark);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: background var(--transition);
}

.hamburger:hover { background: rgba(255,255,255,0.08); }

.hamburger span {
  display: block;
  height: 2px;
  background: var(--text-light);
  border-radius: 99px;
  transition: all var(--transition);
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile Nav Menu */
.mobile-nav {
  display: none;
  flex-direction: column;
  position: absolute;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: #1f1600;
  border-top: 2px solid var(--primary);
  padding: 1rem 1.5rem 1.5rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 999;
  animation: slideDown 0.22s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mobile-nav.open { display: flex; }

.mobile-nav a {
  padding: 0.75rem 0.5rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: rgba(255,255,255,0.85);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: color var(--transition);
}

.mobile-nav a:hover,
.mobile-nav a.active { color: var(--primary); }

.mobile-nav .mobile-lang {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.5rem;
}

.mobile-nav .mobile-lang button {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
  min-height: 44px;
}

.mobile-nav .mobile-lang button.active {
  background: var(--primary);
  color: var(--bg-dark);
  border-color: var(--primary);
}

/* ===================== FOOTER ===================== */
.footer {
  background: var(--bg-dark);
  color: rgba(255,255,255,0.75);
  padding: 3.5rem 0 0;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand .school-name-footer {
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.footer-brand p {
  font-size: 0.88rem;
  line-height: 1.65;
  margin-bottom: 1.2rem;
  color: rgba(255,255,255,0.6);
}

.social-links {
  display: flex;
  gap: 0.65rem;
}

.social-links a {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  transition: all var(--transition);
}

.social-links a:hover {
  background: var(--primary);
  color: var(--bg-dark);
  border-color: var(--primary);
}

.footer-col h4 {
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.footer-col ul li {
  margin-bottom: 0.5rem;
}

.footer-col ul li a {
  color: rgba(255,255,255,0.65);
  font-size: 0.88rem;
  transition: color var(--transition);
}

.footer-col ul li a:hover { color: var(--primary); }

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.65);
}

.footer-contact-item i {
  color: var(--primary);
  margin-top: 0.2rem;
  flex-shrink: 0;
  width: 16px;
}

.footer-bottom {
  text-align: center;
  padding: 1.25rem 0;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.4);
}

/* ===================== CARDS ===================== */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--accent);
}

.card-img-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--accent) 0%, #ffe87e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--primary-darker, #b8960a);
}

.card-body {
  padding: 1.4rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-meta {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.card-meta i { color: var(--primary-dark); }

.card-body h3 {
  margin-bottom: 0.6rem;
  font-size: 1.1rem;
  color: var(--bg-dark);
}

.card-body p {
  color: #555;
  font-size: 0.93rem;
  flex: 1;
  margin-bottom: 1rem;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.87rem;
  color: var(--primary-deeper);
  transition: gap var(--transition), color var(--transition);
}

.card-link:hover {
  gap: 0.6rem;
  color: var(--primary-dark);
}

/* Grid layouts */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 2rem;
}

.cards-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.75rem;
}

/* ===================== STAT BAR ===================== */
.stat-bar {
  background: var(--primary);
  padding: 1.5rem 0;
}

.stat-bar .container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
}

.stat-item {
  flex: 1;
  min-width: 150px;
  text-align: center;
  padding: 0.5rem 1.5rem;
  border-right: 1px solid rgba(0,0,0,0.12);
}

.stat-item:last-child { border-right: none; }

.stat-number {
  font-family: 'Poppins', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--bg-dark);
  line-height: 1;
}

.stat-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(0,0,0,0.65);
  margin-top: 0.2rem;
}

/* ===================== ACCORDION (FAQ) ===================== */
.accordion-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
  background: var(--bg-light);
  border: none;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.97rem;
  color: var(--text-main);
  text-align: left;
  transition: background var(--transition);
  min-height: 44px;
}

.accordion-header:hover { background: var(--accent); }

.accordion-header i {
  color: var(--primary-deeper);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.accordion-item.open .accordion-header i {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  background: #fff;
}

.accordion-item.open .accordion-body {
  max-height: 600px;
  padding: 1rem 1.25rem 1.25rem;
}

.accordion-body p,
.accordion-body ul {
  color: #555;
  font-size: 0.93rem;
  margin-bottom: 0;
}

.accordion-body ul {
  padding-left: 1.2rem;
  list-style: disc;
}

/* ===================== TABLE ===================== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

thead {
  background: var(--bg-dark);
  color: var(--primary);
}

thead th {
  padding: 1rem 1.2rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--accent); }

tbody td {
  padding: 0.85rem 1.2rem;
  color: var(--text-main);
  vertical-align: top;
}

/* ===================== EVENT BADGE ===================== */
.event-item {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

.event-item:last-child { border-bottom: none; }

.event-date-badge {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.event-date-badge .day {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--bg-dark);
}

.event-date-badge .month {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--bg-dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.event-info h4 {
  color: var(--bg-dark);
  margin-bottom: 0.2rem;
  font-size: 0.97rem;
}

.event-info p {
  color: #777;
  font-size: 0.85rem;
  margin-bottom: 0;
}

/* ===================== STEP PROCESS ===================== */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}

.step-item {
  text-align: center;
  padding: 1.5rem 1rem;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  position: relative;
}

.step-number {
  width: 52px;
  height: 52px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--bg-dark);
  margin: 0 auto 1rem;
  box-shadow: 0 4px 12px rgba(255,215,0,0.35);
}

.step-item h3 {
  font-size: 1rem;
  color: var(--primary-deeper);
  margin-bottom: 0.5rem;
}

.step-item p {
  font-size: 0.88rem;
  color: #666;
  margin-bottom: 0;
}

/* ===================== CONTACT FORM ===================== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.87rem;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  font-family: 'Roboto', sans-serif;
  font-size: 0.95rem;
  color: var(--text-main);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  min-height: 44px;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,215,0,0.2);
}

textarea.form-control {
  resize: vertical;
  min-height: 130px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-feedback {
  font-size: 0.82rem;
  margin-top: 0.3rem;
  display: none;
}
.form-feedback.error { color: #d32f2f; display: block; }
.form-feedback.success { color: #2e7d32; display: block; }

/* Contact info card */
.contact-info-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.contact-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--bg-dark);
  flex-shrink: 0;
}

.contact-info-card h4 {
  margin-bottom: 0.25rem;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary-deeper);
}

.contact-info-card p,
.contact-info-card a {
  font-size: 0.94rem;
  color: #555;
  margin-bottom: 0;
}

/* ===================== SUBJECT CARDS ===================== */
.subject-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  background: #fff;
  border-radius: var(--radius);
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow);
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary-deeper);
  transition: transform var(--transition), box-shadow var(--transition);
}

.subject-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.subject-card i {
  color: var(--primary-dark);
  font-size: 1.05rem;
  width: 22px;
  text-align: center;
}

.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
}

/* ===================== VALUES STRIP ===================== */
.value-item {
  text-align: center;
  padding: 1.5rem 1rem;
}

.value-icon {
  width: 64px;
  height: 64px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--bg-dark);
  margin: 0 auto 1rem;
  box-shadow: 0 4px 16px rgba(255,215,0,0.3);
}

.value-item h3 {
  font-size: 1rem;
  color: var(--primary-deeper);
  margin-bottom: 0.35rem;
}

.value-item p {
  font-size: 0.87rem;
  color: #666;
  margin-bottom: 0;
}

/* ===================== GALLERY ===================== */
.gallery-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--accent);
  position: relative;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-item:hover img { transform: scale(1.06); }

.gallery-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent) 0%, #ffe87e 100%);
  color: var(--primary-deeper);
  font-size: 2rem;
  gap: 0.4rem;
}

.gallery-placeholder span {
  font-size: 0.78rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
}

/* ===================== CLASSROOM SLIDESHOW ===================== */
.gallery-item--slideshow {
  position: relative;
}

.gallery-item--slideshow .slideshow-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.7s ease;
}

.gallery-item--slideshow .slideshow-img.active {
  opacity: 1;
}

.gallery-slide-label {
  position: absolute;
  bottom: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 0.78rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  pointer-events: none;
  white-space: nowrap;
}

/* ===================== LEVEL TABS ===================== */
.level-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.level-tab {
  padding: 0.55rem 1.2rem;
  border-radius: 99px;
  border: 2px solid var(--border-color);
  background: #fff;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.87rem;
  color: #666;
  cursor: pointer;
  transition: all var(--transition);
  min-height: 44px;
}

.level-tab:hover,
.level-tab.active {
  background: var(--primary);
  color: var(--bg-dark);
  border-color: var(--primary);
}

/* ===================== ALERT / NOTICE ===================== */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.93rem;
}

.alert-info {
  background: #e8f4fd;
  border-left: 4px solid #1976d2;
  color: #0d47a1;
}

.alert i { flex-shrink: 0; margin-top: 0.1rem; }

/* ===================== MAP WRAPPER ===================== */
.map-wrapper {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 3px solid var(--border-color);
}

.map-wrapper iframe {
  display: block;
  width: 100%;
  height: 380px;
  border: none;
}
