/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: 'Inter', sans-serif; background: #f0f2f7; color: #111827; line-height: 1.5; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font: inherit; }
textarea { resize: vertical; }
img { max-width: 100%; display: block; }

/* ===== TOKENS ===== */
:root {
  --blue:       #003F8A;
  --blue-dark:  #002A5E;
  --blue-light: #1560C0;
  --blue-xlight:#e8f0fb;
  --white:      #ffffff;
  --bg:         #f0f2f7;
  --border:     #d1d8e6;
  --text:       #111827;
  --muted:      #6b7280;
  --danger:     #dc2626;
  --success:    #16a34a;
  --radius:     8px;
  --shadow:     0 2px 12px rgba(0,0,0,0.08);
}

/* ===== LOGIN ===== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 100%);
  padding: 24px;
}

.login-card {
  background: var(--white);
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
  text-align: center;
}

.login-logo {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.login-card h1 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 4px;
}

.login-card > p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

.login-card form { display: flex; flex-direction: column; gap: 16px; }

.login-error {
  font-size: 0.875rem;
  color: var(--danger);
  font-weight: 500;
}

/* ===== ADMIN PANEL ===== */
.admin-panel { min-height: 100vh; display: flex; flex-direction: column; }

.admin-header {
  background: var(--blue);
  color: var(--white);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.admin-header__title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-header__actions { display: flex; gap: 8px; }

.admin-layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ===== SIDEBAR ===== */
.admin-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  transition: all 0.2s ease;
  text-align: left;
}

.tab-btn:hover {
  background: var(--blue-xlight);
  color: var(--blue);
}

.tab-btn.active {
  background: var(--blue-xlight);
  color: var(--blue);
  font-weight: 600;
}

.tab-btn--util {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.85rem;
}

.tab-btn--util:hover { color: var(--blue); }

.tab-icon { font-size: 1rem; }

.sidebar-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 8px 0;
}

/* ===== CONTENT AREA ===== */
.admin-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  max-width: 860px;
}

.tab-pane.hidden { display: none !important; }

.tab-header {
  margin-bottom: 24px;
}

.tab-header h2 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
}

.tab-header p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* ===== CARDS ===== */
.a-card {
  background: var(--white);
  border-radius: 12px;
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ===== FORM ELEMENTS ===== */
.a-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.a-form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.a-form-group small {
  font-weight: 400;
  color: var(--muted);
}

.a-form-group input,
.a-form-group textarea,
.a-form-group select {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.a-form-group input:focus,
.a-form-group textarea:focus,
.a-form-group select:focus {
  outline: none;
  border-color: var(--blue);
}

.a-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.a-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

/* ===== BUTTONS ===== */
.a-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s ease;
  white-space: nowrap;
  cursor: pointer;
}

.a-btn--primary {
  background: var(--blue);
  color: var(--white);
  border: none;
}

.a-btn--primary:hover { background: var(--blue-light); }

.a-btn--ghost {
  background: transparent;
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.3);
}

.a-btn--ghost:hover {
  background: rgba(255,255,255,0.12);
  color: var(--white);
}

.a-btn--danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid #fca5a5;
  padding: 7px 14px;
  font-size: 0.8rem;
}

.a-btn--danger:hover { background: #fee2e2; }

.a-btn--edit {
  background: var(--blue-xlight);
  color: var(--blue);
  border: 1px solid #bfdbfe;
  padding: 7px 14px;
  font-size: 0.8rem;
}

.a-btn--edit:hover { background: #dbeafe; }

.a-btn--secondary {
  background: var(--white);
  color: var(--text);
  border: 1.5px solid var(--border);
}

.a-btn--secondary:hover { background: var(--bg); }

/* ===== IMAGE UPLOAD ===== */
.img-upload-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.img-upload-wrap input[type="text"] {
  flex: 1;
  min-width: 200px;
}

.img-upload-or {
  font-size: 0.8rem;
  color: var(--muted);
  flex-shrink: 0;
}

.img-preview {
  margin-top: 8px;
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 180px;
}

.img-preview img {
  max-height: 180px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* ===== STATS EDITOR ===== */
.stats-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-editor-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 12px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius);
}

/* ===== ITEM LIST (Events / Sponsors) ===== */
.item-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.item-card {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.item-card__info { flex: 1; }

.item-card__title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 4px;
}

.item-card__meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.item-card__badge {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--blue-xlight);
  color: var(--blue);
  margin-left: 8px;
}

.item-card__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ===== INLINE FORM (Events / Sponsors) ===== */
.inline-form {
  background: var(--white);
  border: 2px solid var(--blue);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.inline-form h3 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 16px;
}

.inline-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.inline-form-grid .span2 { grid-column: 1 / -1; }

.inline-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

/* ===== GALERIE ADMIN GRID ===== */
.galerie-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.galerie-admin-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.galerie-admin-item img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.galerie-admin-item .no-img {
  width: 100%;
  height: 140px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--border);
}

.galerie-admin-item__info {
  padding: 10px 12px;
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.galerie-admin-item__delete {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(220,38,38,0.85);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.galerie-admin-item__delete:hover { background: var(--danger); }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--text);
  color: var(--white);
  padding: 12px 22px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 1000;
  transition: opacity 0.3s, transform 0.3s;
  transform: translateY(0);
}

.toast.hidden {
  display: none;
}

.toast--success { background: var(--success); }
.toast--error   { background: var(--danger); }

/* ===== VIDEO UPLOAD ===== */
.video-upload-area {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--bg);
}

.video-upload-area:hover,
.video-upload-area.dragover {
  border-color: var(--blue);
  background: var(--blue-xlight);
}

.video-upload-area.dragover {
  border-style: solid;
}

.video-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text);
}

.video-upload-label small { color: var(--muted); font-size: 0.8rem; }

.video-upload-icon { font-size: 2.4rem; line-height: 1; }

.video-info {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--success);
}

.video-progress {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.video-progress-bar {
  height: 6px;
  background: var(--blue);
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s linear;
}

#h-video-progress span {
  font-size: 0.82rem;
  color: var(--muted);
}

/* ===== ANFRAGEN ===== */
.anfragen-badge {
  margin-left: auto;
  background: #dc2626;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

.anfrage-unread {
  border-left: 4px solid var(--blue);
}

/* ===== UTILITY ===== */
.hidden { display: none !important; }

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
  .admin-sidebar { width: 180px; }
  .admin-content { padding: 20px 16px; }
  .inline-form-grid { grid-template-columns: 1fr; }
  .stat-editor-row { grid-template-columns: 1fr; }
}
