/* ==================== DESIGN TOKENS ==================== */
:root {
  /* Transavia Brand Colors */
  --brand-green: #01AB61;
  --brand-green-dark: #019953;
  --brand-green-light: #e6f9f0;
  --brand-magenta: #E20076;
  --brand-magenta-dark: #c70068;
  --brand-magenta-light: #fce6f1;

  /* Semantic Colors */
  --accent-primary: var(--brand-green);
  --accent-primary-hover: var(--brand-green-dark);
  --accent-secondary: var(--brand-magenta);
  --accent-secondary-hover: var(--brand-magenta-dark);

  /* Background & Surface */
  --bg-body: #F6F5FA;
  --bg-surface: #FFFFFF;
  --bg-surface-hover: #f9f9fb;
  --bg-elevated: #FFFFFF;
  --bg-muted: #f0f0f5;
  --bg-input: #FFFFFF;

  /* Text */
  --text-primary: #1A1A2E;
  --text-secondary: #6B7280;
  --text-tertiary: #9CA3AF;

  /* Borders */
  --border: #E5E7EB;
  --border-hover: #D1D5DB;
  --border-focus: var(--brand-green);

  /* Status */
  --success: #01AB61;
  --success-bg: #e6f9f0;
  --error: #EF4444;
  --error-bg: #FEF2F2;
  --warning: #F59E0B;
  --warning-bg: #FFFBEB;
  --info: #3B82F6;
  --info-bg: #EFF6FF;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition: 0.2s ease;
  --transition-slow: 0.4s ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-primary-hover);
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ==================== BACKGROUND PATTERN ==================== */
.bg-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(1, 171, 97, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(226, 0, 118, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ==================== LAYOUT ==================== */
.container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-lg);
}

/* ==================== NAVBAR ==================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand-green) !important;
  text-decoration: none;
}

.logo-icon {
  font-size: 1.5rem;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(1, 171, 97, 0.25);
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  color: #fff;
  box-shadow: 0 4px 16px rgba(1, 171, 97, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-muted);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 14px;
}

.btn-ghost:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--error);
  color: #fff;
}

.btn-danger:hover {
  background: #DC2626;
  color: #fff;
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--accent-secondary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(226, 0, 118, 0.25);
}

.btn-accent:hover {
  background: var(--accent-secondary-hover);
  color: #fff;
  box-shadow: 0 4px 16px rgba(226, 0, 118, 0.35);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ==================== CARDS ==================== */
.card-flat {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.card-flat:hover {
  box-shadow: var(--shadow-md);
}

/* ==================== FORMS ==================== */
.input-group,
.form-group {
  margin-bottom: var(--space-md);
}

.input-group label,
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.input-group input,
.input-group textarea,
.input-group select,
.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: all var(--transition);
  font-family: inherit;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus,
.form-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(1, 171, 97, 0.12);
}

.input-group input::placeholder,
.form-input::placeholder {
  color: var(--text-tertiary);
}

.form-error {
  background: var(--error-bg);
  color: #991B1B;
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  margin-bottom: var(--space-md);
  display: none;
}

.form-error.visible {
  display: block;
}

.subtitle {
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

/* Auth Page Layout */
.auth-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.auth-page .card-flat {
  max-width: 440px;
  width: 100%;
}

/* ==================== TOAST ==================== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
  max-width: 420px;
  backdrop-filter: blur(8px);
}

.toast.success {
  background: var(--success-bg);
  color: #065F46;
  border: 1px solid rgba(1, 171, 97, 0.2);
}

.toast.error {
  background: var(--error-bg);
  color: #991B1B;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.toast.info {
  background: var(--info-bg);
  color: #1E40AF;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.toast.warning {
  background: var(--warning-bg);
  color: #92400E;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* ==================== MODAL ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  max-width: 480px;
  width: 90%;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal h2 {
  margin-bottom: var(--space-md);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

/* ==================== SPINNER ==================== */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: var(--space-2xl);
  color: var(--text-secondary);
}

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

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

.spinner-sm {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

/* ==================== LANDING PAGE ==================== */
.hero {
  text-align: center;
  padding: var(--space-3xl) 0;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: var(--space-md);
  background: linear-gradient(135deg, var(--brand-green), var(--brand-magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto var(--space-xl);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-2xl);
}

.feature-card {
  text-align: center;
  padding: var(--space-xl);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  display: block;
}

.feature-card h3 {
  margin-bottom: var(--space-sm);
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* CTA */
.cta-section {
  text-align: center;
  padding: var(--space-3xl) 0;
  margin-top: var(--space-2xl);
}

.cta-section h2 {
  font-size: 2rem;
  margin-bottom: var(--space-md);
}

.cta-section p {
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

/* Footer */
.footer {
  text-align: center;
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--border);
  margin-top: var(--space-3xl);
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

/* ==================== AUTH PAGES ==================== */
.auth-container {
  max-width: 440px;
  margin: var(--space-3xl) auto;
}

.auth-card {
  text-align: center;
}

.auth-card h1 {
  font-size: 1.75rem;
  margin-bottom: var(--space-sm);
}

.auth-card p {
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

.auth-card form {
  text-align: left;
}

.auth-card .btn-primary {
  width: 100%;
  margin-top: var(--space-sm);
}

.auth-footer {
  text-align: center;
  margin-top: var(--space-lg);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ==================== DASHBOARD ==================== */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  gap: var(--space-md);
  flex-wrap: wrap;
}

.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-lg);
}

.event-card {
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  padding: 0;
}

.event-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-hover);
}

.event-card-color {
  height: 6px;
  width: 100%;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.event-card-body {
  padding: var(--space-md) var(--space-lg) var(--space-lg);
}

.event-card h3 {
  font-size: 1.1rem;
  margin-top: var(--space-sm);
  margin-bottom: var(--space-xs);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-date {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: var(--space-sm);
}

.event-stats {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--text-tertiary);
  font-size: 0.8rem;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border);
  margin-top: var(--space-sm);
}

.event-stats span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.event-card-badges {
  display: flex;
  gap: 6px;
  margin-top: var(--space-sm);
  flex-wrap: wrap;
}

.event-card-badges .badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.badge-green {
  background: var(--success-bg);
  color: #065F46;
}

.badge-muted {
  background: var(--bg-muted);
  color: var(--text-secondary);
}

/* ==================== EVENT DETAIL ==================== */
.event-header {
  margin-bottom: var(--space-xl);
}

.event-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.event-header h1 {
  margin-bottom: var(--space-xs);
}

.event-meta {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Toolbar */
.event-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.selection-count {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Media Grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.media-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--bg-muted);
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
}

.media-item img,
.media-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-item.selected {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(1, 171, 97, 0.2);
}

.media-item:hover {
  transform: scale(1.02);
}

.media-checkbox {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-primary);
  z-index: 2;
  cursor: pointer;
  transition: all var(--transition);
}

.media-item.selected .media-checkbox {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

.media-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 50%, rgba(0, 0, 0, 0.5));
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--space-md);
}

.media-item:hover .media-overlay {
  opacity: 1;
}

.media-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  z-index: 2;
}

/* Excluded media items */
.media-item.excluded {
  opacity: 0.45;
  border-color: rgba(239, 68, 68, 0.4);
}

.media-item.excluded:hover {
  opacity: 0.7;
}

.excluded-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  z-index: 2;
  backdrop-filter: blur(4px);
}

/* Panels Grid */
.panels-grid {
  display: flex;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
  align-items: flex-start;
  max-width: 1200px;
  /* Match container */
  width: 100%;
}

.panels-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  min-width: 0;
}

.panel {
  width: 100%;
}

.panel h3 {
  margin-bottom: var(--space-md);
}


/* QR Code */
.qr-container {
  text-align: center;
}

.qr-container img {
  width: 280px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1;
  margin: var(--space-md) auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  display: block;
}

.qr-container .btn-primary {
  width: 280px;
  max-width: 100%;
  margin-bottom: var(--space-md);
}

.share-link {
  display: flex;
  gap: 8px;
  padding: var(--space-md) 0;
  min-width: 0;
}

/* Divider before the URL bar if it follows settings */
.setting-item+.share-link,
.reveal-wrapper+.share-link,
.password-field-row+.share-link {
  border-top: 1px solid var(--border);
}

.share-link input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Settings Panels */
.setting-item {
  min-width: 0;
}

.setting-item+.setting-item {
  border-top: 1px solid var(--border);
}

/* Toggle */
.toggle-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: none !important;
  min-width: 0;
}

.toggle-group>div:first-child {
  min-width: 0;
}

.toggle-label {
  font-weight: 600;
  font-size: 0.9rem;
  overflow-wrap: break-word;
  word-break: break-word;
}

.toggle-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
  overflow-wrap: break-word;
  word-break: break-word;
}

.toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.toggle input:checked+.toggle-slider {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.toggle input:checked+.toggle-slider::before {
  transform: translateX(22px);
}

/* ==================== LIGHTBOX ==================== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-content img,
.lightbox-content video {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-md);
}

.lightbox-close,
.lightbox-nav {
  position: fixed;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  cursor: pointer;
  z-index: 3001;
  transition: all var(--transition);
}

.lightbox-close {
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

/* ==================== UPLOAD PAGE ==================== */
.upload-container {
  max-width: 700px;
}

.upload-card {
  text-align: center;
}

.upload-header h1 {
  font-size: 1.75rem;
  margin-bottom: var(--space-sm);
}

.upload-header p {
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-muted);
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent-primary);
  background: var(--brand-green-light);
}

.dropzone-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.dropzone-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

.dropzone-text strong {
  color: var(--text-primary);
  font-size: 1.05rem;
}

/* Preview Grid */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.preview-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--bg-muted);
}

.preview-item img,
.preview-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.preview-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 0.65rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-size {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  font-size: 0.6rem;
}

/* Progress */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-green), var(--brand-green-dark));
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* Upload Success */
.upload-success {
  padding: var(--space-xl);
}

.success-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.upload-success h2 {
  margin-bottom: var(--space-sm);
  color: var(--accent-primary);
}

.upload-success p {
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.success-gallery {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.success-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
}

/* ==================== UTILITIES ==================== */
.d-flex {
  display: flex;
}

.gap-1 {
  gap: var(--space-sm);
}

.mt-2 {
  margin-top: var(--space-md);
}

.mt-3 {
  margin-top: var(--space-lg);
}

.text-center {
  text-align: center;
}

/* ==================== PASSWORD GATE ==================== */
.password-gate {
  padding: var(--space-xl);
  text-align: center;
}

.password-gate-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.password-gate h2 {
  margin-bottom: var(--space-sm);
}

.password-gate p {
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.password-form .form-group {
  max-width: 320px;
  margin: 0 auto var(--space-md);
}

.password-form .btn {
  max-width: 320px;
}

/* Password field row */
.password-field-row {
  display: flex;
  gap: 8px;
  margin-top: var(--space-sm);
  align-items: center;
}

.password-field-row .form-input {
  flex: 1;
  min-width: 0;
}



/* Upload notice */
.upload-notice {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 8px 16px;
  background: var(--warning-bg);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245, 158, 11, 0.2);
  margin-top: var(--space-sm);
  margin-bottom: var(--space-md);
}

/* ==================== FOOTER ==================== */
.site-footer {
  text-align: center;
  padding: var(--space-lg) var(--space-md);
  margin-top: var(--space-xl);
  color: var(--text-tertiary);
  font-size: 0.8rem;
}

.site-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

.site-footer a:hover {
  color: var(--accent-primary);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: stretch;
  }

  .events-grid {
    grid-template-columns: 1fr;
  }

  .event-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-left,
  .toolbar-right {
    justify-content: center;
    flex-wrap: wrap;
  }

  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-sm);
  }

  .panels-grid {
    flex-direction: column;
    max-width: 100%;
    gap: 0;
  }

  .panels-col {
    display: contents;
  }

  .panel {
    margin-bottom: var(--space-md);
    /* Reduced mobile spacing */
  }

  #qrPanel {
    order: 1;
  }

  #uploadPanel {
    order: 2;
  }

  #galleryPanel {
    order: 3;
  }

  #slideshowPanel {
    order: 4;
  }

  .event-header-top {
    flex-direction: column;
  }

  .container {
    padding: var(--space-md);
  }

  h1 {
    font-size: 1.5rem;
  }
}

@media (max-width: 1100px) and (min-width: 769px) {
  /* Let auto-fill handle it */
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.6rem;
  }

  .media-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .features-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== ANIMATIONS ==================== */
.reveal-wrapper {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--transition-slow);
  overflow: hidden;
}

.reveal-wrapper.show {
  grid-template-rows: 1fr;
}

.reveal-content {
  min-height: 0;
  border-top: 1px solid var(--border);
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  transform: translateY(-10px);
}

/* Don't show the top border when it's specifically for the password text box expansion */
[id$="PasswordFields"]>.reveal-content {
  border-top: none;
}

.indented-setting {
  padding-left: 12px !important;
  border-left: 2px solid var(--border) !important;
  margin-left: 8px !important;
}

.reveal-wrapper.show .reveal-content {
  opacity: 1;
  transform: translateY(0);
}

.reveal-content>.share-link {
  padding-left: 12px;
  padding-right: 12px;
}

.reveal-content>.btn-primary:last-child {
  margin-top: 0 !important;
  margin-bottom: var(--space-md);
  width: calc(100% - 24px) !important;
  margin-left: auto;
  margin-right: auto;
  display: block;
}

.password-set-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  background: var(--brand-green-light);
  color: var(--brand-green-dark);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(1, 171, 97, 0.2);
  animation: badgeReveal 0.4s ease forwards;
}

@keyframes badgeReveal {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}