/* =====================
   CSS Variables & Reset
   ===================== */
:root {
  --bg: #0d0f14;
  --bg2: #13161e;
  --bg3: #1a1e28;
  --card: #1e2330;
  --border: #2a2f3d;
  --accent: #f0c040;
  --accent2: #e8a020;
  --text: #eef0f6;
  --text2: #8a90a8;
  --text3: #5a6070;
  --success: #2ecc71;
  --error: #e74c3c;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --font-head: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }

/* =====================
   Auth Page Layout
   ===================== */
.auth-page { display: flex; align-items: stretch; }

.auth-split {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Left Panel */
.auth-left {
  flex: 1;
  background: linear-gradient(135deg, #1a1e28 0%, #0d0f14 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem;
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--border);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-dot {
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
}

.brand-name {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.auth-hero {
  z-index: 2;
}

.auth-hero h1 {
  font-family: var(--font-head);
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1rem;
  color: var(--text);
}

.auth-hero p {
  color: var(--text2);
  font-size: 1.1rem;
}

.auth-decoration {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.deco-circle {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.c1 { width: 300px; height: 300px; bottom: -80px; right: -80px; }
.c2 { width: 200px; height: 200px; bottom: 40px; right: 40px; background: rgba(240,192,64,0.04); }
.c3 { width: 80px; height: 80px; bottom: 120px; right: 120px; background: rgba(240,192,64,0.08); }

/* Right Panel */
.auth-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-tabs {
  display: flex;
  gap: 0;
  background: var(--bg3);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 2rem;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text2);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
}

.auth-form { display: none; }
.auth-form.active { display: block; }

.auth-form h2 {
  font-family: var(--font-head);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.form-sub {
  color: var(--text2);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* =====================
   Form Elements
   ===================== */
.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.2s;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
}

.form-group textarea { resize: vertical; }

.form-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.form-row .form-group { flex: 1; }

.form-error {
  background: rgba(231,76,60,0.12);
  border: 1px solid rgba(231,76,60,0.3);
  color: #e74c3c;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.form-success {
  background: rgba(46,204,113,0.12);
  border: 1px solid rgba(46,204,113,0.3);
  color: #2ecc71;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.hidden { display: none !important; }

/* =====================
   Buttons
   ===================== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px 20px;
  background: var(--accent);
  color: #0d0f14;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.02em;
}

.btn-primary:hover { background: var(--accent2); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary.small { width: auto; padding: 8px 16px; font-size: 0.85rem; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-ghost:hover { color: var(--text); border-color: var(--text3); }

.btn-danger {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  background: rgba(231,76,60,0.12);
  color: #e74c3c;
  border: 1px solid rgba(231,76,60,0.3);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger:hover { background: rgba(231,76,60,0.2); }

.btn-join {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background: rgba(240,192,64,0.12);
  color: var(--accent);
  border: 1px solid rgba(240,192,64,0.3);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-join:hover { background: rgba(240,192,64,0.2); }

/* =====================
   Navbar
   ===================== */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-user {
  font-size: 0.88rem;
  color: var(--text2);
  padding: 6px 12px;
  background: var(--bg3);
  border-radius: 20px;
}

/* =====================
   Main Content
   ===================== */
.app-page { background: var(--bg); }

.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-family: var(--font-head);
  font-size: 2.2rem;
  font-weight: 800;
}

.page-header p {
  color: var(--text2);
  margin-top: 4px;
}

/* =====================
   Events Grid
   ===================== */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.2rem;
}

.event-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.event-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.event-card-title {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.event-card-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.event-card-meta span {
  font-size: 0.85rem;
  color: var(--text2);
}

.event-card-desc {
  font-size: 0.9rem;
  color: var(--text3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.event-card-creator {
  font-size: 0.8rem;
  color: var(--text3);
}

.event-card-participants {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
}

/* =====================
   Loading & Empty
   ===================== */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 4rem;
  color: var(--text2);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 4rem;
  text-align: center;
}

.empty-icon { font-size: 3rem; }

.empty-state h3 {
  font-family: var(--font-head);
  font-size: 1.3rem;
}

.empty-state p { color: var(--text2); }
.empty-state .btn-primary { width: auto; margin-top: 0.5rem; }

/* =====================
   Event Detail
   ===================== */
.detail-hero {
  margin-bottom: 2rem;
}

.detail-badge {
  display: inline-block;
  background: rgba(240,192,64,0.12);
  color: var(--accent);
  border: 1px solid rgba(240,192,64,0.3);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.detail-hero h1 {
  font-family: var(--font-head);
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.meta-item {
  font-size: 0.9rem;
  color: var(--text2);
}

.detail-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
}

.detail-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.2rem;
}
.detailCreator {
  font-weight: 700;
  color: var(--text);
}

.detail-card h3 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-card p {
  color: var(--text2);
  line-height: 1.8;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 1.2rem;
}

/* =====================
   Participants
   ===================== */
.participant-count {
  background: var(--bg3);
  color: var(--text2);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.participant-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.participant-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.participant-item:last-child { border-bottom: none; }

.participant-avatar {
  width: 32px;
  height: 32px;
  background: var(--bg3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.participant-empty {
  color: var(--text3);
  font-size: 0.88rem;
  padding: 1rem 0;
}

/* =====================
   Create Event Form
   ===================== */
.form-page-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 700px;
}

.form-page-card .btn-primary { width: auto; }


.stats-grid {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.8rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 180px;
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.stat-card .stat-number {
  font-family:'Lucida Sans';
  font-size: 2rem;
  font-weight: 700;
  color: yellow;
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
  
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text1);
    text-decoration: none;
    font-size: 14px;
    margin-top: 10px;
    transition: background 0.2s;
}
.btn-google:hover { background: var(--surface2); }

.divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0 0;
    color: var(--text3);
    font-size: 12px;
}
.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* =====================
   Search Bar
   ===================== */
.search-container {
  margin-bottom: 1.8rem;
}

.search-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  transition: border-color 0.2s;
}

.search-wrapper:focus-within {
  border-color: var(--accent);
}

.search-icon {
  font-size: 15px;
  color: var(--text3);
}

.search-wrapper input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 12px 0;
  font-size: 0.95rem;
  font-family: var(--font-body);
  color: var(--text);
}

.search-wrapper input::placeholder {
  color: var(--text3);
}

#clearSearchBtn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text3);
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

#clearSearchBtn:hover {
  color: var(--text);
}

.search-label {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--text3);
}

/* =====================
   Responsive
   ===================== */
@media (max-width: 768px) {
  .auth-left { display: none; }
  .auth-right { padding: 1.5rem; }
  .detail-body { grid-template-columns: 1fr; }
  .auth-hero h1 { font-size: 2.5rem; }
  .form-row { flex-direction: column; }
  .navbar { padding: 1rem; }
  .nav-user { display: none; }
}