/* Event Ordner Planer - Moderne CSS-Styles */

/* Reset und Basis-Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Farbschema */
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #64748b;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --info-color: #06b6d4;

  /* Neutrale Farben */
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Schatten */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1),
    0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1),
    0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Abstände */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Border Radius */
  --radius-sm: 0.125rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;

  /* Transitions */
  --transition: all 0.2s ease-in-out;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--gray-800);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-4);
}

/* Login-Seite */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-4);
}

.login-container {
  background: var(--white);
  padding: var(--space-8);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 400px;
  animation: slideUp 0.5s ease-out;
}

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

.login-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.logo-icon {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: var(--space-4);
}

.login-header h1 {
  color: var(--gray-900);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.login-header p {
  color: var(--gray-600);
  font-size: 0.875rem;
}

/* Formulare */
.form-group {
  margin-bottom: var(--space-6);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: 600;
  color: var(--gray-700);
  font-size: 0.875rem;
}

.form-group label i {
  margin-right: var(--space-2);
  color: var(--primary-color);
  width: 16px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  transition: var(--transition);
  background: var(--white);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.password-input {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.toggle-password:hover {
  color: var(--gray-600);
  background: var(--gray-100);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border: none;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  min-height: 44px; /* Touch-freundlich */
}

.btn-primary {
  background: var(--primary-color);
  color: var(--white);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-200);
}

.btn-success {
  background: var(--success-color);
  color: var(--white);
}

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

.btn-login {
  width: 100%;
  margin-bottom: var(--space-4);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Messages */
.message {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  margin: var(--space-4) 0;
  font-size: 0.875rem;
  font-weight: 500;
  display: none;
}

.message.show {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

.message.success {
  background: rgb(16 185 129 / 0.1);
  color: #065f46;
  border: 1px solid rgb(16 185 129 / 0.2);
}

.message.error {
  background: rgb(239 68 68 / 0.1);
  color: #991b1b;
  border: 1px solid rgb(239 68 68 / 0.2);
}

.message.info {
  background: rgb(6 182 212 / 0.1);
  color: #155e75;
  border: 1px solid rgb(6 182 212 / 0.2);
}

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

/* Login-Hilfe */
.login-help {
  text-align: center;
  padding: var(--space-4);
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
}

.login-help p {
  color: var(--gray-600);
  font-size: 0.75rem;
  margin-bottom: var(--space-1);
}

.login-help small {
  color: var(--gray-500);
  font-size: 0.6875rem;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-overlay.show {
  display: flex;
}

.loading-spinner {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.spinner-border {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  vertical-align: text-bottom;
  border: 0.25em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
  to {
    transform: rotate(360deg);
  }
}

.text-primary {
  color: var(--primary-color, #007bff) !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Toast Messages */
.toast-message {
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Dashboard Layout */
.dashboard {
  background: var(--gray-50);
  min-height: 100vh;
}

.header {
  background: var(--white);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4) 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.header-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.user-menu {
  position: relative;
}

.user-button {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--gray-100);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition);
}

.user-button:hover {
  background: var(--gray-200);
}

/* Navigation */
.nav-tabs {
  display: flex;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  overflow-x: auto;
}

.nav-tab {
  padding: var(--space-4) var(--space-6);
  border: none;
  background: none;
  color: var(--gray-600);
  font-weight: 500;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--primary-color);
  background: var(--gray-50);
}

.nav-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

/* Content */
.main-content {
  padding: var(--space-6) 0;
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
}

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.card-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: var(--space-1);
}

.card-body {
  padding: var(--space-6);
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-cols-1 {
  grid-template-columns: repeat(1, 1fr);
}
.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}
.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: var(--space-2);
  }

  .login-container {
    padding: var(--space-6);
  }

  .header-content {
    flex-direction: column;
    gap: var(--space-3);
    align-items: flex-start;
  }

  .nav-tabs {
    margin: 0 -var(--space-4);
    padding: 0 var(--space-4);
  }

  .grid-cols-2,
  .grid-cols-3 {
    grid-template-columns: 1fr;
  }

  .btn {
    min-height: 48px; /* Größere Touch-Targets auf Mobile */
  }
}

@media (max-width: 480px) {
  .login-container {
    padding: var(--space-4);
    margin: var(--space-2);
  }

  .header-title {
    font-size: 1rem;
  }

  .nav-tab {
    padding: var(--space-3) var(--space-4);
    font-size: 0.875rem;
  }
}

/* Utility Classes */
.hidden {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}
.font-bold {
  font-weight: 700;
}
.text-sm {
  font-size: 0.875rem;
}
.text-xs {
  font-size: 0.75rem;
}

.mb-4 {
  margin-bottom: var(--space-4);
}
.mt-4 {
  margin-top: var(--space-4);
}
.p-4 {
  padding: var(--space-4);
}

/* Image Upload & Plan Editor */
.plan-editor {
  position: relative;
  max-width: 100%;
  margin: var(--space-4) 0;
}

.plan-image {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.position-marker {
  position: absolute;
  width: 24px;
  height: 24px;
  background: var(--primary-color);
  border: 3px solid var(--white);
  border-radius: 50%;
  cursor: pointer;
  transform: translate(-50%, -50%);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.position-marker:hover {
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: var(--shadow-lg);
}

.position-marker.selected {
  background: var(--warning-color);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
  }
}

/* ==========================================
   Modal Styles - SUPERSICHER über gesamte Seite zentriert
   Gilt für ALLE Modals: #userModal, #eventModal, etc.
   ========================================== */

/* WICHTIG: Modals müssen aus allen Containern "ausbrechen" */
.modal,
#userModal,
#eventModal {
  display: none !important;
  position: fixed !important; /* Fixed position über ALLEM */
  z-index: 999999 !important; /* Extrem hoher z-index */
  left: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: auto !important;
  background-color: rgba(0, 0, 0, 0.7) !important;
  /* Flexbox für perfekte Zentrierung */
  justify-content: center !important;
  align-items: center !important;
  /* Sicherstellen dass es wirklich ÜBER allem liegt */
  transform: none !important;
  clip: none !important;
  clip-path: none !important;
}

/* Modal sichtbar machen */
.modal.show,
#userModal.show,
#eventModal.show {
  display: flex !important;
}

/* Modal Dialog Container */
.modal .modal-dialog,
#userModal .modal-dialog,
#eventModal .modal-dialog {
  position: relative !important;
  width: 90% !important;
  max-width: 800px !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none !important;
  z-index: 1000000 !important; /* Noch höher */
  /* Sicherstellen dass es nicht beschnitten wird */
  transform: none !important;
  clip: none !important;
  clip-path: none !important;
}

/* Modal Content */
.modal .modal-content,
#userModal .modal-content,
#eventModal .modal-content {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  pointer-events: auto !important;
  background-color: #fff !important;
  border: 1px solid rgba(0, 0, 0, 0.2) !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
  overflow: hidden !important;
  /* Animation */
  transform: scale(0.8) translateY(-20px) !important;
  opacity: 0 !important;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
  /* Sicherstellen dass es sichtbar bleibt */
  clip: none !important;
  clip-path: none !important;
}

/* Modal Content wenn sichtbar */
.modal.show .modal-content,
#userModal.show .modal-content,
#eventModal.show .modal-content {
  transform: scale(1) translateY(0) !important;
  opacity: 1 !important;
}

/* Zusätzliche Sicherheit: Modal direkt am Body anhängen */
body > .modal,
body > #userModal,
body > #eventModal {
  position: fixed !important;
  z-index: 999999 !important;
}

/* Modal Header */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #dee2e6;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.modal-title {
  margin: 0;
  line-height: 1.5;
  font-size: 1.5rem;
  font-weight: 600;
  color: #212529;
}

.modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid #dee2e6;
  background: #f8f9fa;
}

.close {
  float: right;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: #6c757d;
  text-shadow: none;
  opacity: 0.7;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.1);
  color: #495057;
}

/* Modal Responsive */
@media (max-width: 768px) {
  .modal-dialog {
    width: 95%;
    margin: 0;
  }

  .modal-content {
    border-radius: 12px;
    margin: 10px;
    max-height: calc(100vh - 20px);
    transform: scale(0.9) translateY(-30px);
  }

  .modal-title {
    font-size: 1.25rem;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 16px;
  }

  .modal-body {
    max-height: calc(70vh - 100px);
  }
}

@media (min-width: 992px) {
  .modal-lg {
    max-width: 900px;
  }
}

/* Form Styles im Modal - Bootstrap-ähnlich */
.modal .row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -8px;
}

.modal .col-md-6 {
  flex: 0 0 50%;
  max-width: 50%;
  padding: 0 8px;
}

@media (max-width: 768px) {
  .modal .col-md-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

.modal .form-group {
  margin-bottom: 20px;
}

.modal .form-control {
  display: block;
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  border: 2px solid #ced4da;
  border-radius: 6px;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.modal .form-control:focus {
  color: #495057;
  background-color: #fff;
  border-color: #007bff;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.modal label {
  display: inline-block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #495057;
  font-size: 0.95rem;
}

.modal .form-check {
  position: relative;
  display: block;
  padding-left: 1.5rem;
  margin: 16px 0;
}

.modal .form-check-input {
  position: absolute;
  margin-top: 0.3rem;
  margin-left: -1.5rem;
  width: 1.2rem;
  height: 1.2rem;
}

.modal .form-check-label {
  margin-bottom: 0;
  font-weight: normal;
  cursor: pointer;
}

.modal .alert {
  position: relative;
  padding: 16px 20px;
  margin-bottom: 20px;
  border: 1px solid transparent;
  border-radius: 6px;
}

.modal .alert-info {
  color: #0c5460;
  background-color: #e8f4fd;
  border-color: #b8daff;
}

/* Button Styles im Modal */
.modal .btn {
  display: inline-block;
  font-weight: 400;
  text-align: center;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  padding: 10px 20px;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 6px;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
  text-decoration: none;
}

.modal .btn-primary {
  color: #fff;
  background-color: #007bff;
  border-color: #007bff;
}

.modal .btn-primary:hover {
  background-color: #0056b3;
  border-color: #004085;
}

.modal .btn-secondary {
  color: #6c757d;
  background-color: #fff;
  border-color: #6c757d;
}

.modal .btn-secondary:hover {
  color: #fff;
  background-color: #6c757d;
  border-color: #6c757d;
}

/* Badge Styles */
.badge {
  display: inline-block;
  padding: 0.25em 0.4em;
  font-size: 75%;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
}

.badge-primary {
  color: #fff;
  background-color: #007bff;
}

.badge-danger {
  color: #fff;
  background-color: #dc3545;
}

.badge-success {
  color: #fff;
  background-color: #28a745;
}

.badge-warning {
  color: #212529;
  background-color: #ffc107;
}

.badge-secondary {
  color: #fff;
  background-color: #6c757d;
}

/* Schedule Styles */
.schedule-container {
  margin-top: 20px;
}

.schedule-stats {
  background: var(--light-bg);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 15px;
}

.stat-item {
  text-align: center;
  padding: 15px;
  background: white;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 5px;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.schedule-day {
  margin-bottom: 30px;
}

.schedule-day-title {
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 10px;
  margin-bottom: 20px;
  font-size: 1.3rem;
  transition: background-color 0.2s ease;
  padding: 8px 12px;
  border-radius: 8px;
  user-select: none;
  cursor: pointer;
}

.schedule-day-title:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.schedule-day-title.expanded {
  background-color: rgba(37, 99, 235, 0.05);
}

.day-toggle-icon {
  color: #6b7280;
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.schedule-day-title.expanded .day-toggle-icon {
  color: var(--primary-color);
}

.schedule-shifts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 15px;
}

.shift-card {
  background: white;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-left: 4px solid var(--primary-color);
  transition: all 0.3s ease;
}

.shift-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.shift-card.collapsible {
  cursor: pointer;
}

.shift-card.collapsible .shift-header {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}

.shift-card.collapsible .shift-header:hover {
  background-color: rgba(0, 0, 0, 0.02);
  border-radius: 6px;
  margin: -15px;
  padding: 15px;
}

.shift-card.collapsible .shift-content {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e5e7eb;
}

.shift-toggle-icon {
  color: #6b7280;
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

.shift-card.expanded .shift-toggle-icon {
  color: var(--primary-color);
}

.shift-card.status-scheduled {
  border-left-color: var(--primary-color);
}

.shift-card.status-confirmed {
  border-left-color: var(--success-color);
}

.shift-card.status-completed {
  border-left-color: var(--info-color);
}

.shift-card.status-cancelled {
  border-left-color: var(--error-color);
  opacity: 0.7;
}

.shift-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.shift-position strong {
  color: var(--text-dark);
  font-size: 1.1rem;
}

.shift-position small {
  display: block;
  margin-top: 2px;
}

.status-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.status-scheduled {
  background: var(--primary-color);
  color: white;
}

.status-badge.status-confirmed {
  background: var(--success-color);
  color: white;
}

.status-badge.status-completed {
  background: var(--info-color);
  color: white;
}

.status-badge.status-cancelled {
  background: var(--error-color);
  color: white;
}

.shift-time,
.shift-participant,
.shift-notes {
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.shift-time i,
.shift-participant i,
.shift-notes i {
  width: 16px;
  margin-right: 8px;
  color: var(--text-muted);
}

.shift-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.shift-actions .btn {
  flex: 1;
  font-size: 0.8rem;
  padding: 6px 12px;
}

/* Klickbare Statistik-Kacheln */
.stat-item.clickable {
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.stat-item.clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: var(--primary-color);
}

.stat-item.clickable.active-filter {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.stat-item.clickable.active-filter .stat-number,
.stat-item.clickable.active-filter .stat-label {
  color: white;
}

/* Responsive Design für Schichtplan */
@media (max-width: 768px) {
  .schedule-shifts {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Mobile Optimierungen für Statistik-Kacheln */
  #scheduleStats .grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.5rem !important;
  }

  #scheduleStats .stat-card {
    padding: 0.75rem !important;
    min-height: auto !important;
  }

  #scheduleStats .stat-card .card-body {
    padding: 0.5rem !important;
  }

  #scheduleStats .stat-card .card-body div {
    font-size: 1.5rem !important;
    line-height: 1.2 !important;
  }

  #scheduleStats .stat-card .card-body p {
    font-size: 0.75rem !important;
    line-height: 1.1 !important;
    margin-top: 0.25rem !important;
  }

  .shift-header {
    flex-direction: column;
    gap: 8px;
  }

  .shift-actions {
    flex-direction: column;
  }
}

/* Sehr kleine Bildschirme */
@media (max-width: 480px) {
  #scheduleStats .grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }

  #scheduleStats .stat-card {
    padding: 0.5rem !important;
  }

  #scheduleStats .stat-card .card-body {
    padding: 0.25rem !important;
  }

  #scheduleStats .stat-card .card-body div {
    font-size: 1.25rem !important;
  }

  #scheduleStats .stat-card .card-body p {
    font-size: 0.7rem !important;
  }
}

/* Extra kleine Bildschirme */
@media (max-width: 360px) {
  #scheduleStats .grid {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }

  #scheduleStats .stat-card {
    padding: 0.75rem !important;
  }

  #scheduleStats .stat-card .card-body div {
    font-size: 1.5rem !important;
  }

  #scheduleStats .stat-card .card-body p {
    font-size: 0.8rem !important;
  }
}

/* Teilnehmer Modal Styles */
.participants-btn {
  font-size: 0.8rem !important;
  padding: 4px 12px !important;
  border-radius: 16px !important;
  transition: all 0.2s ease !important;
}

.participants-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.participantsModal {
  /* Styles are inline in JS for better control */
}

.participant-item {
  transition: background-color 0.2s ease;
}

.participant-item:hover {
  background-color: #f8fafc;
}

.participant-item:last-child {
  border-bottom: none !important;
}

.presence-toggle {
  transition: all 0.3s ease !important;
  transform: scale(1);
}

.presence-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

.presence-toggle:active {
  transform: scale(0.95);
}

.presence-toggle:disabled {
  opacity: 0.6;
  cursor: not-allowed !important;
  transform: scale(1) !important;
}

/* Mobile Optimierungen für Teilnehmer Modal */
@media (max-width: 768px) {
  .participantsModal {
    width: 98vw !important;
    max-width: none !important;
    margin: 1vh !important;
    border-radius: 12px !important;
  }

  .participants-btn {
    font-size: 0.7rem !important;
    padding: 2px 8px !important;
    margin-left: 8px !important;
  }

  .schedule-day-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }

  .participant-item {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
    padding: 12px 0 !important;
  }

  .participant-item > div:last-child {
    width: 100%;
    justify-content: flex-end;
  }

  .presence-toggle {
    min-width: 100px !important;
    padding: 10px 16px !important;
    font-size: 1rem !important;
  }
}

@media (max-width: 480px) {
  .participants-btn span {
    display: none;
  }

  .participants-btn {
    min-width: auto !important;
    padding: 4px 8px !important;
  }

  .participant-item {
    padding: 16px 0 !important;
  }

  .participant-item > div:first-child {
    margin-bottom: 8px;
  }

  .participant-item > div:first-child > div:last-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
  }
}

/* PWA-spezifische Styles */
@media (display-mode: standalone) {
  /* Verstecke Browser-UI wenn als App installiert */
  body {
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
  }

  /* Bessere Touch-Targets für mobile Apps */
  .btn,
  button,
  .nav-tab,
  .card {
    min-height: 44px;
    min-width: 44px;
  }

  /* Verhindere Zoom bei Doppel-Tap */
  * {
    touch-action: manipulation;
  }
}

/* Mobile-first responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 10px;
  }

  .header-content {
    flex-direction: column;
    gap: 10px;
  }

  .nav-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-tab {
    white-space: nowrap;
    min-width: auto;
    padding: 10px 15px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .card {
    margin-bottom: 15px;
  }

  /* Bessere mobile Formulare */
  input,
  select,
  textarea {
    font-size: 16px; /* Verhindert Zoom auf iOS */
  }

  /* Mobile Modal-Anpassungen */
  .modal-content {
    margin: 10px;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
  }
}

/* PWA Install Prompt Styles */
.install-prompt {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: #007bff;
  color: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: none;
}

.install-prompt.show {
  display: block;
}

.install-prompt button {
  background: white;
  color: #007bff;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  margin-left: 10px;
  cursor: pointer;
}

/* Offline-Indikator */
.offline-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #dc3545;
  color: white;
  text-align: center;
  padding: 8px;
  z-index: 1001;
  display: none;
}

.offline-indicator.show {
  display: block;
}

/* Touch-optimierte Buttons */
.btn {
  transition: transform 0.1s ease;
}

.btn:active {
  transform: scale(0.95);
}

/* Verbesserte Scroll-Performance */
* {
  -webkit-overflow-scrolling: touch;
}

/* PWA Status Bar Anpassungen */
@media (display-mode: standalone) {
  .header {
    padding-top: env(safe-area-inset-top);
  }

  .main-content {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* WebAuthn Button Styles */
.webauthn-btn {
  width: 100%;
  margin-top: 15px;
  padding: 12px;
  font-size: 16px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.webauthn-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.webauthn-btn:active {
  transform: translateY(0);
}

/* WebAuthn Modal Styles */
#webauthnModal .modal-body {
  padding: 24px;
}

.webauthn-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.webauthn-actions .btn {
  min-width: 150px;
}
