/* ============================================================
   SCHEDULR — Main Stylesheet
   Dark Glassmorphism + Indigo/Violet palette
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --bg-dark:      #0a0a1a;
  --bg-card:      rgba(255,255,255,0.05);
  --bg-card-hover:rgba(255,255,255,0.09);
  --border:       rgba(255,255,255,0.10);
  --border-focus: rgba(99,102,241,0.7);

  --primary:      #6366f1;
  --primary-dark: #4f46e5;
  --primary-glow: rgba(99,102,241,0.35);
  --violet:       #8b5cf6;
  --success:      #10b981;
  --danger:       #ef4444;
  --warning:      #f59e0b;

  --text-primary: #f1f5f9;
  --text-muted:   #94a3b8;
  --text-dim:     #64748b;

  --radius-sm:    8px;
  --radius-md:    14px;
  --radius-lg:    22px;
  --radius-xl:    32px;

  --shadow-glow:  0 0 40px rgba(99,102,241,0.18);
  --shadow-card:  0 8px 32px rgba(0,0,0,0.45);
  --transition:   all 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Background gradient orbs ──────────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 60% 50% at 20% 10%, rgba(99,102,241,0.15) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(139,92,246,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 50% 50%, rgba(16,185,129,0.04) 0%, transparent 70%),
    var(--bg-dark);
}

/* ── Auth Layout ────────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 3rem 2.5rem;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  animation: slideUp 0.5s ease both;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Logo / Brand ──────────────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 2rem;
  justify-content: center;
}
.brand-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 16px var(--primary-glow);
}
.brand-name {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

/* ── Auth headings ─────────────────────────────────────────── */
.auth-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  letter-spacing: -0.3px;
}
.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

/* ── Flash messages ─────────────────────────────────────────── */
.flash {
  padding: 0.8rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  border: 1px solid;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.flash-error   { background: rgba(239,68,68,0.12);  border-color: rgba(239,68,68,0.3);  color: #fca5a5; }
.flash-success { background: rgba(16,185,129,0.12); border-color: rgba(16,185,129,0.3); color: #6ee7b7; }

/* ── Form Elements ─────────────────────────────────────────── */
.form-group   { margin-bottom: 1.25rem; }
.form-label   { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.45rem; letter-spacing: 0.3px; text-transform: uppercase; }
.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}
.form-control::placeholder { color: var(--text-dim); }
.form-control:focus {
  border-color: var(--border-focus);
  background: rgba(99,102,241,0.08);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.82rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.2s;
}
.btn:hover::after { background: rgba(255,255,255,0.07); }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 20px var(--primary-glow);
  width: 100%;
}
.btn-primary:hover { box-shadow: 0 6px 28px rgba(99,102,241,0.5); }

.btn-google {
  background: rgba(255,255,255,0.07);
  color: var(--text-primary);
  border: 1px solid var(--border);
  width: 100%;
  margin-bottom: 1.5rem;
}
.btn-google:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.2); }

.btn-sm { padding: 0.5rem 1rem; font-size: 0.82rem; }
.btn-danger { background: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-success { background: rgba(16,185,129,0.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.3); }
.btn-success:hover { background: rgba(16,185,129,0.25); }
.btn-outline { background: transparent; color: var(--text-primary); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--bg-card-hover); }

/* ── Divider ─────────────────────────────────────────────────── */
.divider {
  display: flex; align-items: center; gap: 1rem;
  color: var(--text-dim); font-size: 0.8rem;
  margin: 1.25rem 0;
}
.divider::before, .divider::after {
  content: ''; flex: 1;
  height: 1px; background: var(--border);
}

/* ── Auth footer link ─────────────────────────────────────────── */
.auth-footer { text-align: center; margin-top: 1.5rem; color: var(--text-muted); font-size: 0.87rem; }
.auth-footer a { color: var(--primary); text-decoration: none; font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

/* ── Dashboard Layout ─────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px;
  background: rgba(255,255,255,0.03);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(20px);
  display: flex; flex-direction: column;
  padding: 1.5rem 1rem;
  position: fixed; height: 100vh; left: 0; top: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar .brand { margin-bottom: 2.5rem; justify-content: flex-start; padding-left: 0.5rem; }

.nav-section-label {
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.25rem;
}

.nav-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.7rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
}
.nav-link:hover   { background: var(--bg-card-hover); color: var(--text-primary); }
.nav-link.active  { background: rgba(99,102,241,0.15); color: var(--primary); }
.nav-link .nav-icon { font-size: 1.1rem; width: 20px; text-align: center; }

.sidebar-footer {
  margin-top: auto; padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.user-info {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.user-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
  flex-shrink: 0; overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-details .user-name  { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.user-details .user-email { font-size: 0.72rem; color: var(--text-dim); }

/* ── Main content ─────────────────────────────────────────────── */
.main-content {
  margin-left: 260px;
  flex: 1;
  padding: 2rem 2.5rem;
  min-height: 100vh;
}

.page-header {
  margin-bottom: 2rem;
}
.page-title { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.5px; }
.page-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.3rem; }

/* ── Cards / Stats ─────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 1.25rem; margin-bottom: 2rem; }

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  transition: var(--transition);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--violet));
  opacity: 0; transition: opacity 0.3s;
}
.stat-card:hover { border-color: rgba(99,102,241,0.3); box-shadow: 0 4px 24px rgba(99,102,241,0.1); }
.stat-card:hover::before { opacity: 1; }

.stat-icon { font-size: 1.8rem; margin-bottom: 0.75rem; }
.stat-value { font-size: 2rem; font-weight: 800; letter-spacing: -1px; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; font-weight: 500; }

/* ── Section cards ─────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 1rem; font-weight: 700; }
.card-body  { padding: 1.5rem; }

/* ── Event type cards ─────────────────────────────────────────── */
.event-types-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 1rem; }

.event-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: var(--transition);
  position: relative;
}
.event-card:hover { border-color: rgba(99,102,241,0.4); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.3); }

.event-color-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.5rem;
}
.event-card-title { font-weight: 700; margin-bottom: 0.4rem; display: flex; align-items: center; }
.event-card-meta  { font-size: 0.82rem; color: var(--text-muted); display: flex; gap: 1rem; margin-bottom: 1rem; }
.event-card-link  {
  font-size: 0.78rem; color: var(--text-dim);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  word-break: break-all;
  margin-bottom: 1rem;
  display: block;
}
.event-card-actions { display: flex; gap: 0.5rem; }

/* ── Booking list ─────────────────────────────────────────────── */
.booking-item {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.booking-item:last-child { border-bottom: none; }
.booking-time {
  min-width: 110px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.booking-name  { font-weight: 600; font-size: 0.9rem; }
.booking-email { font-size: 0.78rem; color: var(--text-dim); }
.booking-badge {
  margin-left: auto;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-confirmed { background: rgba(16,185,129,0.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.3); }
.badge-cancelled { background: rgba(239,68,68,0.15);  color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }

/* ── Google Calendar banner ─────────────────────────────────── */
.gcal-banner {
  background: linear-gradient(135deg, rgba(66,133,244,0.15), rgba(99,102,241,0.1));
  border: 1px solid rgba(66,133,244,0.3);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 2rem;
}
.gcal-banner-icon { font-size: 2rem; }
.gcal-banner-text .title { font-weight: 700; margin-bottom: 0.2rem; }
.gcal-banner-text .sub   { font-size: 0.82rem; color: var(--text-muted); }
.gcal-banner-action { margin-left: auto; }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: #12122a;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 500px;
  padding: 2rem;
  box-shadow: var(--shadow-card);
  transform: scale(0.95);
  transition: transform 0.25s;
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.modal-title  { font-size: 1.2rem; font-weight: 700; }
.modal-close  { background: none; border: none; color: var(--text-dim); font-size: 1.4rem; cursor: pointer; padding: 0.2rem; transition: color 0.2s; }
.modal-close:hover { color: var(--text-primary); }

/* ── Color picker ─────────────────────────────────────────── */
.color-picker { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.color-swatch {
  width: 28px; height: 28px; border-radius: 50%;
  cursor: pointer; border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
}
.color-swatch:hover, .color-swatch.selected { transform: scale(1.2); border-color: #fff; }

/* ── Booking page ─────────────────────────────────────────── */
.booking-layout {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  padding: 2rem 1rem;
}
.booking-container {
  display: grid; grid-template-columns: 1fr 1fr;
  max-width: 820px; width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  animation: slideUp 0.5s ease both;
}
.booking-info { padding: 2.5rem; border-right: 1px solid var(--border); }
.booking-form-panel { padding: 2.5rem; }

.booking-host-avatar {
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700;
  margin-bottom: 1rem;
  overflow: hidden;
}
.booking-host-avatar img { width: 100%; height: 100%; object-fit: cover; }
.booking-host-name { font-weight: 700; font-size: 1.1rem; }
.booking-event-name { font-size: 1.4rem; font-weight: 800; margin: 0.5rem 0; }
.booking-event-meta { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.booking-event-meta-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; color: var(--text-muted); }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.5); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { width: 100%; height: auto; position: relative; }
  .main-content { margin-left: 0; padding: 1.25rem; }
  .app-layout { flex-direction: column; }
  .booking-container { grid-template-columns: 1fr; }
  .booking-info { border-right: none; border-bottom: 1px solid var(--border); }
  .auth-card { padding: 2rem 1.5rem; }
}

/* ── Utility ─────────────────────────────────────────────────── */
.text-center   { text-align: center; }
.text-muted    { color: var(--text-muted); }
.text-success  { color: var(--success); }
.text-danger   { color: var(--danger); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.flex-1 { flex: 1; }
.w-100 { width: 100%; }

/* ── Animations ─────────────────────────────────────────────── */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px var(--primary-glow); }
  50%       { box-shadow: 0 0 40px rgba(99,102,241,0.6); }
}
.pulse { animation: pulse-glow 2s ease-in-out infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* Copy link button */
.copy-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.75rem; color: var(--primary);
  background: none; border: none; cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}
.copy-btn:hover { color: var(--violet); }
