/* ============================================================
   KESYA EVENT SYSTEM — App Stylesheet
   ============================================================ */

:root {
  --primary:      #7c3aed;
  --primary-dark: #5b21b6;
  --primary-light:#ede9fe;
  --secondary:    #f59e0b;
  --success:      #10b981;
  --danger:       #ef4444;
  --dark:         #1e293b;
  --muted:        #64748b;
  --light:        #f8fafc;
  --border:       #e2e8f0;
  --sidebar-w:    260px;
  --topbar-h:     64px;
  --radius:       12px;
  --shadow:       0 4px 24px rgba(0,0,0,.08);
  --font:         'Inter', system-ui, -apple-system, sans-serif;
}

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

body { font-family: var(--font); background: var(--light); color: var(--dark); margin: 0; }

/* ─── SIDEBAR ─────────────────────────────────────────── */
.admin-body { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(160deg, #1e1b4b 0%, #312e81 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; height: 100vh;
  z-index: 1000;
  transition: transform .3s ease;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.brand-icon { font-size: 28px; }
.brand-name { font-size: 16px; font-weight: 700; }
.brand-sub  { font-size: 11px; color: rgba(255,255,255,.55); }

.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-section-title {
  font-size: 10px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: rgba(255,255,255,.4);
  padding: 12px 20px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; color: rgba(255,255,255,.75);
  text-decoration: none; font-size: 14px; font-weight: 500;
  border-radius: 0; transition: all .2s;
  margin: 1px 8px; border-radius: 8px;
}
.nav-item:hover  { background: rgba(255,255,255,.1); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.18); color: #fff; font-weight: 600; }
.nav-item i { font-size: 16px; width: 20px; text-align: center; }

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.15);
}
.sidebar-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.3); }
.sidebar-avatar-placeholder {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--secondary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.sidebar-user-info { flex: 1; overflow: hidden; }
.sidebar-user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: rgba(255,255,255,.5); }
.sidebar-logout { color: rgba(255,255,255,.5); text-decoration: none; padding: 4px; }
.sidebar-logout:hover { color: #fff; }

/* ─── TOPBAR ─────────────────────────────────────────────── */
.main-wrapper { margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh;width: 100%; }
.topbar {
  height: var(--topbar-h); background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 16px; position: sticky; top: 0; z-index: 900;
  box-shadow: 0 1px 8px rgba(0,0,0,.05);
}
.topbar-title { font-weight: 700; font-size: 18px; flex: 1; }
.topbar-right  { display: flex; align-items: center; gap: 12px; }
.btn-icon { width: 36px; height: 36px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.sidebar-toggle { display: none; }

.page-content { flex: 1; padding: 24px; }

/* ─── CARDS ──────────────────────────────────────────────── */
.card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  background: #fff; display: flex; align-items: center; justify-content: space-between;
}
.card-header h5 { margin: 0; font-size: 16px; font-weight: 700; }
.card-body { padding: 20px; }

/* ─── STAT CARDS ─────────────────────────────────────────── */
.stat-card {
  background: #fff; border-radius: var(--radius);
  padding: 20px; display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow); border: 1px solid var(--border);
}
.stat-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.stat-value { font-size: 28px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ─── TABLES ─────────────────────────────────────────────── */
.table { margin: 0; }
.table th { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); background: var(--light); }
.table td { vertical-align: middle; font-size: 14px; }
.table-hover tbody tr:hover { background: #f5f3ff; }

/* ─── BADGES ─────────────────────────────────────────────── */
.badge { font-size: 11px; font-weight: 600; padding: 5px 10px; border-radius: 20px; }

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn { font-size: 14px; font-weight: 500; border-radius: 8px; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-xs { padding: 2px 8px; font-size: 11px; border-radius: 6px; }

/* ─── LOGIN PAGE ─────────────────────────────────────────── */
.login-body {
  min-height: 100vh; background: linear-gradient(135deg, #1e1b4b, #312e81, #4c1d95);
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: #fff; border-radius: 20px; padding: 40px;
  width: 100%; max-width: 420px; box-shadow: 0 24px 60px rgba(0,0,0,.25);
}
.login-logo { text-align: center; margin-bottom: 8px; font-size: 48px; }
.login-title { text-align: center; font-size: 22px; font-weight: 800; color: var(--dark); }
.login-sub   { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 28px; }

/* ─── FORM CONTROLS ─────────────────────────────────────── */
.form-control, .form-select {
  border-radius: 8px; border-color: var(--border); font-size: 14px;
  padding: 10px 14px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,58,237,.15);
}
.form-label { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.input-group-text { border-radius: 8px; background: var(--light); }

/* ─── MODAL ──────────────────────────────────────────────── */
.modal-content { border-radius: 16px; border: none; }
.modal-header  { border-bottom: 1px solid var(--border); padding: 16px 20px; }
.modal-footer  { border-top: 1px solid var(--border); padding: 12px 20px; }
.modal-title   { font-weight: 700; font-size: 17px; }

/* ─── AVATAR ─────────────────────────────────────────────── */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--border);
}
.avatar-placeholder {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}

/* ─── QR CODE BOX ─────────────────────────────────────────── */
.qr-container {
  background: #1e1b4b; border-radius: 16px; padding: 20px;
  display: inline-flex; flex-direction: column;
  align-items: center; gap: 12px;
}
.qr-container img { width: 160px; height: 160px; border-radius: 8px; background: #fff; padding: 4px; }
.qr-label { color: rgba(255,255,255,.8); font-size: 12px; text-align: center; }

/* ─── INVITE CARD (Public) ───────────────────────────────── */
.invite-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; font-family: var(--font);
}
.invite-card {
  background: linear-gradient(160deg, #1e1b4b 0%, #312e81 60%, #1a1035 100%);
  border-radius: 24px; max-width: 480px; width: 100%;
  overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.5);
  border: 1px solid rgba(255,255,255,.1);
  animation: fadeSlide .8s ease forwards;
  color: #fff;
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
.invite-hero {
  background: linear-gradient(135deg, var(--primary), #9333ea, var(--secondary));
  padding: 32px 24px 24px; text-align: center; position: relative; overflow: hidden;
}
.invite-hero::before {
  content: '✝️'; position: absolute; font-size: 120px; opacity: .06;
  top: -20px; right: -20px; animation: pulse 3s infinite;
}
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.05)} }
.invite-cross { font-size: 40px; margin-bottom: 8px; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }
.invite-owner { font-size: 13px; opacity: .85; letter-spacing: 1.5px; text-transform: uppercase; }
.invite-event-name { font-size: 20px; font-weight: 800; margin: 6px 0; line-height: 1.2; }
.invite-slogan { font-size: 13px; opacity: .8; font-style: italic; }

.invite-body { padding: 24px; }

.invite-badge {
  background: rgba(255,255,255,.08); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 14px;
  display: flex; align-items: flex-start; gap: 12px;
}
.invite-badge-icon { font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.invite-badge-label { font-size: 11px; opacity: .6; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 2px; }
.invite-badge-value { font-size: 14px; font-weight: 600; }

.invite-guest-box {
  background: rgba(124,58,237,.25); border: 1px solid rgba(124,58,237,.4);
  border-radius: 14px; padding: 16px; text-align: center; margin-bottom: 16px;
}
.invite-guest-city { font-size: 28px; font-weight: 800; color: #c4b5fd; }
.invite-guest-label{ font-size: 11px; opacity: .6; letter-spacing: 1px; text-transform: uppercase; }
.invite-guest-name { font-size: 16px; font-weight: 700; margin-top: 4px; }

.invite-status-badge {
  text-align: center; margin: 8px 0 16px;
}
.invite-qr-box {
  display: flex; justify-content: center; margin: 20px 0;
}
.invite-qr-inner {
  background: #fff; border-radius: 16px; padding: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
}
.invite-qr-inner img { width: 160px; height: 160px; display: block; }

.invite-actions { display: flex; gap: 12px; margin-top: 16px; }
.btn-confirm {
  flex: 1; background: linear-gradient(135deg, var(--success), #059669);
  border: none; color: #fff; padding: 14px; border-radius: 12px;
  font-weight: 700; font-size: 15px; cursor: pointer;
  transition: all .2s; box-shadow: 0 4px 16px rgba(16,185,129,.3);
}
.btn-confirm:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(16,185,129,.4); }
.btn-cancel {
  flex: 1; background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.4);
  color: #fca5a5; padding: 14px; border-radius: 12px;
  font-weight: 700; font-size: 15px; cursor: pointer; transition: all .2s;
}
.btn-cancel:hover { background: rgba(239,68,68,.25); }

.invite-footer {
  text-align: center; padding: 16px; border-top: 1px solid rgba(255,255,255,.1);
  font-size: 11px; opacity: .5; letter-spacing: .5px;
}

.status-confirmed { color: #86efac; font-weight: 700; font-size: 15px; }
.status-canceled  { color: #fca5a5; font-weight: 700; font-size: 15px; }
.status-attended  { color: #93c5fd; font-weight: 700; font-size: 15px; }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .sidebar-toggle { display: flex !important; }
}
@media (max-width: 576px) {
  .page-content { padding: 16px; }
  .stat-value { font-size: 22px; }
}

/* ─── UTILITIES ──────────────────────────────────────────── */
.text-primary { color: var(--primary) !important; }
.bg-primary-light { background: var(--primary-light) !important; }
.border-primary { border-color: var(--primary) !important; }
.cursor-pointer { cursor: pointer; }
.transition { transition: all .2s; }

/* ─── FILTER BAR ─────────────────────────────────────────── */
.filter-bar { background: #fff; border-radius: var(--radius); padding: 16px; margin-bottom: 20px; border: 1px solid var(--border); }
.filter-bar .row { row-gap: 12px; }

/* ─── ACTIVITY LOG ───────────────────────────────────────── */
.log-item { border-left: 3px solid var(--primary); padding: 8px 16px; margin-bottom: 8px; background: var(--light); border-radius: 0 8px 8px 0; }
.log-action { font-weight: 600; font-size: 13px; }
.log-meta   { font-size: 12px; color: var(--muted); }

/* Sparkle animation for invite page */
.sparkle {
  position: absolute; pointer-events: none;
  animation: sparkleAnim 1.5s ease-out forwards;
}
@keyframes sparkleAnim {
  0%   { opacity:1; transform: translate(0,0) scale(1); }
  100% { opacity:0; transform: translate(var(--tx),var(--ty)) scale(0); }
}
