/* style.css - TMRJC Barkas Boys Junior College - UPDATED VERSION */

/* ===== CSS Variables (Theme) ===== */
:root {
  /* Primary Colors */
  --bg: #0f172a;
  --panel: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --brand: #3b82f6;
  --brand-700: #1d4ed8;
  --accent: #22d3ee;
  
  /* Layout */
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --maxw: 1200px;
  
  /* NEW: Additional Colors */
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --border: rgba(255,255,255,.08);
}

/* ===== NEW: ALERT BAR STYLES ===== */
.alert-bar {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  padding: 10px 0;
  text-align: center;
  font-size: 0.95rem;
  position: relative;
  z-index: 1001;
}

.alert-bar .container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.alert-bar a {
  color: white;
  text-decoration: underline;
  font-weight: 600;
  margin-left: 5px;
}

.alert-bar a:hover {
  color: var(--accent);
}

.alert-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  margin-left: 15px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.alert-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ===== NEW: FLOATING CTA BAR ===== */
.floating-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(10px);
  border-top: 2px solid var(--brand);
  padding: 12px 0;
  z-index: 9999;
  box-shadow: 0 -5px 20px rgba(0,0,0,0.2);
  transform: translateY(0);
  transition: transform 0.3s ease;
}

.floating-cta.hide {
  transform: translateY(100%);
}

.floating-cta .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.cta-text {
  color: white;
  font-weight: 600;
  font-size: 1rem;
}

.cta-buttons {
  display: flex;
  gap: 10px;
}

.cta-btn {
  padding: 8px 20px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  text-decoration: none;
  transition: all 0.2s;
}

.cta-btn.primary {
  background: var(--brand);
  color: white;
  border: 2px solid var(--brand);
}

.cta-btn.primary:hover {
  background: var(--brand-700);
  border-color: var(--brand-700);
  text-decoration: none;
  transform: translateY(-2px);
}

.cta-btn.secondary {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.cta-btn.secondary:hover {
  background: white;
  color: var(--bg);
  text-decoration: none;
  transform: translateY(-2px);
}

/* ===== BASE STYLES ===== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: linear-gradient(180deg, var(--bg), #0b142c);
  color: var(--text);
  font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
}

img, svg { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== ACCESSIBILITY ===== */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: -999;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  overflow: auto;
  background: var(--bg);
  color: var(--accent);
  padding: 12px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  z-index: 9999;
}

/* ===== PRINT STYLES ===== */
@media print {
  .topbar, .navbar, .footer, .hero-stats, .hero-cta, .hamburger,
  .alert-bar, .floating-cta {
    display: none !important;
  }
  body {
    background: white !important;
    color: black !important;
  }
  .card {
    border: 1px solid #ddd !important;
    background: white !important;
    box-shadow: none !important;
  }
  a {
    color: #0000EE !important;
    text-decoration: underline !important;
  }
}

/* ===== TOPBAR ===== */
.topbar {
  background: #0a1226;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.topbar .container {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 20px;
}
.topbar-item { color: var(--muted); }
.topbar-sep { color: rgba(255,255,255,.15); }

/* ===== NAVBAR ===== */
.navbar {
  backdrop-filter: saturate(140%) blur(10px);
  background: rgba(10, 15, 30, 0.6);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border);
}
.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  position: relative;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.brand-mark {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  font-weight: 700;
  letter-spacing: .5px;
  padding: 8px 10px;
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.brand-text {
  display: grid;
  line-height: 1.2;
}
.brand-text span {
  color: var(--muted);
  font-size: 12px;
}

/* ===== NAV MENU ===== */
.nav-menu {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav-menu::-webkit-scrollbar {
  display: none;
}

.nav-link {
  color: var(--text);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.nav-link:hover {
  background: rgba(255,255,255,.08);
  text-decoration: none;
}
.nav-link.active {
  color: #fff;
  background: rgba(59,130,246,.18);
}

/* ===== HAMBURGER MENU ===== */
.hamburger {
  display: none;
  position: relative;
  width: 38px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 10px;
}
.hamburger span {
  position: absolute;
  left: 8px;
  right: 8px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
}
.hamburger span:nth-child(1) { top: 9px; }
.hamburger span:nth-child(2) { top: 16px; }
.hamburger span:nth-child(3) { top: 23px; }

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
  top: 16px;
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
  top: 16px;
}

/* ===== HERO SECTION ===== */
.hero {
  position: relative;
  overflow: hidden;
  padding: 64px 0 36px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.hero-bg {
  position: absolute;
  inset: -30% -10% 0 -10%;
  background:
    radial-gradient(600px 300px at 5% 10%, rgba(59,130,246,.25), transparent 60%),
    radial-gradient(600px 300px at 95% 10%, rgba(34,211,238,.25), transparent 60%);
  z-index: -1;
}
.hero-content { text-align: center; }
.hero-pill {
  display: inline-block;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  background: rgba(59,130,246,.2);
  border: 1px solid rgba(59,130,246,.35);
  padding: 6px 10px;
  border-radius: 999px;
}
.hero-title {
  margin: 16px auto 10px;
  max-width: 880px;
  font-size: clamp(28px, 4.2vw, 44px);
  font-weight: 700;
  color: #fff;
}
.hero-sub {
  margin: 0 auto 18px;
  max-width: 820px;
  color: var(--muted);
  font-size: clamp(15px, 2.1vw, 18px);
}
.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 14px;
}
.hero-highlights {
  margin: 18px auto 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

/* ===== HERO STATS ===== */
.hero-stats {
  margin-top: 24px;
}
.hero-stats .card {
  text-align: center;
  padding: 30px 20px;
}
.hero-stats .card div[class^="counter-"] {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
  line-height: 1;
  animation: countUp 0.5s ease forwards;
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-stats .card h3 {
  font-size: 1.3rem;
  margin: 10px 0;
  color: #fff;
}
.hero-stats .card p {
  font-size: 0.95rem;
  color: var(--muted);
  margin-top: 8px;
}

/* ===== SECTIONS ===== */
.section { padding: 64px 0; }
.section.alt { background: rgba(255,255,255,.03); }
.section-head {
  text-align: center;
  margin-bottom: 28px;
}
.section-head h2 {
  margin: 0;
  font-size: clamp(22px, 3.6vw, 32px);
  color: #fff;
  font-weight: 700;
}
.section-head p {
  margin: 10px auto 0;
  max-width: 760px;
  color: var(--muted);
}

/* ===== GRID SYSTEM ===== */
.grid {
  display: grid;
  gap: 18px;
}
.grid-2 {
  grid-template-columns: repeat(2, minmax(300px, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(3, minmax(240px, 1fr));
}
.grid-4 {
  grid-template-columns: repeat(4, minmax(220px, 1fr));
}

/* ===== CARDS ===== */
.card {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card h3 {
  margin: 2px 0 6px;
  font-size: 18px;
  color: #fff;
}
.card p {
  margin: 0;
  color: var(--muted);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(0,0,0,.4);
}

.grid .card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card-full {
  margin-top: 24px;
  grid-column: 1 / -1;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .12s ease, background .12s ease;
  text-decoration: none;
}
.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}
.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand-700);
}
.btn-primary:hover {
  background: var(--brand-700);
}
.btn-outline {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,.28);
}
.btn-outline:hover {
  background: rgba(255,255,255,.08);
}

/* ===== FORMS ===== */
label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--text);
}
input,
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-family: inherit;
  font-size: 16px; /* Prevents iOS zoom */
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(59,130,246,.25);
}
textarea {
  min-height: 120px;
  resize: vertical;
}

.contact-form {
  margin-top: 20px;
}

.contact-form .error input,
.contact-form .error textarea,
.contact-form .error select {
  border-color: var(--error);
}

.error-message {
  color: var(--error);
  font-size: 0.875rem;
  margin-top: 5px;
}

/* ===== GALLERY ===== */
.gallery-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gallery-grid .card {
  cursor: pointer;
  padding: 0;
  overflow: hidden;
}

.gallery-grid .card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-grid .card:hover img {
  transform: scale(1.05);
}

.gallery-grid .card h3,
.gallery-grid .card p {
  padding: 15px;
}

.gallery-grid .card p {
  padding-top: 0;
  padding-bottom: 15px;
}

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 1;
  transition: opacity 0.3s;
}

.lightbox.hide {
  display: none;
  opacity: 0;
}

.lightbox-inner {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-size: 2.5rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, transform 0.2s;
  z-index: 10001;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-size: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, transform 0.2s;
  z-index: 10001;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-50%) scale(1.05);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-caption {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  text-align: center;
  color: white;
  font-size: 1.1rem;
  padding: 12px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 0 0 12px 12px;
}

/* ===== FOOTER ===== */
.footer {
  padding: 32px 0 18px;
  border-top: 1px solid var(--border);
}
.footer-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 2fr 3fr;
}
.footer .brand-mark {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  font-weight: 700;
  display: inline-block;
  padding: 6px 10px;
  border-radius: 10px;
  margin-bottom: 8px;
}
.footer-nav {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, 1fr);
}
.footer-nav h4 {
  margin: 0 0 8px;
  color: #fff;
}
.footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-nav a { color: var(--text); }
.footer-bottom {
  margin-top: 10px;
  color: var(--muted);
  text-align: center;
}
.muted { color: var(--muted); }

/* ===== UTILITY CLASSES ===== */
.hidden {
  display: none;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Medium screens (1100px and below) */
@media (max-width: 1100px) {
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--panel);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    flex-direction: column;
    padding: 15px;
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    z-index: 100;
    max-height: 70vh;
    overflow-y: auto;
  }
  
  .nav-menu.show {
    display: flex;
  }
  
  .hamburger {
    display: inline-block;
  }
  
  .nav-link {
    padding: 12px 15px;
    font-size: 15px;
    width: 100%;
    text-align: left;
  }
  
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-nav {
    grid-template-columns: 1fr;
  }
}

/* Tablets (768px and below) */
@media (max-width: 768px) {
  .hero-highlights {
    grid-template-columns: 1fr !important;
  }
  
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  
  .gallery-grid .card img {
    height: 220px;
  }
  
  .floating-cta .container {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
  
  .cta-buttons {
    width: 100%;
    justify-content: center;
  }
  
  .alert-bar {
    font-size: 0.85rem;
    padding: 8px 0;
  }
  
  .alert-bar .container {
    flex-direction: column;
    gap: 5px;
  }
  
  .alert-close {
    position: absolute;
    top: 5px;
    right: 10px;
    margin: 0;
  }
  
  /* Mobile touch improvements */
  .nav-link, .btn, .cta-btn {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Lightbox mobile adjustments */
  .lightbox-prev,
  .lightbox-next {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
  
  .lightbox-close {
    width: 40px;
    height: 40px;
    font-size: 2rem;
    top: 10px;
    right: 10px;
  }
  
  .lightbox-image {
    max-height: 70vh;
  }
  
  .lightbox-caption {
    font-size: 0.9rem;
    padding: 8px;
    bottom: 10px;
  }
}

/* Very small screens (480px and below) */
@media (max-width: 480px) {
  .brand-text span {
    display: none;
  }
  
  .brand {
    gap: 8px;
  }
  
  .hero {
    padding: 48px 0 24px;
  }
  
  .section {
    padding: 48px 0;
  }
  
  .container {
    padding: 0 15px;
  }
}

/* ===== IMAGE FALLBACK STYLES ===== */
img[src*="placeholder.com"] {
  opacity: 0.8;
  filter: grayscale(20%);
}

/* ===== LOADING STATES ===== */
.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  transform: translate(-50%, -50%);
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.lightbox-image.loading {
  opacity: 0.5;
}

/* ===== FORM SUCCESS STATES ===== */
.contact-form .success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid #22c55e;
  color: #22c55e;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.contact-form button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===== ADDITIONAL UTILITIES ===== */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
