/* ═══════════════════════════════════════════════════════════════
   St. Joseph's Alumni Meet — Digital Sinthanai Technologies
   Premium Design System
═══════════════════════════════════════════════════════════════ */

:root {
  --navy: #0d2b5e;
  --blue: #1a3a6b;
  --gold: #f0a500;
  --gold-light: #ffd166;
  --white: #ffffff;
  --off-white: #f8f9fc;
  --gray-100: #f1f3f7;
  --gray-200: #e2e6ed;
  --gray-600: #6b7280;
  --gray-800: #1f2937;
  --success: #10b981;
  --danger: #ef4444;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.10);
  --shadow-md: 0 4px 16px rgba(13,43,94,.12);
  --shadow-lg: 0 10px 40px rgba(13,43,94,.18);
  --radius: 14px;
  --radius-sm: 8px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--off-white);
  color: var(--gray-800);
  min-height: 100vh;
}

/* ── Typography ── */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }
.tamil { font-family: 'Latha', 'Nirmala UI', 'Segoe UI', sans-serif; }

/* ── Nav ── */
.navbar {
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  flex-shrink: 0;
}

.navbar-brand .logo-icon {
  width: 40px; height: 40px;
  background: var(--gold);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--navy);
  flex-shrink: 0;
}

.navbar-brand .brand-text { color: var(--white); }
.navbar-brand .brand-text .school { font-size: .7rem; opacity: .75; display: block; line-height: 1; }
.navbar-brand .brand-text .title { font-size: .95rem; font-weight: 700; }

.nav-links {
  display: flex;
  gap: .25rem;
  list-style: none;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links a {
  color: rgba(255,255,255,.82);
  text-decoration: none;
  padding: .45rem .85rem;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 500;
  transition: all .2s;
}
.nav-links a:hover, .nav-links a.active {
  background: rgba(255,255,255,.15);
  color: var(--white);
}

.badge-live {
  display: inline-block;
  background: var(--danger);
  color: #fff;
  font-size: .6rem;
  padding: 1px 5px;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: 3px;
  animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
  0%,100% { opacity: 1; }
  50% { opacity: .5; }
}

.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.hamburger span { display: block; width: 22px; height: 2px; background: #fff; margin: 5px 0; border-radius: 2px; transition: .3s; }

@media (max-width: 768px) {
  .hamburger { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--navy);
    padding: 1rem;
    flex-direction: column;
    align-items: stretch;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .75rem 1rem; border-radius: 8px; }
}

/* ── Hero ── */
.hero {
  background: linear-gradient(160deg, var(--navy) 0%, #1e4d8c 50%, #0d2b5e 100%);
  color: var(--white);
  padding: 4rem 1.5rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(240,165,0,.18) 0%, transparent 70%);
  top: -100px; right: -100px;
  border-radius: 50%;
}

.hero-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  font-size: .78rem;
  font-weight: 700;
  padding: .35rem 1rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: .5rem; }
.hero h1 span { color: var(--gold); }
.hero p { font-size: 1.1rem; opacity: .85; margin-bottom: 2rem; }

.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Countdown ── */
.countdown {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 2rem 0;
}

.countdown-box {
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  text-align: center;
  min-width: 90px;
}
.countdown-box .num {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}
.countdown-box .lbl {
  font-size: .72rem;
  opacity: .75;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-top: .25rem;
}

/* ── Stats Strip ── */
.stats-strip {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 1.5rem;
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}
.stat-item { text-align: center; }
.stat-item .stat-num { font-size: 1.8rem; font-weight: 800; color: var(--blue); line-height: 1; }
.stat-item .stat-lbl { font-size: .75rem; color: var(--gray-600); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.5rem;
  border-radius: 10px;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--gold);
  color: var(--navy);
}
.btn-primary:hover { background: #e09800; transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,.5);
}
.btn-outline:hover { background: rgba(255,255,255,.1); border-color: #fff; }

.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--navy); transform: translateY(-1px); }

.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }

.btn-sm { padding: .4rem 1rem; font-size: .82rem; }
.btn-lg { padding: .9rem 2rem; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Section ── */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.section-title {
  font-size: 1.6rem;
  color: var(--blue);
  margin-bottom: .5rem;
}
.section-sub { color: var(--gray-600); margin-bottom: 2rem; font-size: .95rem; }

/* ── Cards ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  transition: all .2s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-body { padding: 1.25rem; }

/* ── Alumni Grid ── */
.alumni-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.alumni-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  text-align: center;
  transition: all .2s;
  cursor: pointer;
}
.alumni-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }

.alumni-card .photo-wrap {
  position: relative;
  padding-top: 80%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
}
.alumni-card .photo-wrap img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.alumni-card .photo-wrap .initials {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--blue);
}

.alumni-card .checkin-badge {
  position: absolute;
  top: 8px; right: 8px;
  background: var(--success);
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: .7rem;
  font-weight: 700;
}

.alumni-card .info { padding: 1rem .75rem; }
.alumni-card .info h3 { font-size: 1rem; color: var(--gray-800); margin-bottom: .2rem; }
.alumni-card .info .job { font-size: .82rem; color: var(--blue); font-weight: 600; }
.alumni-card .info .city { font-size: .78rem; color: var(--gray-600); margin-top: .2rem; }
.alumni-card .info .fun-fact {
  font-size: .75rem;
  color: var(--gray-600);
  margin-top: .5rem;
  font-style: italic;
  border-top: 1px solid var(--gray-100);
  padding-top: .5rem;
}

/* ── Memory Wall ── */
.memories-grid {
  columns: 3 280px;
  gap: 1.25rem;
}

.memory-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  margin-bottom: 1.25rem;
  break-inside: avoid;
  transition: all .2s;
}
.memory-card:hover { box-shadow: var(--shadow-md); }
.memory-card img { width: 100%; display: block; max-height: 350px; object-fit: cover; }
.memory-card .memory-body { padding: 1rem; }
.memory-card .memory-author { font-weight: 700; color: var(--blue); font-size: .88rem; }
.memory-card .memory-caption { font-size: .9rem; margin: .4rem 0; color: var(--gray-800); }
.memory-card .memory-footer { display: flex; justify-content: space-between; align-items: center; margin-top: .75rem; }
.memory-card .memory-time { font-size: .72rem; color: var(--gray-600); }
.like-btn { background: none; border: none; cursor: pointer; display: flex; align-items: center; gap: .3rem; color: var(--gray-600); font-size: .82rem; transition: .2s; }
.like-btn:hover, .like-btn.liked { color: #e11d48; }

/* ── Chat ── */
.chat-wrap {
  display: flex;
  flex-direction: column;
  height: 500px;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.chat-msg {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
}
.chat-msg .avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
  overflow: hidden;
}
.chat-msg .avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-msg .bubble {
  background: var(--gray-100);
  border-radius: 0 12px 12px 12px;
  padding: .6rem .9rem;
  max-width: 80%;
}
.chat-msg .bubble .author { font-size: .72rem; font-weight: 700; color: var(--blue); margin-bottom: .2rem; }
.chat-msg .bubble .text { font-size: .92rem; word-break: break-word; }
.chat-msg .bubble .time { font-size: .68rem; color: var(--gray-600); margin-top: .25rem; }

.chat-msg.own { flex-direction: row-reverse; }
.chat-msg.own .bubble { background: var(--blue); color: #fff; border-radius: 12px 0 12px 12px; }
.chat-msg.own .bubble .author { color: var(--gold-light); }
.chat-msg.own .bubble .time { color: rgba(255,255,255,.6); }

.chat-input-wrap {
  border-top: 1px solid var(--gray-200);
  padding: .75rem 1rem;
  display: flex;
  gap: .5rem;
}

/* ── Forms ── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-group label { font-size: .85rem; font-weight: 600; color: var(--gray-800); }
.form-group input, .form-group textarea, .form-group select {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: .7rem 1rem;
  font-size: .92rem;
  font-family: var(--font);
  transition: border .2s;
  background: var(--white);
  color: var(--gray-800);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,58,107,.1);
}
.form-group textarea { resize: vertical; min-height: 80px; }

.form-full { grid-column: 1 / -1; }

/* ── Photo Upload Preview ── */
.photo-upload-wrap {
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: .2s;
}
.photo-upload-wrap:hover { border-color: var(--blue); background: rgba(26,58,107,.03); }
.photo-upload-wrap.has-file { border-color: var(--success); }
.photo-preview { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; margin: 0 auto 1rem; display: block; }

/* ── Live Photo Wall ── */
.live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.live-photo {
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1;
  position: relative;
  background: var(--gray-200);
}
.live-photo img { width: 100%; height: 100%; object-fit: cover; }
.live-photo .overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  padding: .75rem .5rem .5rem;
  color: #fff;
  font-size: .78rem;
}

/* ── Admin ── */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--gray-200);
  text-align: center;
}
.stat-card .big { font-size: 2.5rem; font-weight: 800; color: var(--blue); }
.stat-card .lbl { font-size: .82rem; color: var(--gray-600); margin-top: .25rem; }

.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.admin-table th { background: var(--blue); color: #fff; padding: .75rem 1rem; text-align: left; font-weight: 600; }
.admin-table td { padding: .65rem 1rem; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.admin-table tr:hover td { background: var(--gray-100); }

/* ── QR Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}
.modal-box {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 400px;
  width: 100%;
  text-align: center;
  animation: pop .2s ease;
}
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-box img { max-width: 200px; margin: 1rem auto; display: block; }
.modal-box h3 { font-size: 1.3rem; color: var(--blue); }
.modal-close { position: absolute; top: 1rem; right: 1rem; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--gray-600); }

/* ── Toast ── */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: .5rem; }
.toast {
  background: var(--gray-800);
  color: #fff;
  padding: .75rem 1.25rem;
  border-radius: 10px;
  font-size: .88rem;
  box-shadow: var(--shadow-lg);
  animation: slide-in .3s ease;
  display: flex;
  align-items: center;
  gap: .5rem;
  max-width: 320px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes slide-in { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Event Schedule ── */
.schedule-list { display: flex; flex-direction: column; gap: 0; }
.schedule-item {
  display: flex;
  gap: 1.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--gray-100);
  align-items: flex-start;
}
.schedule-item:last-child { border-bottom: none; }
.schedule-time {
  min-width: 80px;
  font-size: .88rem;
  font-weight: 700;
  color: var(--gold);
  padding-top: .1rem;
}
.schedule-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--blue);
  margin-top: .35rem;
  flex-shrink: 0;
}
.schedule-content h4 { font-size: 1rem; color: var(--gray-800); margin-bottom: .2rem; }
.schedule-content p { font-size: .85rem; color: var(--gray-600); }

/* ── Poll ── */
.poll-card { background: var(--white); border-radius: var(--radius); border: 1px solid var(--gray-200); padding: 1.5rem; margin-bottom: 1.5rem; }
.poll-q { font-size: 1.1rem; font-weight: 700; color: var(--blue); margin-bottom: 1rem; }
.poll-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .6rem 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-200);
  margin-bottom: .5rem;
  cursor: pointer;
  transition: .2s;
}
.poll-option:hover { border-color: var(--blue); background: rgba(26,58,107,.04); }
.poll-option.voted { border-color: var(--blue); background: rgba(26,58,107,.06); }
.poll-bar { flex: 1; background: var(--gray-200); border-radius: 999px; height: 8px; overflow: hidden; }
.poll-bar-fill { height: 100%; background: var(--blue); border-radius: 999px; transition: width .4s; }
.poll-pct { font-size: .8rem; font-weight: 700; color: var(--blue); min-width: 36px; text-align: right; }

/* ── Utility ── */
.flex { display: flex; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-center { text-align: center; }
.text-muted { color: var(--gray-600); font-size: .85rem; }
.fw-bold { font-weight: 700; }
.text-blue { color: var(--blue); }
.text-gold { color: var(--gold); }
.hidden { display: none !important; }

.chip {
  display: inline-block;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  padding: .25rem .75rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--blue);
}

.search-bar {
  display: flex;
  gap: .75rem;
  margin-bottom: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.search-bar input {
  flex: 1;
  min-width: 200px;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  padding: .7rem 1rem;
  font-size: .92rem;
  font-family: var(--font);
}
.search-bar input:focus { outline: none; border-color: var(--blue); }

.no-results { text-align: center; padding: 3rem; color: var(--gray-600); }
.no-results .icon { font-size: 3rem; margin-bottom: 1rem; }

/* ── Page header ── */
.page-header {
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: #fff;
  padding: 2.5rem 1.5rem 2rem;
  text-align: center;
}
.page-header h1 { font-size: 2rem; margin-bottom: .5rem; }
.page-header p { opacity: .8; font-size: .95rem; }

/* ── Footer ── */
.footer {
  background: var(--navy);
  color: rgba(255,255,255,.65);
  text-align: center;
  padding: 1.5rem;
  font-size: .82rem;
  margin-top: 3rem;
}
.footer strong { color: var(--gold); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue); }

/* ── Animations ── */
.fade-in { animation: fade-in .4s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

input[type="file"] { display: none; }

.typing-indicator { font-size: .78rem; color: var(--gray-600); padding: 0 1rem .5rem; height: 1.5rem; }

/* ── DST Watermark ── */
.dst-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(26,58,107,.08);
  border: 1px solid rgba(26,58,107,.15);
  border-radius: 999px;
  padding: .3rem .8rem;
  font-size: .72rem;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
}
