/* ===== SC Ostertal – Admin Panel Styles ===== */

/* ===== Local Font Faces (DSGVO-konform) ===== */
@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/playfair-display-700.woff2') format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 900; font-display: swap; src: url('../fonts/playfair-display-900.woff2') format('woff2'); }

@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 300; font-display: swap; src: url('../fonts/source-sans-3-300.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/source-sans-3-400.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/source-sans-3-500.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/source-sans-3-600.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/source-sans-3-700.woff2') format('woff2'); }

@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/jetbrains-mono-400.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/jetbrains-mono-500.woff2') format('woff2'); }

:root {
  --bg-primary: #0c0e12;
  --bg-secondary: #13161c;
  --bg-card: #191d26;
  --bg-card-hover: #1e2330;
  --bg-elevated: #222838;
  --bg-input: #161a22;
  --gold: #c9a54e;
  --gold-light: #e0c274;
  --gold-dim: #8b7234;
  --text-primary: #e8e4dc;
  --text-secondary: #9a9690;
  --text-muted: #5e5b56;
  --accent-green: #4a9e6e;
  --accent-red: #c45c5c;
  --border: #2a2e38;
  --border-light: #353a46;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Source Sans 3', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,0.35);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== Admin Layout ===== */
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 14, 18, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}

.admin-topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.admin-topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-topbar-left a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: var(--transition);
}

.admin-topbar-left a:hover { color: var(--gold); }

.admin-topbar h1 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-topbar h1 .icon {
  color: var(--gold);
  font-size: 1.3rem;
}

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

.admin-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

/* ===== Login ===== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem;
  width: 100%;
  max-width: 440px;
  text-align: center;
}

.login-card .logo {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.login-card h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.login-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.login-card .help-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1rem;
  line-height: 1.6;
}

.login-card .help-text a {
  color: var(--gold);
  text-decoration: none;
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: 1.25rem;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

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

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(201, 165, 78, 0.1);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

.form-group input[type="password"] {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  letter-spacing: 0.02em;
  text-decoration: none;
}

.btn-primary {
  background: var(--gold);
  color: var(--bg-primary);
  width: 100%;
}

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

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

.btn-sm {
  padding: 8px 16px;
  font-size: 0.82rem;
  width: auto;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}

.btn-danger {
  background: rgba(196, 92, 92, 0.12);
  color: var(--accent-red);
  border: 1px solid rgba(196, 92, 92, 0.25);
}

.btn-danger:hover {
  background: rgba(196, 92, 92, 0.2);
}

.btn-success {
  background: rgba(74, 158, 110, 0.12);
  color: var(--accent-green);
  border: 1px solid rgba(74, 158, 110, 0.25);
}

.btn-success:hover {
  background: rgba(74, 158, 110, 0.2);
}

/* ===== Tabs ===== */
.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
  overflow-x: auto;
}

.admin-tab {
  padding: 14px 24px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-family: var(--font-body);
}

.admin-tab:hover { color: var(--text-secondary); }

.admin-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* ===== Content Panels ===== */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.panel-header h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
}

/* ===== Item List ===== */
.item-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.item-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  transition: var(--transition);
}

.item-card:hover {
  border-color: var(--border-light);
}

.item-info { flex: 1; }

.item-info h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.item-info .meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.item-info .preview {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 0.4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

/* ===== Modal / Editor ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  transform: translateY(20px);
  transition: var(--transition);
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
  transition: var(--transition);
}

.modal-close:hover { color: var(--text-primary); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* ===== Toast / Status ===== */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 300;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  transform: translateY(20px);
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  background: rgba(74, 158, 110, 0.15);
  border: 1px solid rgba(74, 158, 110, 0.3);
  color: var(--accent-green);
}

.toast.error {
  background: rgba(196, 92, 92, 0.15);
  border: 1px solid rgba(196, 92, 92, 0.3);
  color: var(--accent-red);
}

/* ===== Status indicator ===== */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  display: inline-block;
}

.status-dot.offline { background: var(--accent-red); }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .admin-main { padding: 1rem; }
  .form-row { grid-template-columns: 1fr; }
  .item-card { flex-direction: column; }
  .item-actions { align-self: flex-end; }
  .modal { padding: 1.5rem; margin: 1rem; }
  .login-card { padding: 2rem; }
}
