/* =========================================================
   Goodwill Learning Centre — Premium UI Layer
   Shared visual upgrade for public, student and admin pages.
   Loaded after the original styles so existing functionality
   and JavaScript hooks remain unchanged.
   ========================================================= */

:root {
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-dark: #3730a3;
  --accent: #f97316;
  --accent-foreground: #fff;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --background: #f6f7fb;
  --foreground: #111827;
  --card: #ffffff;
  --card-foreground: #111827;
  --muted: #eef1f7;
  --muted-foreground: #667085;
  --secondary: #f1f3f9;
  --secondary-foreground: #344054;
  --border: #e4e7ec;
  --input: #d0d5dd;
  --ring: #6366f1;
  --sidebar: #111827;
  --sidebar-foreground: #f9fafb;
  --sidebar-primary: #a5b4fc;
  --sidebar-accent: rgba(255,255,255,.08);
  --sidebar-border: rgba(255,255,255,.1);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --shadow: 0 8px 24px rgba(16,24,40,.07);
  --shadow-md: 0 16px 40px rgba(16,24,40,.10);
  --shadow-lg: 0 28px 70px rgba(16,24,40,.14);
}

html { scroll-behavior: smooth; }
body {
  background:
    radial-gradient(circle at 0 0, rgba(99,102,241,.055), transparent 26rem),
    radial-gradient(circle at 100% 12rem, rgba(249,115,22,.045), transparent 24rem),
    var(--background);
  color: var(--foreground);
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: rgba(99,102,241,.2); color: #1e1b4b; }
:focus-visible { outline: 3px solid rgba(99,102,241,.3); outline-offset: 3px; }

.container { width: min(100% - 2rem, 1400px); padding-inline: 0; }
h1,h2,h3,h4,h5,h6 { letter-spacing: -.035em; }
p { color: inherit; }

/* Buttons */
.btn {
  min-height: 42px;
  border-radius: 11px;
  padding: .68rem 1.05rem;
  font-weight: 650;
  box-shadow: none;
  transform: translateY(0);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, #6366f1, #4338ca);
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(79,70,229,.24);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #4f46e5, #3730a3);
  box-shadow: 0 12px 24px rgba(79,70,229,.3);
}
.btn-secondary { background: #f2f4f7; border-color: #eaecf0; }
.btn-outline { background: rgba(255,255,255,.8); border-color: #d0d5dd; }
.btn-outline:hover:not(:disabled), .btn-ghost:hover:not(:disabled) { background: #f2f4f7; }
.btn-destructive { box-shadow: 0 7px 16px rgba(239,68,68,.18); }
.btn-sm { min-height: 34px; border-radius: 9px; }
.btn-lg { min-height: 50px; padding-inline: 1.5rem; border-radius: 13px; }

/* Cards and common content */
.card,
.auth-card,
.stat-card,
.quick-action-card,
.content-card,
.form-card,
.info-panel-card,
.contact-info-card {
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(228,231,236,.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card:not(.form-as-modal) { overflow: hidden; }
.card:hover { box-shadow: var(--shadow); border-color: #d6d9e0; }
.card-content { padding: 1.4rem; }
.badge { padding: .28rem .65rem; border-radius: 999px; letter-spacing: .01em; }
.badge-primary { background: rgba(79,70,229,.1); color: #4338ca; }
.badge-success { background: rgba(16,185,129,.12); color: #047857; }
.badge-warning { background: rgba(245,158,11,.14); color: #b45309; }
.badge-destructive { background: rgba(239,68,68,.1); color: #b91c1c; }

/* Form controls */
.form-input,.form-select,.form-textarea,
input[type="text"],input[type="email"],input[type="password"],input[type="tel"],input[type="number"],input[type="date"],input[type="time"],input[type="url"],textarea,select {
  min-height: 45px;
  border-radius: 11px;
  border-color: #d0d5dd;
  background-color: #fff;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
textarea,.form-textarea { min-height: 110px; }
.form-input:hover,.form-select:hover,.form-textarea:hover,
input:hover,textarea:hover,select:hover { border-color: #98a2b3; }
.form-input:focus,.form-select:focus,.form-textarea:focus,
input:focus,textarea:focus,select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99,102,241,.12);
}
.form-label { margin-bottom: .48rem; font-weight: 650; color: #344054; }
.form-group { margin-bottom: 1.15rem; }
.form-checkbox { border-radius: 13px; background: #fafbff; }

/* Public header */
.public-header {
  height: auto;
  background: rgba(255,255,255,.82);
  border-bottom: 1px solid rgba(228,231,236,.75);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}
.public-header.scrolled { box-shadow: 0 8px 30px rgba(16,24,40,.08); }
.public-header-inner {
  width: min(100% - 2rem, 1400px);
  min-height: 74px;
  height: 74px;
  margin-inline: auto;
  padding-inline: 0;
  overflow: visible;
}
.public-logo { gap: .75rem; font-weight: 800; color: #111827; letter-spacing: -.03em; }
.public-logo img { width: 76px; height: 76px; border-radius: 0; box-shadow: none; object-fit: contain; }

/* Attractive brand text styling */
.public-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}
.public-logo-text strong {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}
.public-logo-text small {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #94a3b8;
  -webkit-text-fill-color: #94a3b8;
  white-space: nowrap;
  margin-top: -0.05rem;
}
.public-nav { padding: .3rem; border: 1px solid rgba(228,231,236,.7); border-radius: 13px; background: rgba(248,250,252,.7); }
.public-nav a { border-radius: 9px; color: #475467; padding: .55rem .82rem; font-weight: 600; }
.public-nav a:hover { color: #4338ca; background: #fff; }
.public-nav a.active { color: #4338ca; background: #fff; box-shadow: 0 2px 8px rgba(16,24,40,.07); }
.hamburger-btn { width: 42px; height: 42px; border-radius: 11px; border: 1px solid #e4e7ec; background: #fff; }
.mobile-menu { background: rgba(255,255,255,.98); box-shadow: -18px 0 45px rgba(16,24,40,.12); }
.mobile-menu-nav a { border-radius: 11px; font-weight: 650; }
.mobile-menu-nav a:hover,.mobile-menu-nav a.active { background: #eef2ff; color: #4338ca; }

/* Public hero and sections */
.dark-hero {
  background:
    radial-gradient(circle at 85% 15%, rgba(129,140,248,.3), transparent 30%),
    radial-gradient(circle at 8% 85%, rgba(249,115,22,.18), transparent 25%),
    linear-gradient(135deg, #111827 0%, #1e1b4b 52%, #312e81 100%);
  isolation: isolate;
}
.dark-hero::before,.dark-hero::after { opacity: .5; filter: blur(6px); }
.dark-hero-content { padding-top: clamp(2rem, 5vw, 4rem) !important; padding-bottom: clamp(2rem, 5vw, 4rem) !important; }
.dark-hero h1,.hero-title { font-size: clamp(2.35rem, 5.5vw, 4.6rem) !important; line-height: 1.02; max-width: 15ch; letter-spacing: -.055em; }
.dark-hero p { font-size: clamp(1rem, 1.5vw, 1.18rem); line-height: 1.75; }
.hero-badge,.section-badge { border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-radius: 999px; }
.hero-grid { gap: clamp(2rem,5vw,5rem); align-items: center; }
.hero-cards { gap: 1rem; }
.hero-card { border-radius: 22px !important; box-shadow: 0 20px 45px rgba(0,0,0,.18); border: 1px solid rgba(255,255,255,.12); }
.section-header { margin-bottom: 1.75rem; }
.section-header h2 { font-size: clamp(1.6rem,3vw,2.3rem) !important; }
main > section:not(.dark-hero) { position: relative; }
.course-card,.resource-card { border-radius: 18px; overflow: hidden; }
.course-card:hover,.resource-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

/* Public footer */
.public-footer {
  background: #0b1220;
  color: #cbd5e1;
  border-top: none;
  position: relative;
  overflow: hidden;
}
.public-footer::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.public-footer::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -5%;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249,115,22,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.public-footer * {
  position: relative;
  z-index: 1;
}
.public-footer-col-title,
.footer-col-title {
  color: #fff;
}
.public-footer a:hover,
.footer-links a:hover {
  color: #a5b4fc;
}
.footer-social a {
  border-radius: 11px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.08);
}
.footer-social a:hover {
  background: #4f46e5;
  color: #fff;
  transform: translateY(-2px);
}
.footer-bottom {
  border-top-color: rgba(255,255,255,.1);
}

/* Trust chip hover */
.trust-chip {
  transition: background 0.2s ease, transform 0.2s ease;
}
.trust-chip:hover {
  background: rgba(255,255,255,0.07);
  transform: translateY(-1px);
}

/* Contact icon hover */
.contact-item .contact-icon {
  transition: background 0.2s ease, color 0.2s ease;
}
.contact-item:hover .contact-icon {
  background: rgba(99,102,241,0.2);
  color: #a5b4fc;
}

/* Footer bottom dot separator */
.dot-sep {
  background: #334155;
}
.whatsapp-float { border-radius: 999px; box-shadow: 0 14px 30px rgba(16,185,129,.28); }

/* Authentication pages */
.auth-container { max-width: 31rem; padding-top: clamp(2rem,5vw,4.5rem); padding-bottom: 4rem; }
.auth-container.wide { max-width: 56rem; }
.auth-header h1 { font-size: clamp(1.85rem,4vw,2.5rem); }
.auth-header p { font-size: .98rem; }
.auth-card { padding: clamp(1.1rem,3vw,1.7rem); box-shadow: var(--shadow); }
.auth-footer { font-size: .82rem; }

/* Dashboard shell */
.dashboard-body { background: #f5f7fb; min-height: 100vh; }
.sidebar {
  background:
    radial-gradient(circle at 30% 0, rgba(99,102,241,.28), transparent 14rem),
    linear-gradient(180deg,#111827 0%,#0b1220 100%);
  border-right: 1px solid rgba(255,255,255,.08);
  box-shadow: 12px 0 34px rgba(16,24,40,.08);
}
.sidebar-brand { min-height: 74px; padding: 1rem 1.15rem; border-bottom-color: rgba(255,255,255,.09); font-weight: 800; letter-spacing: -.025em; }
.sidebar-brand-icon { width: 38px; height: 38px; padding: 8px; border-radius: 11px; color: #fff; background: linear-gradient(135deg,#818cf8,#4f46e5); box-shadow: 0 9px 20px rgba(79,70,229,.32); }
.sidebar-nav { padding: .9rem .75rem 1.25rem; }
.sidebar-section { padding: 1rem .65rem .45rem; color: #98a2b3; font-size: .66rem; letter-spacing: .13em; }
.sidebar-link { min-height: 43px; margin: .12rem 0; padding: .68rem .72rem; border-radius: 11px; color: #cbd5e1; font-weight: 560; }
.sidebar-link:hover { color: #fff; background: rgba(255,255,255,.075); transform: translateX(2px); }
.sidebar-link.active { color: #fff; background: linear-gradient(135deg,rgba(99,102,241,.92),rgba(79,70,229,.86)); box-shadow: 0 9px 18px rgba(49,46,129,.3); }
.sidebar-link-icon { width: 19px; height: 19px; }
.sidebar-footer { border-top-color: rgba(255,255,255,.09); }
.sidebar-toggle { border-radius: 11px; background: #fff; border: 1px solid #e4e7ec; box-shadow: var(--shadow-sm); }
.dashboard-header { min-height: 74px; background: rgba(255,255,255,.85); border-bottom: 1px solid rgba(228,231,236,.9); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.dashboard-header-title { font-weight: 800; letter-spacing: -.035em; }
.dashboard-main { padding: clamp(1rem,2.5vw,2rem); }
.dashboard-main > div:first-child h1,.page-header h1 { font-size: clamp(1.65rem,3vw,2.15rem); }
.content-grid { gap: 1.25rem; }
.stats-grid { gap: 1rem; }
.stat-card { transition: transform .18s ease, box-shadow .18s ease; overflow: hidden; position: relative; }
.stat-card::before { content:""; position:absolute; inset:0 auto 0 0; width:4px; background: linear-gradient(#818cf8,#4f46e5); }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-card-value { font-weight: 800; letter-spacing: -.045em; }
.stat-card-icon { border-radius: 13px; }
.quick-actions-grid { gap: .8rem; }
.quick-action-card { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.quick-action-card:hover { transform: translateY(-3px); border-color: #c7d2fe; box-shadow: var(--shadow); }
.quick-action-icon { border-radius: 13px; }
.page-header { margin-bottom: 1.4rem; }

/* Tables */
.table-responsive { border-radius: 15px; border: 1px solid #eaecf0; background: #fff; }
.data-table { border-collapse: separate; border-spacing: 0; }
.data-table thead { background: #f8fafc; }
.data-table th { padding: .9rem 1rem; font-size: .73rem; color: #667085; letter-spacing: .055em; border-bottom: 1px solid #eaecf0; }
.data-table td { padding: .92rem 1rem; border-bottom-color: #f0f2f5; }
.data-table tbody tr { transition: background .14s ease; }
.data-table tbody tr:hover { background: #fafbff; }
.data-table tbody tr:last-child td { border-bottom: 0; }

/* Tabs, alerts, modal, empty/loading states */
.tabs-list { border-radius: 12px; background: #eef1f7; padding: .3rem; }
.tabs-trigger { min-height: 39px; border-radius: 9px; font-weight: 650; }
.tabs-trigger.active { color: #4338ca; }
.alert { border-radius: 12px; border: 1px solid transparent; }
.modal-overlay { -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); background: rgba(15,23,42,.55); }
.modal { border: 1px solid rgba(255,255,255,.6); border-radius: 20px !important; box-shadow: var(--shadow-lg); }
.loading-spinner,.empty-state { min-height: 190px; }
.spinner { border-width: 3px; border-top-color: #6366f1; }

/* Page-specific common blocks */
.contact-info-card,.form-card,.info-panel-card { transition: transform .18s ease, box-shadow .18s ease; }
.contact-info-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.book-cover-placeholder { border-radius: 15px; }
.chart-container { border-radius: 14px; }

/* Gentle entrance animation without interfering with app code */
@keyframes premiumFadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
main > section,.dashboard-main > *:not(.form-as-modal),.auth-container { animation: premiumFadeUp .42s ease both; }
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Responsive refinements */
@media (max-width: 991px) {
  .public-header-inner { padding-top: 0.25rem; padding-bottom: 0.25rem; }
  .public-nav,.public-header-actions { display: none; }
  .hamburger-btn { display: inline-flex; }
  .public-logo-text strong { font-size: 1.7rem; }
  .public-logo-text small { font-size: 0.95rem; }
  .sidebar { box-shadow: 18px 0 45px rgba(16,24,40,.22); }
  .dashboard-main { padding: 1rem; }
}
@media (max-width: 767px) {
  .container { width: min(100% - 1.25rem, 1400px); }
  .public-header-inner { width: min(100% - 1.25rem, 1400px); }
  .public-logo img { width: 70px; height: 70px; border-radius: 0; box-shadow: none; object-fit: contain; }
  .public-logo-text strong { font-size: 1.7rem; }
  .public-logo-text small { font-size: 0.95rem; }
  .dark-hero-content { padding-top: 2.7rem !important; padding-bottom: 2.8rem !important; }
  .dark-hero h1,.hero-title { font-size: clamp(2.15rem,11vw,3.15rem) !important; }
  .hero-grid { gap: 2.2rem; }
  .hero-cards { width: 100%; }
  .hero-card { border-radius: 17px !important; }
  .card,.auth-card,.stat-card,.quick-action-card,.content-card,.form-card,.info-panel-card,.contact-info-card { border-radius: 16px; }
  .card-content { padding: 1.05rem; }
  .btn { min-height: 43px; }
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; }
  .dashboard-header { min-height: 64px; }
  .dashboard-main { padding: .8rem; }
  .stats-grid { gap: .75rem; }
  .stat-card::before { width: 3px; }
  .table-responsive { border-radius: 12px; }
}
@media (max-width: 479px) {
  .public-logo-text strong { font-size: 1.5rem; }
  .public-logo-text small { font-size: 0.85rem; letter-spacing: 0.1em; }
  .hero-cards { grid-template-columns: 1fr 1fr; }
  .hero-card-lg { grid-column: 1/-1; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card .card-content { padding: .85rem; }
  .stat-card-value { font-size: 1.3rem; }
  .quick-actions-grid { grid-template-columns: 1fr 1fr; }
}
