:root {
  --bg-main: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
  --surface: rgba(20, 20, 20, 0.95);
  --primary-red: #8b0000;
  --soft-red-glow: rgba(139, 0, 0, 0.4);
  --bright-red: #ff6b6b;
  --text-main: #e0e0e0;
  --text-secondary: #a0a0a0;
  --text-secondary-light: #d0d0d0;
  --text-muted: #606060;
  --surface-strong: rgba(24, 24, 24, 0.98);
  --line-glow: rgba(255, 107, 107, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  color: var(--text-main);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0.2px;
  background: var(--bg-main);
}

.overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(139, 0, 0, 0.16), transparent 45%);
  pointer-events: none;
}

.auth-toggle-button {
  margin-top: 0;
  z-index: 5;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12px;
  backdrop-filter: blur(6px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 58px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid rgba(139, 0, 0, 0.5);
  background: linear-gradient(180deg, rgba(22, 22, 22, 0.96) 0%, rgba(14, 14, 14, 0.9) 100%);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.site-title {
  margin-top: 0;
  margin-bottom: 0;
  color: var(--primary-red);
  font-size: 16px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(139, 0, 0, 0.35);
}

.auth-modal {
  position: fixed;
  top: 64px;
  right: 14px;
  z-index: 6;
  width: min(640px, calc(100vw - 28px));
  margin-bottom: 0;
}

.auth-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.close-button {
  margin-top: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  padding: 0;
}

.layout {
  height: 100%;
  padding-top: 58px;
  padding-bottom: 38px;
  position: relative;
  z-index: 1;
}

.panel {
  background: linear-gradient(165deg, var(--surface-strong) 0%, rgba(16, 16, 16, 0.95) 100%);
  border: 1px solid rgba(139, 0, 0, 0.3);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 22px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55), 0 0 24px var(--soft-red-glow);
}

.panel h2 {
  margin-top: 0;
  color: var(--primary-red);
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.form-card,
.event-form {
  display: grid;
  gap: 10px;
}

.user-form {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(139, 0, 0, 0.3);
}

label {
  font-size: 14px;
  color: var(--text-secondary);
}

input,
textarea {
  background: rgba(10, 10, 10, 0.85);
  border: 1px solid rgba(139, 0, 0, 0.35);
  border-radius: 10px;
  color: var(--text-main);
  padding: 10px 12px;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--bright-red);
  box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.2);
}

button {
  margin-top: 6px;
  border: 1px solid rgba(139, 0, 0, 0.6);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-main);
  background: linear-gradient(180deg, #2a0000 0%, #1b0000 100%);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

button:hover {
  box-shadow: 0 0 14px var(--soft-red-glow);
  border-color: var(--bright-red);
  transform: translateY(-1px);
}

.timeline {
  position: relative;
  display: flex;
  flex-direction: row-reverse;
  gap: 18px;
  padding: 48px 20px 40px;
  min-height: calc(100vh - 96px);
  align-items: flex-start;
  overflow-x: auto;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 0, 0, 0.45) rgba(15, 15, 15, 0.55);
}

body.admin-layout .timeline {
  padding-left: 420px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  top: 26px;
  height: 2px;
  background: linear-gradient(to right, rgba(139, 0, 0, 0.92), rgba(139, 0, 0, 0.1));
  box-shadow: 0 0 12px var(--line-glow);
}

body.admin-layout .timeline::before {
  left: 420px;
}

.timeline-item {
  position: relative;
  flex: 0 0 min(360px, 78vw);
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(139, 0, 0, 0.3);
  background: rgba(16, 16, 16, 0.92);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 16px rgba(139, 0, 0, 0.16);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.timeline-item:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 107, 107, 0.45);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), 0 0 18px rgba(139, 0, 0, 0.24);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 18px;
  top: -28px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bright-red);
  box-shadow: 0 0 10px var(--soft-red-glow);
}

.timeline-item h3 {
  margin: 0 0 8px;
  color: var(--text-main);
}

.meta {
  margin: 0 0 10px;
  color: var(--bright-red);
  font-size: 13px;
  letter-spacing: 0.3px;
}

.timeline-item p {
  margin: 0;
  color: var(--text-secondary-light);
}

.delete-event-button {
  margin-top: 12px;
  padding: 6px 10px;
  font-size: 12px;
  border-color: rgba(255, 107, 107, 0.65);
}

.details-event-button {
  margin-top: 8px;
  padding: 6px 10px;
  font-size: 12px;
}

.timeline-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(139, 0, 0, 0.25);
  margin: 0 0 10px;
}

.drop-zone {
  border: 1px dashed rgba(139, 0, 0, 0.7);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  color: var(--text-secondary-light);
  background: rgba(10, 10, 10, 0.75);
  cursor: pointer;
}

.drop-zone-active {
  border-color: var(--bright-red);
  box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.2);
}

.hidden-file-input {
  display: none;
}

.upload-preview {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(139, 0, 0, 0.35);
}

.details-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
}

.details-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}

.details-content {
  position: relative;
  z-index: 1;
  width: min(900px, calc(100vw - 30px));
  max-height: calc(100vh - 30px);
  overflow-y: auto;
  padding: 22px;
  border-radius: 14px;
  border: 1px solid rgba(139, 0, 0, 0.4);
  background: linear-gradient(165deg, rgba(20, 20, 20, 0.98) 0%, rgba(12, 12, 12, 0.95) 100%);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65), 0 0 24px var(--soft-red-glow);
}

.details-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.details-image {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid rgba(139, 0, 0, 0.35);
  margin: 8px 0 14px;
  background: rgba(10, 10, 10, 0.6);
}

.details-description {
  white-space: pre-wrap;
  line-height: 1.5;
  color: var(--text-secondary-light);
}

.add-panel {
  position: fixed;
  top: 72px;
  left: 14px;
  width: min(380px, calc(100vw - 28px));
  max-height: calc(100vh - 86px);
  overflow-y: auto;
  z-index: 4;
  border-color: rgba(139, 0, 0, 0.42);
}

.empty-state {
  position: fixed;
  top: 86px;
  left: 20px;
  color: var(--text-muted);
  pointer-events: none;
}

body.admin-layout .empty-state {
  left: 420px;
}

.hidden {
  display: none;
}

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

.toast {
  position: fixed;
  right: 18px;
  bottom: 52px;
  background: rgba(20, 20, 20, 0.96);
  border: 1px solid rgba(139, 0, 0, 0.45);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: 0 0 20px var(--soft-red-glow);
}

.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-size: 12px;
  color: var(--text-secondary);
  border-top: 1px solid rgba(139, 0, 0, 0.35);
  background: rgba(14, 14, 14, 0.92);
  backdrop-filter: blur(8px);
  z-index: 5;
  letter-spacing: 0.3px;
}

@media (max-width: 700px) {
  .auth-grid {
    grid-template-columns: 1fr;
  }

  .site-title {
    font-size: 14px;
  }

  .timeline {
    padding-left: 12px;
    padding-right: 12px;
  }

  body.admin-layout .timeline {
    padding-left: 12px;
  }

  .timeline::before {
    left: 12px;
    right: 12px;
  }

  body.admin-layout .timeline::before {
    left: 12px;
  }

  body.admin-layout .empty-state {
    left: 12px;
  }
}
