/* ==========================================================================
   CONNECTUS - MASTER GLOBAL CSS
   This file powers the animations, scrollbars, and shared behaviors for 
   all portals. Specific colors (Admin Blue, Teacher Emerald, etc.) are 
   handled by Tailwind in the HTML.
   ========================================================================== */

/* ── 1. FONTS & SCROLLBARS ── */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

html, body { margin: 0; padding: 0; width: 100%; height: 100%; }
* { font-family: 'Nunito', sans-serif; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── 2. GLOBAL ANIMATIONS ── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes cardUp { from { opacity: 0; transform: translateY(36px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes orbFloat { 0% { transform: translateY(0) scale(1); } 50% { transform: translateY(-35px) scale(1.08); } 100% { transform: translateY(0) scale(1); } }
@keyframes float { 0% { transform: translateY(0px) rotate(0deg); } 33% { transform: translateY(-18px) rotate(1deg); } 66% { transform: translateY(-8px) rotate(-1deg); } 100% { transform: translateY(0px) rotate(0deg); } }
@keyframes shimmer { 0% { box-shadow: 0 0 0 0 rgba(59,130,246,0); } 50% { box-shadow: 0 0 60px 20px rgba(59,130,246,0.18); } 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0); } }
@keyframes logoGlow { 0% { filter: drop-shadow(0 0 0px rgba(59,130,246,0)); } 50% { filter: drop-shadow(0 0 26px rgba(59,130,246,0.75)) drop-shadow(0 0 55px rgba(6,182,212,0.35)); } 100% { filter: drop-shadow(0 0 0px rgba(59,130,246,0)); } }
@keyframes logoBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes pulseGlow { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); } 70% { box-shadow: 0 0 0 6px rgba(239,68,68,0); } 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(32px); } to { opacity: 1; transform: translateY(0); } }

/* Animation Triggers */
.animate-float { animation: float 5s ease-in-out infinite; }
.logo-glow { animation: shimmer 4s ease-in-out infinite; border-radius: 9999px; }
.logo-bob { animation: logoBob 4s ease-in-out infinite; }
.scroll-bounce { animation: bounce 1.8s ease-in-out infinite; }
.view-section:not(.hidden) { animation: fadeIn 0.28s ease; }
.login-card { animation: cardUp 0.65s cubic-bezier(0.34, 1.2, 0.64, 1) 0.25s both; }

/* ── 3. SHARED STRUCTURAL CLASSES (Landing, Orbs, UI) ── */
.orb, .blob { position: absolute; border-radius: 50%; pointer-events: none; }
.blob { filter: blur(80px); opacity: 0.35; }

/* Buttons & Inputs */
.back-btn { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.18); font-size: 0.8rem; font-weight: 700; padding: 8px 16px; border-radius: 999px; transition: all 0.2s; text-decoration: none; backdrop-filter: blur(6px); }
.back-btn:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }

.form-input, .login-input { outline: none; font-family: 'Nunito', sans-serif; transition: all 0.2s, box-shadow 0.2s; }
.form-input:disabled { background-color: #f1f5f9; color: #64748b; cursor: not-allowed; border-color: #e2e8f0; }

.qa-btn { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-radius: 16px; font-weight: 800; font-size: 0.85rem; transition: all 0.2s cubic-bezier(0.34, 1.2, 0.64, 1); border: 2px solid transparent; text-align: left; }
.qa-btn:hover { transform: translateY(-3px) scale(1.02); }
.qa-btn .qa-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }

/* Cards & Navigation */
.stat-card { position: relative; overflow: hidden; transition: transform 0.22s, box-shadow 0.22s; }
.stat-card:hover { transform: translateY(-5px); box-shadow: 0 18px 45px rgba(0, 0, 0, 0.15); }

.nav-item { transition: all 0.18s ease; border-radius: 12px; position: relative; }
.nav-item:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }

.portal-card { background: #fff; border-radius: 20px; border: 2px solid transparent; transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); cursor: pointer; text-decoration: none; display: block; position: relative; overflow: hidden; }
.portal-card:hover { transform: translateY(-8px) scale(1.02); box-shadow: 0 20px 60px rgba(30, 58, 138, 0.15); }
.portal-card-admin:hover { border-color: #f97316; }
.portal-card-teacher:hover { border-color: #3b82f6; }
.portal-card-family:hover { border-color: #22c55e; }
.portal-icon { width: 68px; height: 68px; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 2rem; margin: 0 auto 1rem; transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.portal-card:hover .portal-icon { transform: scale(1.15) rotate(-3deg); }

/* ── 4. DATA TABLES, BADGES & STANDINGS ── */
.trow, .archive-student-row, .archive-subj-row { transition: background 0.12s; }
.gb-row { border-bottom: 1px solid #f1f5f9; transition: background 0.12s; }

.badge { font-size: 0.65rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; letter-spacing: 0.05em; text-transform: uppercase; }
.badge-active { background: #dcfce7; color: #15803d; }
.badge-archived { background: #fee2e2; color: #991b1b; }
.badge-pending { background: #fef3c7; color: #92400e; }
.new-badge { background: #ef4444; color: white; font-size: 0.55rem; font-weight: 900; padding: 2px 6px; border-radius: 6px; letter-spacing: 0.05em; animation: pulseGlow 2s infinite; text-transform: uppercase; margin-left: 8px; vertical-align: middle; }

/* Academic Standings Base Styles */
.s-exc { border: 1px solid #bbf7d0; }
.s-good { border: 1px solid #bfdbfe; }
.s-track { border: 1px solid #99f6e4; }
.s-attn { border: 1px solid #fde68a; }
.s-risk { border: 1px solid #fecaca; }
.s-none { border: 1px solid #e2e8f0; }

.dist-bar { height: 28px; border-radius: 10px; overflow: hidden; display: flex; }
.dist-seg { display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: white; min-width: 0; overflow: hidden; }

.danger-zone { border: 1.5px solid #fecaca; border-radius: 16px; background: #fff5f5; }

/* ── 5. PANELS & OVERLAYS ── */
.side-panel { transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1); }
.overlay { transition: opacity 0.25s; }
.subject-body { overflow: hidden; transition: max-height 0.35s ease; max-height: 0; }
.subject-body.open { max-height: 4000px; }

/* ── 6. PRINT STYLES ── */
@media print {
  #sidebar, .topbar, .no-print, button, .navbar, .hero-section, footer { display: none !important; }
  #dashboardMain { height: auto !important; overflow: visible !important; }
  body { background: white !important; overflow: visible !important; }
}
