/**
 * @fileoverview
 * Hub Dashboard — Stylesheet
 * Responsive design with dark/light theme support via CSS custom properties.
 * Matches the visual style of both LGAA Manager and Agenda Builder.
 */

/* ── CSS Custom Properties ──────────────────────────────────────────────── */

:root,
[data-theme="light"] {
  --bg-primary:    #f8f9fa;
  --bg-secondary:  #ffffff;
  --bg-card:       #ffffff;
  --bg-card-hover: #f1f5f9;
  --text-primary:  #1a1a2e;
  --text-secondary:#6b7280;
  --text-muted:    #9ca3af;
  --border:        #e5e7eb;
  --accent:        #0C2340;
  --accent-light:  #1a3a5c;
  --accent-red:    #A6192E;
  --shadow:        0 4px 20px rgba(0,0,0,0.08);
  --shadow-hover:  0 8px 30px rgba(0,0,0,0.12);
  --input-bg:      #f3f4f6;
  --error-bg:      #fef2f2;
  --error-text:    #dc2626;
  --badge-bg:      #dbeafe;
  --badge-text:    #1e40af;
}

[data-theme="dark"] {
  --bg-primary:    #0f1117;
  --bg-secondary:  #1a1d27;
  --bg-card:       #1e2130;
  --bg-card-hover: #282c3e;
  --text-primary:  #e5e7eb;
  --text-secondary:#9ca3af;
  --text-muted:    #6b7280;
  --border:        #2d3348;
  --accent:        #60a5fa;
  --accent-light:  #93c5fd;
  --accent-red:    #f87171;
  --shadow:        0 4px 20px rgba(0,0,0,0.3);
  --shadow-hover:  0 8px 30px rgba(0,0,0,0.4);
  --input-bg:      #252838;
  --error-bg:      #2d1b1b;
  --error-text:    #f87171;
  --badge-bg:      #1e3a5f;
  --badge-text:    #93c5fd;
}

/* ── Reset & Base ───────────────────────────────────────────────────────── */

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

body {
  font-family: "Montserrat", system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

/* ── Views ──────────────────────────────────────────────────────────────── */

.view { display: none; }
.view.active { display: flex; }

/* ── Login View ─────────────────────────────────────────────────────────── */

#login-view {
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px 32px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow);
  text-align: center;
  position: relative;
}

.login-logo-container {
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: none;
  border: none;
  padding: 0;
}

.login-full-logo {
  width: 100%;
  max-width: 270px;
  height: auto;
  display: block;
  margin: 0 auto;
  transition: transform 0.3s ease;
  user-select: none;
}

.login-full-logo:hover {
  transform: scale(1.03);
}

/* Auth tabs */
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.auth-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab.active {
  background: var(--accent);
  color: #fff;
}

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

/* Form elements */
.auth-form label {
  display: block;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  margin-top: 16px;
}

.auth-form select,
.auth-form input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

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

.btn-primary {
  width: 100%;
  padding: 12px;
  margin-top: 20px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-google {
  width: 100%;
  padding: 12px;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.2s;
}

.btn-google:hover { background: var(--bg-card-hover); }

.google-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

.error-msg {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--error-bg);
  color: var(--error-text);
  font-size: 0.85rem;
  text-align: left;
}

/* Theme toggle buttons */
.btn-theme {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.header-right .btn-theme {
  position: static;
}

.btn-theme:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--accent);
}

.btn-theme svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

/* ── Dashboard View ─────────────────────────────────────────────────────── */

#dashboard-view {
  flex-direction: column;
  min-height: 100vh;
}

.hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-logo {
  width: 42px;
  height: 42px;
}

.header-left h1 {
  font-size: 1.2rem;
  font-weight: 700;
}

.header-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.btn-signout {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-signout:hover {
  background: var(--error-bg);
  color: var(--error-text);
  border-color: var(--error-text);
}

/* ── Spokes Grid ────────────────────────────────────────────────────────── */

.hub-main {
  flex: 1;
  padding: 40px 32px;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.spokes-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.spokes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.spoke-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: all 0.25s;
  box-shadow: var(--shadow);
  position: relative;
}

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

.spoke-card.disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

.spoke-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: var(--accent);
  margin-bottom: 16px;
  transition: all 0.25s ease;
}

.spoke-icon-wrap svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
}

.spoke-card:hover .spoke-icon-wrap {
  transform: translateY(-2px) scale(1.05);
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.16);
  color: var(--accent-hover);
}

.spoke-card.disabled .spoke-icon-wrap {
  background: rgba(148, 163, 184, 0.06);
  border-color: var(--border);
  color: var(--text-secondary);
}

.spoke-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.spoke-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.badge-soon {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--badge-bg);
  color: var(--badge-text);
}

.coming-soon h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 32px 0 16px;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

.hub-footer {
  padding: 16px 32px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .hub-header { padding: 12px 16px; }
  .header-left h1 { font-size: 1rem; }
  .hub-main { padding: 24px 16px; }
  .spokes-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 24px; }
}
