/* ============================================
   HUB/CSS/HUB.CSS
   FF14 Events Hub — public + admin styles
   ============================================ */

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

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

:root {
  --hub-bg:        #0d0d1a;
  --hub-surface:   #161628;
  --hub-border:    #2a2a4a;
  --hub-primary:   #667eea;
  --hub-accent:    #ff6b6b;
  --hub-text:      #e8e8f0;
  --hub-muted:     #888899;
  --hub-success:   #28a745;
  --hub-radius:    8px;
  --hub-font:      'Segoe UI', system-ui, sans-serif;
}

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

a { color: var(--hub-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

hr { border: none; border-top: 1px solid var(--hub-border); margin: 1.5rem 0; }

/* ── Loading ───────────────────────────────────────────────────────────────── */

.hub-loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 1rem;
  color: var(--hub-muted);
}

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

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

/* ── Buttons ───────────────────────────────────────────────────────────────── */

.hub-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.55em 1.1em;
  border: none;
  border-radius: var(--hub-radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  text-decoration: none;
}
.hub-btn:hover { opacity: 0.88; text-decoration: none; }
.hub-btn:active { transform: scale(0.97); }

.hub-btn-primary   { background: var(--hub-primary); color: #fff; }
.hub-btn-secondary { background: var(--hub-surface); color: var(--hub-text); border: 1px solid var(--hub-border); }
.hub-btn-tertiary  { background: transparent; color: var(--hub-primary); border: 1px solid var(--hub-primary); }
.hub-btn-sm        { padding: 0.3em 0.7em; font-size: 0.85rem; }

/* ── Badges ────────────────────────────────────────────────────────────────── */

.hub-badge {
  display: inline-block;
  padding: 0.15em 0.55em;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.hub-badge-active   { background: #1a3a1a; color: #4caf50; border: 1px solid #4caf50; }
.hub-badge-upcoming { background: #1a2a3a; color: var(--hub-primary); border: 1px solid var(--hub-primary); }
.hub-badge-past     { background: #2a2a2a; color: var(--hub-muted); border: 1px solid var(--hub-border); }

/* ── Toast ─────────────────────────────────────────────────────────────────── */

.hub-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
  color: var(--hub-text);
  padding: 0.6em 1.2em;
  border-radius: var(--hub-radius);
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 9999;
}
.hub-toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.hub-toast-success { border-color: var(--hub-success); }
.hub-toast-info    { border-color: var(--hub-primary); }

/* ── Public Hub Page ───────────────────────────────────────────────────────── */

#hub-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

.hub-section { margin-bottom: 3rem; }

.hub-section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--hub-text);
  border-bottom: 1px solid var(--hub-border);
  padding-bottom: 0.5rem;
}

/* CTA banner */
.hub-cta-section { margin-bottom: 2.5rem; }

.hub-cta-card {
  background: var(--hub-surface);
  border: 1px solid var(--hub-primary);
  border-radius: var(--hub-radius);
  overflow: hidden;
  margin-bottom: 1rem;
}

.hub-cta-banner {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  display: block;
}

.hub-cta-body {
  padding: 1.5rem;
}

.hub-cta-body h2 { margin-bottom: 0.5rem; font-size: 1.6rem; }
.hub-cta-body p  { margin-bottom: 1rem; color: var(--hub-muted); }

/* Festival grid */
.hub-festival-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.hub-festival-card {
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hub-festival-logo {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.hub-festival-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.hub-festival-info h3   { font-size: 1.1rem; margin-top: 0.3rem; }
.hub-festival-dates     { color: var(--hub-muted); font-size: 0.85rem; }
.hub-festival-info p    { color: var(--hub-muted); font-size: 0.9rem; flex: 1; }
.hub-festival-info .hub-btn { margin-top: auto; align-self: flex-start; }

/* Offseason */
.hub-offseason { border-top: 1px solid var(--hub-border); padding-top: 2rem; }
.hub-offseason-block { margin-bottom: 1.5rem; }
.hub-offseason-block h3 { font-size: 1rem; margin-bottom: 0.75rem; color: var(--hub-muted); text-transform: uppercase; letter-spacing: 0.06em; }

.hub-dj-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.hub-dj-chip {
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
  border-radius: 999px;
  padding: 0.25em 0.75em;
  font-size: 0.85rem;
}

.hub-event-list { list-style: none; margin-bottom: 0.75rem; }
.hub-event-list li { padding: 0.35rem 0; border-bottom: 1px solid var(--hub-border); display: flex; justify-content: space-between; }
.hub-event-date { color: var(--hub-muted); font-size: 0.85rem; }

.hub-empty { color: var(--hub-muted); font-style: italic; }

/* ── Admin Panel ───────────────────────────────────────────────────────────── */

.hub-admin-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

.hub-admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.hub-admin-header h1 { font-size: 1.4rem; }

.hub-admin-login {
  max-width: 400px;
  margin: 4rem auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}
.hub-admin-login h1 { font-size: 1.4rem; }
.hub-admin-login p  { color: var(--hub-muted); }

.hub-admin-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--hub-border);
  margin-bottom: 1.5rem;
}

.hub-admin-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--hub-muted);
  padding: 0.6em 1.1em;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: -1px;
  transition: color 0.15s;
}
.hub-admin-tab:hover  { color: var(--hub-text); }
.hub-admin-tab.active { color: var(--hub-primary); border-bottom-color: var(--hub-primary); }

.hub-admin-section { display: flex; flex-direction: column; gap: 1rem; }

.hub-admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hub-admin-section-header h2 { font-size: 1.1rem; }

.hub-admin-card {
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.hub-admin-card-info { display: flex; align-items: center; gap: 0.75rem; flex: 1; min-width: 0; }
.hub-admin-logo { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.hub-admin-logo-placeholder { width: 48px; height: 48px; background: var(--hub-border); border-radius: 4px; flex-shrink: 0; }
.hub-admin-card-info > div { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.hub-admin-card-info strong { font-size: 0.95rem; }
.hub-admin-meta { font-size: 0.8rem; color: var(--hub-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-admin-card-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

.hub-admin-error {
  background: #3a1a1a;
  border: 1px solid var(--hub-accent);
  color: var(--hub-accent);
  padding: 0.6em 0.9em;
  border-radius: var(--hub-radius);
  font-size: 0.875rem;
}

/* Admin form labels */
.hub-admin-section label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--hub-muted);
}

.hub-admin-section input[type="text"],
.hub-admin-section input[type="date"],
.hub-admin-section select,
.hub-admin-section textarea {
  background: var(--hub-bg);
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius);
  color: var(--hub-text);
  padding: 0.5em 0.75em;
  font-size: 0.95rem;
  font-family: inherit;
  width: 100%;
}

.hub-admin-section input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hub-field-hint { font-size: 0.8rem; color: var(--hub-muted); font-weight: 400; }

.hub-admin-section h3 { font-size: 1rem; color: var(--hub-text); margin-bottom: 0.25rem; }

/* ── Modal ─────────────────────────────────────────────────────────────────── */

.hub-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.hub-modal {
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hub-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--hub-border);
  flex-shrink: 0;
}
.hub-modal-header h2 { font-size: 1.1rem; }

.hub-modal-close {
  background: none;
  border: none;
  color: var(--hub-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}
.hub-modal-close:hover { color: var(--hub-text); }

.hub-modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1;
}

.hub-modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--hub-border);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Modal form inherits admin section label styles */
.hub-modal-body label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--hub-muted);
}
.hub-modal-body input[type="text"],
.hub-modal-body input[type="date"],
.hub-modal-body select,
.hub-modal-body textarea {
  background: var(--hub-bg);
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius);
  color: var(--hub-text);
  padding: 0.5em 0.75em;
  font-size: 0.95rem;
  font-family: inherit;
  width: 100%;
}
.hub-modal-body input:disabled { opacity: 0.5; cursor: not-allowed; }
.hub-modal-body h3 { font-size: 0.95rem; color: var(--hub-text); }

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

@media (max-width: 600px) {
  .hub-festival-grid { grid-template-columns: 1fr; }
  .hub-admin-card { flex-direction: column; align-items: flex-start; }
  .hub-admin-card-actions { width: 100%; }
}
