/* Lokale Schriftarten (Arial, Calibri, sans-serif) */

:root {
  /* Color System - Friendly Warm Light Theme (blacksheep-kultur.de style) */
  --bg-dark: #f5f7fa;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --border-color: rgba(230, 126, 34, 0.22);
  --border-focus: #e67e22;
  
  --primary: #e67e22; /* Warm Golden Amber / Orange */
  --primary-hover: #d35400;
  --primary-rgb: 230, 126, 34;
  
  --accent-light: #f39c12;
  --success: #27ae60;
  --danger: #e74c3c;
  --info: #2980b9;
  
  --text-main: #1e293b; /* Dark slate, clear & readable */
  --text-muted: #64748b;
  --text-dark: #ffffff;
  
  /* Layout & Animations */
  --radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --blur: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, Calibri, sans-serif;
  background-color: #f5f7fa;
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(ellipse 90% 50% at 50% -5%, rgba(243, 156, 18, 0.15) 0%, transparent 70%),
    radial-gradient(circle at 10% 20%, rgba(230, 126, 34, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(39, 174, 96, 0.06) 0%, transparent 45%),
    linear-gradient(180deg, #fbfcfd 0%, #edf1f6 100%);
  background-attachment: fixed;
}

/* Typography headers */
h1, h2, h3, h4, h5, h6 {
  font-family: Arial, Calibri, sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #0f172a;
}

/* App Header */
.app-header {
  background: #ffffff;
  border-bottom: 2px solid rgba(230, 126, 34, 0.35);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.9rem 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.logo-img {
  height: 40px;
  width: auto;
  display: block;
}

.logo-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e293b;
  border-left: 2px solid var(--primary);
  padding-left: 0.75rem;
  margin-left: 0.25rem;
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.01em;
  line-height: 1;
}

.nav-links {
  display: flex;
  gap: 1rem;
}

.nav-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-btn:hover {
  color: #0f172a;
  background: #e2e8f0;
}

.nav-btn.active {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
}

.auth-status-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Badge for Roles */
.role-badge {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.role-badge.admin {
  background: rgba(230, 126, 34, 0.12);
  border-color: rgba(230, 126, 34, 0.35);
  color: #d35400;
}

/* Main Area */
.app-main {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 2rem;
}

.page-view {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.page-view.active {
  display: block;
}

#view-login-gate.active {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  padding: 2rem 1rem;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
  transition: var(--transition);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.05);
}

.glass-card:hover {
  border-color: rgba(230, 126, 34, 0.4);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.08);
}

.card-title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 0.75rem;
}

/* Dashboard Styles */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: var(--primary);
}

.stat-card.blue::before { background: var(--info); }
.stat-card.green::before { background: var(--success); }

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 10px 24px rgba(230, 126, 34, 0.12);
}

.stat-value {
  font-size: 2.25rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  margin: 0.5rem 0;
  color: #0f172a;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* Event Cards Grid */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.event-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
}

.event-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary), var(--primary-hover));
}

.event-card:hover {
  background: #ffffff;
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(230, 126, 34, 0.14);
}

.event-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.event-date {
  background: rgba(230, 126, 34, 0.1);
  color: #d35400;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
}

.event-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: #0f172a;
}

.event-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.8rem;
}

.event-helpers-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid #f1f5f9;
  padding-top: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Buttons */
.btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #ffffff;
}

.btn-danger {
  background: rgba(231, 76, 60, 0.1);
  border-color: rgba(231, 76, 60, 0.3);
  color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
  position: relative;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  color: #1e293b;
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.15);
}

/* Autocomplete suggestion container */
.autocomplete-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  margin-top: 2px;
}

.suggestion-item {
  padding: 0.65rem 1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #1e293b;
}

.suggestion-item:hover {
  background: var(--primary);
  color: #ffffff;
}

.suggestion-item .suggestion-sub {
  font-size: 0.75rem;
  opacity: 0.75;
}

/* Table Styles */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  padding: 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.05em;
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.95rem;
  vertical-align: middle;
  color: #334155;
}

.data-table tr:hover td {
  background: #f8fafc;
}

/* Group Headers in Table */
.group-header-row td {
  background: rgba(230, 126, 34, 0.06) !important;
  color: #d35400;
  font-weight: 700;
  font-size: 0.95rem;
  border-bottom: 2px solid rgba(230, 126, 34, 0.2);
}

/* Custom Grid layout for Event details split */
.event-details-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

@media (max-width: 992px) {
  .event-details-layout {
    grid-template-columns: 1fr;
  }
}

/* Dialog Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  overflow-y: auto;
  padding: 1.5rem 1rem;
}

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

.modal-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-top: 4px solid var(--primary);
  border-radius: var(--radius);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  margin: auto;
  padding: 2rem;
  transform: scale(0.9);
  transition: var(--transition);
  box-shadow: 0 20px 50px rgba(0,0,0,0.18);
  color: #1e293b;
}

.modal-card.modal-card-lg {
  max-width: 850px;
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 0.75rem;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

/* Status Bedarfs-Ampel */
.status-badge {
  padding: 0.25rem 0.6rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.75rem;
  font-family: 'Outfit', sans-serif;
  text-transform: uppercase;
}

.status-red {
  background: rgba(231, 76, 60, 0.12);
  color: var(--danger);
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.status-yellow {
  background: rgba(241, 196, 15, 0.18);
  color: #b7791f;
  border: 1px solid rgba(241, 196, 15, 0.4);
}

.status-green {
  background: rgba(46, 204, 113, 0.12);
  color: var(--success);
  border: 1px solid rgba(46, 204, 113, 0.3);
}

/* Bedarfs-Zusammenfassung & Fortschrittsbalken */
.area-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.area-summary-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  transition: var(--transition);
  cursor: pointer;
}

.area-summary-card:hover {
  background: #ffffff;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.area-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease-out;
}

.progress-bar-fill.red { background: var(--danger); }
.progress-bar-fill.yellow { background: #f39c12; }
.progress-bar-fill.green { background: var(--success); }

/* Gesamtfortschritt für ein Event */
.event-overall-progress {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
}

.event-overall-progress-bar {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.event-overall-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--success));
  border-radius: 4px;
  width: 0%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dashboard Filter Tabs */
.dashboard-filter-tabs .btn {
  background: #edf2f7;
  border-color: #cbd5e1;
  color: #475569;
  border-radius: 20px;
  padding: 0.35rem 0.85rem;
}

.dashboard-filter-tabs .btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
}

.dashboard-filter-tabs .btn.active .badge-count {
  background: rgba(0, 0, 0, 0.15) !important;
  color: #ffffff !important;
}

/* Print View Layout */
.print-layout {
  display: none;
}

/* Print specific styles */
@media print {
  body {
    background: #ffffff !important;
    background-image: none !important;
  }
  
  .app-header, .no-print, .btn, .form-container, .nav-links, .auth-status-container {
    display: none !important;
  }
  
  .app-main {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  
  .page-view {
    display: none !important;
  }
  
  .print-layout {
    display: block !important;
  }
  
  .print-header {
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
    margin-bottom: 20px;
    text-align: center;
  }
  
  .print-header h1 {
    font-size: 20px !important;
    color: #000 !important;
    margin-bottom: 5px;
  }
  
  .print-header p {
    font-size: 12px;
    color: #555;
  }
  
  .print-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  
  .print-area-section {
    border: 1px solid #ccc;
    padding: 10px;
    page-break-inside: avoid;
    background: #fdfdfd;
  }
  
  .print-area-title {
    font-size: 12px !important;
    font-weight: bold;
    border-bottom: 1px solid #000;
    margin-bottom: 5px;
    padding-bottom: 2px;
    color: #000 !important;
    display: flex;
    justify-content: space-between;
  }
  
  .print-table {
    width: 100%;
    border-collapse: collapse;
  }
  
  .print-table th, .print-table td {
    border: 1px solid #ddd;
    padding: 4px 6px;
    text-align: left;
    font-size: 10px !important;
  }
  
  .print-table th {
    background-color: #f0f0f0;
    font-weight: bold;
  }
}
