/* advevents v0.1 - QR Code + PIN GPX Release Management */
:root {
  --bg: #0f1216;
  --panel: #151a20;
  --panel-light: #1a2028;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #f97316;
  --accent-light: #fb923c;
  --chip: #222831;
  --green: #22c55e;
  --yellow: #eab308;
  --orange: #f97316;
  --red: #ef4444;
  --blue: #3b82f6;
  --purple: #a855f7;
  --border: #2a2f36;
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;
  --info: #3b82f6;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Header / Footer */
.site-header, .site-footer {
  padding: 14px 18px;
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  height: 40px;
  width: auto;
}

.brand {
  font-weight: 400;
  font-size: 2rem;
}

.ver {
  font-size: 0.9rem;
  color: var(--muted);
  margin-left: 6px;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  margin-left: 12px;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background 0.2s;
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.site-nav a.active {
  background: var(--accent);
  color: #fff;
}

.site-footer {
  flex-direction: column;
  gap: 8px;
  text-align: center;
  border-top: 1px solid var(--border);
  padding: 16px 18px;
}

.footer-brand {
  color: var(--text);
  font-weight: 400;
}

.footer-links {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Container */
.container {
  max-width: 960px;
  margin: 24px auto;
  padding: 20px;
  background: var(--panel);
  border-radius: 12px;
}

.container.wide {
  max-width: 1200px;
}

.container.narrow {
  max-width: 480px;
}

/* Cards */
.card {
  background: var(--panel);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

.card h3 {
  margin: 0 0 12px 0;
  color: var(--accent);
  font-size: 1.1rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-header h3 {
  margin: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.btn:hover {
  background: var(--accent-light);
  text-decoration: none;
}

.btn.secondary {
  background: #39414a;
}

.btn.secondary:hover {
  background: #4a5568;
}

.btn.danger {
  background: var(--danger);
}

.btn.danger:hover {
  background: #dc2626;
}

.btn.success {
  background: var(--success);
}

.btn.success:hover {
  background: #16a34a;
}

.btn.outline {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn.outline:hover {
  background: var(--accent);
  color: #fff;
}

.btn.small {
  padding: 6px 10px;
  font-size: 0.85rem;
}

.btn.large {
  padding: 14px 24px;
  font-size: 1.1rem;
}

.btn.block {
  display: flex;
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Forms */
label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text);
}

input, select, textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

input::placeholder, textarea::placeholder {
  color: var(--muted);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

.form-group {
  margin-bottom: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
}

.form-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* Checkbox / Radio */
.checkbox-label, .radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-label input, .radio-label input {
  width: auto;
  accent-color: var(--accent);
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.alert.success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
  border: 1px solid var(--success);
}

.alert.warning {
  background: rgba(234, 179, 8, 0.15);
  color: var(--warning);
  border: 1px solid var(--warning);
}

.alert.danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid var(--danger);
}

.alert.info {
  background: rgba(59, 130, 246, 0.15);
  color: var(--info);
  border: 1px solid var(--info);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--panel-light);
  font-weight: 600;
  color: var(--muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge.green { background: var(--green); color: #000; }
.badge.yellow { background: var(--yellow); color: #000; }
.badge.orange { background: var(--orange); color: #fff; }
.badge.red { background: var(--red); color: #fff; }
.badge.blue { background: var(--blue); color: #fff; }
.badge.purple { background: var(--purple); color: #fff; }
.badge.gray { background: #4b5563; color: #fff; }

/* Status badges */
.status-draft { background: #4b5563; color: #fff; }
.status-published { background: var(--blue); color: #fff; }
.status-active { background: var(--green); color: #000; }
.status-completed { background: #6b7280; color: #fff; }
.status-cancelled { background: var(--red); color: #fff; }

/* Login page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg) 0%, #1a1f28 100%);
}

.login-box {
  background: var(--panel);
  padding: 32px;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.login-box .brand {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 8px;
  color: var(--accent);
}

.login-box .subtitle {
  text-align: center;
  color: var(--muted);
  margin-bottom: 24px;
}

/* Dashboard stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--panel);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  text-align: center;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 4px;
}

/* Event cards */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.event-card {
  background: var(--panel);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.event-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.event-card-content {
  padding: 16px;
}

.event-card-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 8px 0;
}

.event-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.event-card-description {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* QR Code display */
.qr-container {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 280px;
  margin: 0 auto;
}

.qr-code {
  width: 200px;
  height: 200px;
}

.qr-label {
  color: #000;
  font-weight: 600;
  text-align: center;
}

/* PIN entry */
.pin-input {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 24px 0;
}

.pin-input input {
  width: 60px;
  height: 70px;
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  border-radius: 12px;
}

/* Day cards */
.day-card {
  background: var(--panel);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.day-card.locked {
  opacity: 0.6;
}

.day-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.day-card-title {
  font-size: 1.3rem;
  font-weight: 600;
}

.gpx-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.gpx-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 8px;
}

.gpx-item:last-child {
  margin-bottom: 0;
}

.gpx-info {
  flex: 1;
}

.gpx-name {
  font-weight: 600;
}

.gpx-desc {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Broadcast banner */
.broadcast-banner {
  background: var(--danger);
  color: #fff;
  padding: 12px 20px;
  text-align: center;
  font-weight: 500;
}

.broadcast-banner.urgent {
  background: var(--warning);
  color: #000;
}

.broadcast-banner.critical {
  background: var(--danger);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Loading spinner */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 10000;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.empty-state-title {
  font-size: 1.3rem;
  color: var(--text);
  margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .site-nav {
    display: none;
  }
  
  .container {
    margin: 12px;
    padding: 16px;
  }
  
  .pin-input input {
    width: 50px;
    height: 60px;
    font-size: 1.5rem;
  }
}
