/*
 * assets/css/main.css
 * Bal Vatika Vidyalaya Smart School Theme
 *
 * WHY THIS FILE EXISTS:
 * functions.php enqueues 'bvv-main' pointing to BVV_ASSETS/css/main.css
 * and 'bvv-theme' (style.css) depends on it. Without this file WordPress
 * logs a 404 and the style.css dependency chain breaks on some servers.
 *
 * The complete CSS is in style.css (loaded after this file).
 * This file contains only supplemental / override styles that need
 * to load before style.css, primarily the image-size utilities and
 * admin notices that are safer here than in style.css.
 *
 * @package bal-vatika
 * @version 2.0.0
 */

/* ─── LOGO FALLBACK (used when custom logo not uploaded yet) ─── */
.logo-icon img[src$="logo.png"]:not([src]) {
  display: none;
}

/* ─── PAGE TEMPLATE HERO CONSISTENCY ─── */
.fees-hero, .payment-hero, .page-hero {
  background: linear-gradient(135deg, var(--green-dark, #1a4731), var(--green-mid, #256648));
  padding: 60px 24px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.fees-hero .hero-pattern,
.page-hero  .hero-pattern {
  position: absolute; inset: 0; opacity: 0.06;
  background-image: repeating-linear-gradient(
    45deg, rgba(255,255,255,0.5) 0px, rgba(255,255,255,0.5) 1px,
    transparent 1px, transparent 24px
  );
  pointer-events: none;
}

/* ─── PORTAL CLOSE BUTTON ─── */
.portal-modal-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none;
  font-size: 20px; color: #888;
  cursor: pointer; transition: color 0.2s;
}
.portal-modal-close:hover { color: var(--green-dark, #1a4731); }

/* ─── FEES TABS ─── */
.fees-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--gray-mid, #e0e6df); margin-bottom: 24px; }
.fees-tab {
  padding: 10px 20px; background: none; border: none;
  font-size: 14px; font-weight: 600; color: #888;
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; font-family: var(--font-body, 'Nunito Sans', sans-serif);
  transition: all 0.2s;
}
.fees-tab.active { color: var(--green-dark, #1a4731); border-bottom-color: var(--green-dark, #1a4731); }
.fees-panel { display: none; }
.fees-panel.active { display: block; }

/* ─── GALLERY GRID ─── */
.bvv-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.gallery-item { border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-sm, 0 2px 8px rgba(26,71,49,0.08)); }
.gallery-item img { width: 100%; height: 200px; object-fit: cover; display: block; }

/* ─── NOTICE TAG ADDITIONAL ─── */
.notice-tag.ptm { background: #fce4ec; color: #c2185b; }

/* ─── ADMISSION FORM ─── */
.adm-section-head {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--green-dark, #1a4731); font-weight: 800;
  margin-bottom: 14px; padding-bottom: 8px;
  border-bottom: 2px solid var(--gold, #c8922a);
}

/* ─── PAYMENT PORTAL PAGE ─── */
#bvv-receipt-section { display: none; }
#bvv-receipt-section.visible { display: block; }

/* ─── LEADERSHIP / MSG CARDS READ MORE ─── */
.msg-read-more {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--gold, #c8922a); font-size: 13px; font-weight: 700;
  margin-top: 12px;
}
.msg-read-more:hover { color: var(--green-mid, #256648); }

/* ─── BREADCRUMB ─── */
.breadcrumb { font-size: 13px; color: rgba(255,255,255,0.7); margin-top: 8px; }
.breadcrumb a { color: rgba(255,255,255,0.7); text-decoration: none; }
.breadcrumb a:hover { color: var(--gold-light, #f0c060); }
.breadcrumb span { margin: 0 4px; }

/* ─── POPUP TRIGGER BUTTON (shown on mobile homepage) ─── */
.bvv-popup-trigger {
  position: fixed; bottom: 80px; right: 20px; z-index: 9000;
  background: var(--gold, #c8922a); color: #fff;
  border: none; border-radius: 50px;
  padding: 10px 18px; font-size: 13px; font-weight: 700;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  cursor: pointer; display: none;
}
@media (max-width: 768px) {
  .bvv-popup-trigger { display: flex; align-items: center; gap: 6px; }
}

/* ─── PRINT FIXES ─── */
@media print {
  .bvv-popup-overlay, #bvv-popup-overlay, .bvv-back-top { display: none !important; }
}

/* ══════════════════════════════════════════════════════
   MOBILE HEADER CONTROLS (v2.2.0)
   Body classes injected by PHP control visibility
   ══════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  .bvv-hide-mobile-topbar .bvv-topbar { display: none !important; }
  .bvv-hide-mobile-phone  .topbar-left a[href^="tel"] { display: none !important; }
  .bvv-hide-mobile-email  .topbar-left a[href^="mailto"] { display: none !important; }
  .bvv-hide-mobile-adm    .topbar-admit-btn { display: none !important; }
  .bvv-hide-mobile-portal #portal-open-btn { display: none !important; }

  /* ── General mobile fixes 320px–767px ── */
  .bvv-topbar .inner {
    flex-direction: column;
    gap: 6px;
    padding: 8px 14px;
    font-size: 11px;
  }
  .topbar-left { flex-wrap: wrap; gap: 8px; justify-content: center; }
  .topbar-right { justify-content: center; }
  .topbar-social { gap: 8px; }
  .topbar-admit-btn { font-size: 11px !important; padding: 5px 10px !important; }

  .header-inner {
    padding: 10px 14px;
    gap: 10px;
  }
  .logo-icon { width: 44px !important; height: 44px !important; }
  .logo-text h1 { font-size: 14px !important; }
  .logo-text .tagline { font-size: 10px !important; display: none; }

  .header-cta .btn-label-text { display: none; }
  .header-cta::after { content: "💳"; }
  #portal-open-btn .btn-label-text { display: none; }
  #portal-open-btn::after { content: "🏫"; }

  .main-nav { font-size: 14px; }
  .main-nav > li > a { padding: 12px 16px; }

  /* Hero section */
  .bvv-hero { min-height: 420px !important; }
  .hero-content h1 { font-size: clamp(1.6rem, 6vw, 2.4rem) !important; }
  .hero-btns { flex-direction: column; gap: 10px; }
  .hero-btns .btn { width: 100%; text-align: center; justify-content: center; }

  /* Notices grid */
  .notices-grid { grid-template-columns: 1fr !important; }

  /* Leadership cards */
  .leadership-grid { grid-template-columns: 1fr !important; }
  .leadership-msg { display: block !important; max-height: none !important; }

  /* Gallery grid */
  .gallery-grid { grid-template-columns: 1fr 1fr !important; }

  /* Contact grid */
  .contact-info-grid { grid-template-columns: 1fr !important; }
  .contact-form-grid { grid-template-columns: 1fr !important; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr !important; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }

  /* Forms */
  .form-grid { grid-template-columns: 1fr !important; }
  input, select, textarea { font-size: 16px !important; } /* prevents iOS zoom */

  /* Uniform cards */
  .uniform-grid { grid-template-columns: 1fr !important; }

  /* Vision mission cards */
  #vision-mission > .container > div { grid-template-columns: 1fr !important; }

  /* Smart portal cards */
  #smart-portal > .container > div { grid-template-columns: 1fr 1fr !important; }

  /* Leadership detail pages */
  .container > div[style*="grid-template-columns:300px"] {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 425px) {
  /* 320px–425px fine tuning */
  .hero-content h1 { font-size: 1.5rem !important; }
  .section-title  { font-size: 1.5rem !important; }
  #smart-portal > .container > div { grid-template-columns: 1fr !important; }
  .gallery-grid { grid-template-columns: 1fr !important; }
  .portal-modal { padding: 20px 14px !important; }
}

@media (min-width: 768px) and (max-width: 1024px) {
  /* Tablet 768px–1024px */
  .header-inner { gap: 12px; }
  .logo-text .tagline { font-size: 10px; }
  .hero-content h1 { font-size: clamp(1.8rem, 4vw, 2.6rem) !important; }
  .notices-grid  { grid-template-columns: 1fr 1fr !important; }
  .footer-grid   { grid-template-columns: 1fr 1fr !important; }
  .container > div[style*="grid-template-columns:300px"] {
    grid-template-columns: 260px 1fr !important;
  }
}

/* ══════════════════════════════════════════════════════
   LEADERSHIP PAGES — RESPONSIVE LAYOUT (v2.2.3)
   .bvv-leader-layout: side-by-side on desktop, stacked on mobile
   ══════════════════════════════════════════════════════ */
.bvv-leader-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 48px;
  align-items: start;
}
.bvv-leader-sidebar {
  position: sticky;
  top: 100px;
}
@media (max-width: 768px) {
  .bvv-leader-layout {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }
  .bvv-leader-sidebar {
    position: static !important;
    max-width: 340px;
    margin: 0 auto;
  }
  .bvv-leader-body blockquote {
    font-size: 18px !important;
  }
}

/* ══════════════════════════════════════════════════════
   ERP PORTAL MODAL — Z-INDEX FIX (v2.2.3)
   Ensures modal always sits above all other elements
   ══════════════════════════════════════════════════════ */
#bvv-portal-modal {
  z-index: 99999 !important;
}

/* ══════════════════════════════════════════════════════
   STUDENT / TEACHER PORTAL — MOBILE (v2.2.4)
   ══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .bvv-stat-grid { grid-template-columns: repeat(2,1fr) !important; gap: 8px !important; }
  .bvv-dash-grid { grid-template-columns: 1fr !important; gap: 12px !important; }

  /* Tab bar scrollable on mobile */
  .fees-tab { font-size: 12px !important; padding: 10px 12px !important; white-space: nowrap; }

  /* Header compact */
  .fees-hero .container { flex-direction: column !important; align-items: flex-start !important; }

  /* Payment portal grid */
  div[style*="grid-template-columns:280px 1fr"] {
    grid-template-columns: 1fr !important;
  }
  div[style*="grid-template-columns:1fr 1fr"][class*="form"] {
    grid-template-columns: 1fr !important;
  }

  /* Month select responsive */
  #bvv-month-list > div { flex-direction: column !important; gap: 6px !important; }

  /* Fee table horizontal scroll */
  .fee-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .fee-table { min-width: 480px; }

  /* Teacher portal student cards */
  .tch-student-list > div { padding: 12px !important; }
}

@media (max-width: 425px) {
  .bvv-stat-grid { grid-template-columns: 1fr 1fr !important; }
  .fees-hero h1 { font-size: 1.2rem !important; }
  .fees-tab { font-size: 11px !important; padding: 9px 10px !important; }
}

/* ══════════════════════════════════════════════════════
   PAYMENT PORTAL — MOBILE (v2.2.5)
   ══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .bvv-pay-layout {
    grid-template-columns: 1fr !important;
    padding: 20px 14px 50px !important;
    gap: 18px !important;
  }
  /* Left info card: make compact on mobile */
  .bvv-pay-layout > div:first-child {
    padding: 20px !important;
  }
  .bvv-pay-layout > div:first-child h3 { font-size: 15px !important; }
  .bvv-pay-layout > div:first-child img { width: 48px !important; height: 48px !important; }
  /* Right form: full width */
  .bvv-pay-layout > div:last-child { width: 100%; }
  /* Form grid: 1 col on mobile */
  .bvv-pay-layout div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  /* Buttons stack */
  .bvv-pay-layout div[style*="display:flex;gap:12px"] {
    flex-direction: column !important;
    gap: 10px !important;
  }
  .bvv-pay-layout .btn { width: 100% !important; justify-content: center; }
}
