/* ===== XEDM.ME — Main Stylesheet ===== */

/* Base theme vars — overridden by themes.css */
:root {
  --bg:         #0a0a0a;
  --bg-2:       #111111;
  --bg-3:       #1a1a1a;
  --card-bg:    #141414;
  --border:     rgba(255,255,255,0.08);
  --text:       #f0f0f0;
  --text-muted: #888888;
  --accent:     #cc2200;
  --accent-2:   #2255cc;
  --accent-3:   #7722cc;
  --input-bg:   #1e1e1e;
  --header-h:   64px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { opacity: 0.8; }

img { max-width: 100%; height: auto; display: block; }

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,10,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.site-logo img { height: 38px; width: auto; }

.logo-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem;
  color: var(--accent);
  letter-spacing: 0.08em;
}

/* ===== NAV ===== */
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}

.nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-family: 'Space Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.nav-link svg { width: 20px; height: 20px; stroke: currentColor; }
.nav-link:hover { color: var(--text); background: var(--bg-3); opacity: 1; }
.nav-link.active { color: var(--accent); }

/* ===== HEADER RIGHT ===== */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.school-countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.3rem 0.6rem;
  min-width: 48px;
}

.countdown-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2rem;
  color: var(--accent);
  line-height: 1;
}

.countdown-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.55rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.notif-bell {
  position: relative;
  color: var(--text-muted);
  padding: 0.4rem;
  border-radius: 8px;
  transition: color 0.15s;
  display: flex;
}

.notif-bell svg { width: 22px; height: 22px; }
.notif-bell:hover { color: var(--text); opacity: 1; }
.notif-bell.has-notif { color: var(--accent); }

.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--accent);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  border-radius: 999px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* Profile dropdown */
.profile-dropdown { position: relative; }

.profile-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.75rem 0.35rem 0.4rem;
  color: var(--text);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  transition: border-color 0.15s;
}

.profile-btn:hover { border-color: var(--accent); }

.avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-placeholder {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
}

.profile-name { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 160px;
  overflow: hidden;
  z-index: 200;
}

.dropdown-menu.open { display: block; }

.dropdown-menu a {
  display: block;
  padding: 0.65rem 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: background 0.1s, color 0.1s;
}

.dropdown-menu a:hover { background: var(--bg-3); color: var(--text); }
.dropdown-divider { border-top: 1px solid var(--border); margin: 0.25rem 0; }
.logout-link { color: #ff6b6b !important; }

.btn-login {
  background: var(--accent);
  color: #fff;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.08em;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: all 0.2s;
}

/* ===== SITE BODY ===== */
.site-body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  min-height: calc(100vh - var(--header-h) - 80px);
}

/* ===== PAGE HERO ===== */
.page-hero {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
}

.hero-banner {
  width: 100%;
  height: 220px;
  background: var(--bg-3);
  border-radius: 12px;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 1.5rem;
}

.hero-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%);
}

.hero-banner-content { position: relative; z-index: 1; }
.hero-banner-content h1 { font-family: 'Bebas Neue', sans-serif; font-size: 2.5rem; letter-spacing: 0.05em; line-height: 1; }
.hero-banner-content p { color: var(--text-muted); font-size: 0.85rem; font-family: 'Space Mono', monospace; }

/* ===== CARDS ===== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: border-color 0.2s;
}

.card:hover { border-color: rgba(255,255,255,0.15); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.card-title {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.card-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  color: var(--text);
  line-height: 1;
}

/* ===== BADGES / TAGS ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-family: 'Space Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.badge-habit    { background: rgba(34,170,100,0.15); color: #4ade80; }
.badge-focus    { background: rgba(34,100,220,0.15); color: #60a5fa; }
.badge-life     { background: rgba(220,170,34,0.15); color: #fbbf24; }
.badge-reward   { background: rgba(200,50,200,0.15); color: #e879f9; }
.badge-verified { background: rgba(34,200,100,0.15); color: #4ade80; }
.badge-cap      { background: rgba(220,50,50,0.15);  color: #f87171; }
.badge-jury     { background: rgba(200,150,50,0.15); color: #fbbf24; }
.badge-mom      { background: rgba(220,170,50,0.12); color: #f59e0b; border: 1px solid rgba(220,170,50,0.2); }
.badge-dad      { background: rgba(0,180,80,0.12);   color: #4ade80; border: 1px solid rgba(0,180,80,0.2); }

/* ===== NOTIFICATIONS ===== */
.notif-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.notif-item:hover { background: var(--bg-3); }
.notif-item.unread { border-left: 3px solid var(--accent); }
.notif-item.notif-mom { border-left-color: #f59e0b; }
.notif-item.notif-dad { border-left-color: #4ade80; }

.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.notif-icon-mom { background: rgba(220,170,50,0.15); }
.notif-icon-dad { background: rgba(0,180,80,0.15); }
.notif-icon-yard { background: rgba(34,100,220,0.15); }
.notif-icon-system { background: var(--bg-3); }

.notif-body { flex: 1; }
.notif-msg { font-size: 0.88rem; color: var(--text); line-height: 1.4; }
.notif-time { font-size: 0.72rem; color: var(--text-muted); font-family: 'Space Mono', monospace; margin-top: 3px; }

/* ===== FORMS ===== */
.form-row { margin-bottom: 1.1rem; }

.form-row label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: 'Space Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}

.form-row input,
.form-row textarea,
.form-row select {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-row textarea { resize: vertical; min-height: 100px; }
.form-row select { cursor: pointer; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  text-decoration: none;
}

.btn:active { transform: scale(0.97); }
.btn:hover { opacity: 0.88; }
.btn-primary   { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--bg-3); color: var(--text); border: 1px solid var(--border); }
.btn-success   { background: #166534; color: #4ade80; }
.btn-danger    { background: #7f1d1d; color: #f87171; }
.btn-warning   { background: #713f12; color: #fbbf24; }
.btn-sm        { padding: 0.35rem 0.75rem; font-size: 0.85rem; }

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem;
  letter-spacing: 0.04em;
  color: var(--text);
}

.section-sub {
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ===== TABLE ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  font-family: 'Space Mono', monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 0.75rem;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:hover td { background: var(--bg-3); }

/* ===== ADMIN PANEL ===== */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.admin-sidebar {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 0;
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}

.admin-sidebar-title {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  padding: 0 1rem 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  transition: background 0.1s, color 0.1s;
}

.admin-nav-link svg { width: 18px; height: 18px; }
.admin-nav-link:hover { background: var(--bg-3); color: var(--text); opacity: 1; }
.admin-nav-link.active { color: var(--accent); background: rgba(204,34,0,0.08); }

.admin-content { min-width: 0; }

/* ===== STAT BOXES ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.stat-box {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  text-align: center;
}

.stat-box-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.2rem;
  color: var(--accent);
  line-height: 1;
}

.stat-box-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== STREAK BAR ===== */
.streak-bar {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 0.75rem 0;
}

.streak-day {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  transition: background 0.2s;
}

.streak-day.done { background: var(--accent); border-color: var(--accent); }

/* ===== FOOTER ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-brand { display: flex; align-items: baseline; gap: 0.5rem; }
.footer-logo { font-family: 'Bebas Neue', sans-serif; font-size: 1.2rem; color: var(--accent); letter-spacing: 0.08em; }
.footer-tag { font-family: 'Space Mono', monospace; font-size: 0.7rem; color: var(--text-muted); }

.footer-links { display: flex; gap: 1.25rem; }
.footer-links a { color: var(--text-muted); font-size: 0.8rem; font-family: 'Space Mono', monospace; }
.footer-links a:hover { color: var(--text); opacity: 1; }

.footer-note { font-size: 0.75rem; color: var(--text-muted); }

/* ===== MOM & POP MESSAGES ===== */
.mom-pop-banner {
  background: linear-gradient(135deg, rgba(220,170,50,0.08), rgba(0,180,80,0.08));
  border: 1px solid rgba(220,170,50,0.2);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mom-pop-banner .banner-icon { font-size: 1.5rem; }
.mom-pop-banner .banner-text { font-family: 'Space Mono', monospace; font-size: 0.8rem; color: var(--text-muted); }
.mom-pop-banner .banner-text strong { color: var(--text); }

.msg-thread { display: flex; flex-direction: column; gap: 0.75rem; }

.msg-bubble {
  max-width: 75%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.msg-bubble-mom {
  background: rgba(220,170,50,0.1);
  border: 1px solid rgba(220,170,50,0.2);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.msg-bubble-dad {
  background: rgba(0,180,80,0.1);
  border: 1px solid rgba(0,180,80,0.2);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.msg-meta {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== YARD ===== */
.yard-warning {
  background: rgba(220,170,50,0.08);
  border: 1px solid rgba(220,170,50,0.2);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: #fbbf24;
  margin-bottom: 1rem;
  text-align: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .site-nav {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    padding: 1rem;
    gap: 0.5rem;
    z-index: 99;
  }

  .site-nav.open { display: flex; }

  .nav-link span { display: none; }
  .nav-link svg { width: 24px; height: 24px; }
  .nav-link { padding: 0.6rem; }

  .hamburger { display: flex; }
  .profile-name { display: none; }

  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; }

  .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .site-body { padding: 1rem; }
  .card-grid { grid-template-columns: 1fr; }
}
