/* Reset and base styles */
* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

body { 
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; 
  line-height: 1.6;
  color: #2d3748; 
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #9b59b6 100%);
  min-height: 100vh;
}

/* Header styling */
header { 
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding: 12px 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

header .header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 12px;
}

header h1 { 
  font-size: 1.375rem;
  font-weight: 600;
  color: #1a202c;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  line-height: 1.3;
}

.points-badge {
  background: linear-gradient(135deg, #9b59b6, #8e44ad, #667eea);
  color: white;
  padding: 8px 14px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: 0 2px 6px rgba(155, 89, 182, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  text-decoration: none;
}

.points-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(155, 89, 182, 0.4);
}

nav { 
  display: flex; 
  align-items: center; 
  gap: 16px; 
}

nav form { 
  display: flex; 
  gap: 8px; 
  align-items: center;
}

nav input[type="date"] {
  padding: 8px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.875rem;
  transition: all 0.2s;
}

nav input[type="date"]:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

nav button, nav a { 
  background: linear-gradient(135deg, #9b59b6, #8e44ad, #667eea);
  color: white;
  padding: 10px 18px;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.3s;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

nav button:hover, nav a:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(155, 89, 182, 0.5);
  background: linear-gradient(135deg, #a569bd, #9b59b6, #7159ea);
}

/* Main content - only for task pages, not settings */
main:not(.settings-main):not(.points-main) { 
  padding: 32px 24px; 
  max-width: 800px; 
  margin: 0 auto; 
}

/* Task list styling */
.task-list { 
  list-style: none; 
  display: grid; 
  gap: 16px; 
}

.task { 
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.task::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #9b59b6, #8e44ad, #667eea);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.task:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.task:hover::before {
  transform: scaleX(1);
}

.task.done {
  background: rgba(72, 187, 120, 0.1);
  border-color: rgba(72, 187, 120, 0.3);
}

.task.done::before {
  background: linear-gradient(90deg, #48bb78, #38a169);
  transform: scaleX(1);
}

.task-content {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  align-items: center;
  gap: 20px;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.task-content:hover {
  transform: scale(1.01);
}

.task-content:active {
  transform: scale(0.99);
}

.time { 
  font-weight: 700;
  font-size: 1.125rem;
  color: #667eea;
  background: linear-gradient(135deg, rgba(155, 89, 182, 0.15), rgba(102, 126, 234, 0.15));
  padding: 12px 16px;
  border-radius: 12px;
  text-align: center;
  min-width: 100px;
  border: 2px solid rgba(155, 89, 182, 0.2);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.time::before {
  content: '';
  font-size: 1.2em;
}

/* Morning times (05:00 - 11:59) */
.time[data-period="morning"]::before {
  content: '🌅';
}

/* Afternoon times (12:00 - 17:59) */
.time[data-period="afternoon"]::before {
  content: '☀️';
}

/* Evening times (18:00 - 23:59) */
.time[data-period="evening"]::before {
  content: '🌙';
}

/* Night times (00:00 - 04:59) */
.time[data-period="night"]::before {
  content: '🌃';
}

.task.done .time {
  color: #38a169;
  background: linear-gradient(135deg, rgba(72, 187, 120, 0.15), rgba(56, 161, 105, 0.15));
  border-color: rgba(72, 187, 120, 0.3);
}

.task-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.task-info label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  flex: 1;
}

.task input[type="checkbox"] {
  width: 28px;
  height: 28px;
  border: 3px solid #cbd5e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  appearance: none;
  position: relative;
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.task input[type="checkbox"]:hover {
  border-color: #9b59b6;
  transform: scale(1.05);
}

.task input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
  border-color: #8e44ad;
  transform: scale(1.05);
}

.task input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: bold;
  font-size: 16px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.title { 
  font-size: 1.125rem;
  font-weight: 500;
  color: #2d3748;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.title::before {
  content: '';
  font-size: 1.1em;
}

/* Add emoji based on task content */
.title[data-task*="aufstehen"]::before,
.title[data-task*="aufwachen"]::before { content: '⏰'; }

.title[data-task*="bewegung"]::before,
.title[data-task*="sport"]::before,
.title[data-task*="training"]::before,
.title[data-task*="fitness"]::before { content: '🏃‍♂️'; }

.title[data-task*="arbeit"]::before { content: '💼'; }

.title[data-task*="studium"]::before { content: '📚'; }

.title[data-task*="pause"]::before,
.title[data-task*="entspannung"]::before,
.title[data-task*="erholung"]::before { content: '☕'; }

/* Kaffee hat höhere Priorität als allgemeine Pause */
.title[data-task*="kaffee"]::before,
.title[data-task*="coffee"]::before { content: '☕'; }

.title[data-task*="abendessen"]::before,
.title[data-task*="frühstück"]::before,
.title[data-task*="dinner"]::before,
.title[data-task*="mittagessen"]::before,
.title[data-task*="snack"]::before,
.title[data-task*="essen"]::before,
.title[data-task*="mahlzeit"]::before { content: '🍽️'; }

.title[data-task*="schlafen"]::before,
.title[data-task*="bett"]::before,
.title[data-task*="sleep"]::before { content: '🛏️'; }

.title[data-task*="hygiene"]::before { content: '🚿'; }

.title[data-task*="meditation"]::before,
.title[data-task*="yoga"]::before { content: '🧘‍♂️'; }

/* Neue Symbole für weitere Aktivitäten */

.title[data-task*="aus dem haus"]::before,
.title[data-task*="rausgehen"]::before,
.title[data-task*="spazieren"]::before,
.title[data-task*="einkaufen"]::before { content: '🚶‍♂️'; }

.title[data-task*="uni"]::before,
.title[data-task*="universität"]::before,
.title[data-task*="hochschule"]::before,
.title[data-task*="vorlesung"]::before { content: '🎓'; }

.title[data-task*="lernen"]::before,
.title[data-task*="studieren"]::before,
.title[data-task*="hausarbeit"]::before,
.title[data-task*="büffeln"]::before { content: '📚'; }

.title[data-task*="arbeiten"]::before,
.title[data-task*="job"]::before,
.title[data-task*="office"]::before,
.title[data-task*="büro"]::before { content: '💼'; }

.title[data-task*="fertig machen"]::before,
.title[data-task*="anziehen"]::before,
.title[data-task*="vorbereiten"]::before { content: '👔'; }

.title[data-task*="duschen"]::before,
.title[data-task*="baden"]::before,
.title[data-task*="waschen"]::before { content: '🚿'; }

.title[data-task*="schminken"]::before,
.title[data-task*="makeup"]::before,
.title[data-task*="styling"]::before { content: '💄'; }

.task.done .title {
  text-decoration: line-through;
  color: #718096;
}

.points { 
  color: #9b59b6;
  font-weight: 700;
  font-size: 0.875rem;
  background: linear-gradient(135deg, rgba(155, 89, 182, 0.15), rgba(142, 68, 173, 0.15));
  padding: 6px 12px;
  border-radius: 15px;
  border: 2px solid rgba(155, 89, 182, 0.2);
  display: flex;
  align-items: center;
  gap: 4px;
}

.points::before {
  content: '⭐';
  font-size: 0.9em;
}

.task.done .points {
  color: #38a169;
  background: rgba(72, 187, 120, 0.1);
}

.status {
  text-align: right;
  font-weight: 600;
  font-size: 0.875rem;
  min-width: 180px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.3s;
}

.status.success {
  color: #38a169;
  background: rgba(72, 187, 120, 0.15);
  border: 2px solid rgba(72, 187, 120, 0.3);
}

.status.success::before {
  content: '🎉 ';
}

.status.completed {
  color: #4299e1;
  background: rgba(66, 153, 225, 0.15);
  border: 2px solid rgba(66, 153, 225, 0.3);
}

.status.completed::before {
  content: '✅ ';
}

/* Einstellungen page styling */
.plans {
  display: grid;
  gap: 24px;
}

details {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

summary {
  font-weight: 600;
  font-size: 1.125rem;
  cursor: pointer;
  padding: 8px 0;
  color: #2d3748;
}

summary:hover {
  color: #667eea;
}

.inline {
  display: inline-flex;
  gap: 8px;
  margin-left: 12px;
}

/* Form styling */
form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 16px 0;
}

input, select, button {
  padding: 8px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.875rem;
  transition: all 0.2s;
}

input:focus, select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

button {
  background: linear-gradient(135deg, #9b59b6, #8e44ad, #667eea);
  color: white;
  border: none;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(155, 89, 182, 0.5);
  background: linear-gradient(135deg, #a569bd, #9b59b6, #7159ea);
}

/* Responsive design */
@media (max-width: 768px) {
  .task-content {
    grid-template-columns: 1fr;
    gap: 12px;
    text-align: left;
  }
  
  .time {
    justify-self: start;
    min-width: auto;
    width: 100%;
  }
  
  .status {
    text-align: left;
    min-width: auto;
  }
  
  .task input[type="checkbox"] {
    width: 32px;
    height: 32px;
  }
  
  header .header-content {
    flex-direction: column;
    align-items: stretch;
  }
  
  nav {
    justify-content: center;
  }
  
  /* Mobile-first improvements */
  body {
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  .task {
    margin-bottom: 8px;
  }
  
  .task-content {
    padding: 16px;
  }
  
  .time {
    font-size: 1rem;
    padding: 8px 12px;
  }
  
  .title {
    font-size: 1rem;
  }
  
  .points {
    font-size: 0.8rem;
  }
  
  /* Touch-friendly buttons */
  button, input[type="checkbox"] {
    min-height: 44px; /* Apple's recommended touch target size */
  }
  
  /* Better form spacing on mobile */
  form {
    gap: 8px;
  }
  
  label {
    display: block;
    margin-bottom: 8px;
  }
  
  input, select {
    width: 100%;
    max-width: 300px;
  }
}

/* PWA specific styles */
@media (display-mode: standalone) {
  /* Remove any desktop-specific elements when running as PWA */
  .install-prompt {
    display: none !important;
  }
  
  /* Add some padding at the top for status bar */
  header {
    padding-top: env(safe-area-inset-top);
  }
}

/* Offline indicator */
.offline-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #f56565;
  color: white;
  text-align: center;
  padding: 8px;
  font-size: 0.875rem;
  z-index: 1001;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.offline-indicator.show {
  transform: translateY(0);
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #9b59b6;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Points Page Styles */
.points-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.current-stats, .date-selector, .selected-day, .weekly-overview, .monthly-stats {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.current-stats h2, .date-selector h2, .selected-day h2, .weekly-overview h2, .monthly-stats h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1a202c;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.today-card, .day-card {
  background: linear-gradient(135deg, #9b59b6, #8e44ad, #667eea);
  color: white;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
}

.date-display {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.points-display {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.percentage {
  font-size: 1.125rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-block;
}

.percentage.excellent { background: rgba(34, 197, 94, 0.2); color: #15803d; }
.percentage.good { background: rgba(59, 130, 246, 0.2); color: #1d4ed8; }
.percentage.okay { background: rgba(245, 158, 11, 0.2); color: #b45309; }
.percentage.poor { background: rgba(239, 68, 68, 0.2); color: #dc2626; }

.date-selector form {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.date-selector input[type="date"] {
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.2s;
}

.date-selector input[type="date"]:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.date-selector button {
  background: linear-gradient(135deg, #9b59b6, #8e44ad, #667eea);
  color: white;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.date-selector button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(155, 89, 182, 0.3);
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.week-day {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.week-day:hover {
  border-color: #9b59b6;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(155, 89, 182, 0.2);
}

.week-day.today {
  border-color: #9b59b6;
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
  color: white;
}

.day-name {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 4px;
  opacity: 0.8;
}

.day-date {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.day-points {
  font-size: 0.875rem;
  margin-bottom: 4px;
}

.day-percentage {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
  display: inline-block;
}

.task-breakdown {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-item {
  display: grid;
  grid-template-columns: 60px 1fr 40px 100px;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 0.875rem;
  align-items: center;
}

.task-item.completed {
  opacity: 0.8;
  text-decoration: line-through;
}

.task-time {
  font-weight: 600;
  font-family: monospace;
}

.task-points {
  text-align: center;
  font-weight: 600;
}

.task-status {
  text-align: center;
  font-size: 0.75rem;
}

.month-card {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
}

.month-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a202c;
  margin-bottom: 16px;
  text-align: center;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-label {
  font-weight: 500;
  color: #64748b;
}

.stat-value {
  font-weight: 600;
  color: #1a202c;
}

/* Responsive */
@media (max-width: 768px) {
  .points-main {
    padding: 16px;
    gap: 20px;
  }
  
  .current-stats, .date-selector, .selected-day, .weekly-overview, .monthly-stats {
    padding: 16px;
  }
  
  .week-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
  }
  
  .task-item {
    grid-template-columns: 50px 1fr 30px 80px;
    gap: 4px;
    font-size: 0.75rem;
  }
}

/* Day Assignment Styles */
.day-assignment-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  margin: 16px 0;
}

@media (max-width: 1200px) {
  .day-assignment-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .day-assignment-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .day-assignment-grid {
    grid-template-columns: 1fr;
  }
}

.day-assignment-card {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  transition: all 0.2s;
  min-width: 0; /* Prevent overflow */
}

.day-assignment-card:hover {
  border-color: #9b59b6;
  box-shadow: 0 4px 8px rgba(155, 89, 182, 0.2);
  transform: translateY(-2px);
}

.day-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
  text-align: center;
}

.day-emoji {
  font-size: 1.25rem;
}

.day-name {
  font-weight: 600;
  color: #1a202c;
  font-size: 0.875rem;
  white-space: nowrap;
}

.day-select {
  width: 100%;
  padding: 8px 10px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.75rem;
  background: white;
  transition: all 0.2s;
  cursor: pointer;
}

  .day-select:focus {
    outline: none;
    border-color: #9b59b6;
    box-shadow: 0 0 0 3px rgba(155, 89, 182, 0.1);
  }

/* Settings Page Specific Styles */
.settings-main {
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 24px !important;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.settings-section {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 6px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.settings-section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1a202c;
  margin-bottom: 20px;
}

.settings-section h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a202c;
  margin: 24px 0 16px 0;
}

/* Improved Plans Section */
.plans details {
  margin-bottom: 24px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.plans details:hover {
  border-color: #9b59b6;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(155, 89, 182, 0.15);
}

.plans details[open] {
  border-color: #9b59b6;
  box-shadow: 0 4px 12px rgba(155, 89, 182, 0.15);
}

.plans summary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px 20px;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  border: none;
  transition: background 0.3s ease;
}

.plans summary:hover {
  background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.plan-content {
  padding: 6px;
  background: #f8fafc;
}

.plan-settings {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid #e2e8f0;
}

.plan-settings h4 {
  margin: 0 0 16px 0;
  color: #2d3748;
  font-size: 1rem;
}

.form-row {
  display: flex;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.form-row label {
  flex: 1;
}

.btn-save {
  background: #48bb78;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-save:hover {
  background: #38a169;
  transform: translateY(-1px);
}

.btn-danger {
  background: #f56565;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-danger:hover {
  background: #e53e3e;
  transform: translateY(-1px);
}

.btn-add {
  background: #4299e1;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
  grid-column: span 2;
}

.btn-add:hover {
  background: #3182ce;
  transform: translateY(-1px);
}

/* Tasks Section */
.tasks-section {
  background: white;
  border-radius: 8px;
  padding: 2px;
  border: 1px solid #e2e8f0;
}

.section-header {
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.section-header h4 {
  margin: 0;
  color: #2d3748;
  font-size: 1.1rem;
}

.new-task-form {
  background: #f0fff4;
  border: 2px dashed #68d391;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
}

.task-form-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto auto;
  gap: 12px;
  align-items: end;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: center;
}

.no-tasks {
  text-align: center;
  padding: 40px 20px;
  color: #718096;
  font-style: italic;
  background: #f7fafc;
  border-radius: 8px;
  border: 2px dashed #cbd5e0;
}

.tasks-grid {
  display: flex;
  gap: 8px;
  max-height: 300px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  scroll-behavior: smooth;
}

.tasks-grid::-webkit-scrollbar {
  height: 8px;
}

.tasks-grid::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.tasks-grid::-webkit-scrollbar-thumb {
  background: #9b59b6;
  border-radius: 4px;
}

.tasks-grid::-webkit-scrollbar-thumb:hover {
  background: #8e44ad;
}

.task-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  min-width: 200px;
  flex-shrink: 0;
}

.task-card:hover {
  border-color: #9b59b6;
  box-shadow: 0 1px 4px rgba(155, 89, 182, 0.2);
}

.task-card.active {
  border-color: #48bb78;
  background: #f0fff4;
}

.task-card.inactive {
  border-color: #f56565;
  background: #fed7e2;
  opacity: 0.9;
}

.task-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
  gap: 3px;
}

.task-time {
  background: #4299e1;
  color: white;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 500;
}

.task-points {
  background: #ed8936;
  color: white;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 500;
}

.status-active {
  background: #48bb78;
  color: white;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 500;
}

.status-inactive {
  background: #f56565;
  color: white;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 500;
}

.task-title {
  margin: 0 0 6px 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #2d3748;
  line-height: 1.2;
}

.task-edit-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

.task-edit-grid label {
  font-size: 0.75rem;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-edit-grid input[type="text"] {
  padding: 3px 4px;
  font-size: 0.75rem;
  border: 1px solid #cbd5e0;
  border-radius: 3px;
}

.task-edit-grid input[type="time"] {
  padding: 3px 4px;
  font-size: 0.75rem;
  border: 1px solid #cbd5e0;
  border-radius: 3px;
  width: 70px;
}

.task-edit-grid input[type="number"] {
  padding: 3px 4px;
  font-size: 0.75rem;
  border: 1px solid #cbd5e0;
  border-radius: 3px;
  width: 50px;
}

.task-actions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.task-actions button {
  padding: 3px 6px;
  font-size: 0.7rem;
  flex: 1;
  border-radius: 3px;
}

/* Kompaktere Form für neue Aufgaben */
.new-task-form {
  background: #f0fff4;
  border: 1px solid #68d391;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
}

.task-form-grid {
  display: grid;
  grid-template-columns: 2fr auto auto auto auto;
  gap: 6px;
  align-items: end;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 3px;
  justify-self: center;
  font-size: 0.8rem;
}

.section-header {
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.section-header h4 {
  margin: 0;
  color: #2d3748;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .task-form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .btn-add {
    grid-column: span 1;
  }
  
  .tasks-grid {
    grid-template-columns: 1fr;
    max-height: 300px;
  }
  
  .task-edit-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .task-actions {
    grid-column: span 1;
    justify-content: stretch;
  }
  
  .task-actions button {
    flex: 1;
  }
  
  .task-header {
    font-size: 0.8rem;
  }
  
  .task-card {
    padding: 6px;
    font-size: 0.8rem;
  }
  
  .tasks-grid {
    max-height: 250px;
    gap: 6px;
    padding: 6px;
  }
  
  .task-card {
    min-width: 160px;
  }
  
  .task-header {
    margin-bottom: 4px;
    padding-bottom: 3px;
  }
  
  .task-form-inputs,
  .task-edit-inputs {
    gap: 4px;
  }
  
  .task-form-inputs input,
  .task-edit-inputs input,
  .task-form-inputs select,
  .task-edit-inputs select {
    padding: 6px 8px;
    font-size: 0.8rem;
  }
  
  .section-header h4 {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .task-card {
    padding: 4px;
    font-size: 0.75rem;
    min-width: 140px;
  }
  
  .tasks-grid {
    max-height: 200px;
    gap: 4px;
    padding: 4px;
  }
  
  .task-header {
    margin-bottom: 3px;
    padding-bottom: 2px;
    font-size: 0.7rem;
  }
  
  .task-form-inputs,
  .task-edit-inputs {
    gap: 3px;
  }
  
  .task-form-inputs input,
  .task-edit-inputs input,
  .task-form-inputs select,
  .task-edit-inputs select {
    padding: 4px 6px;
    font-size: 0.75rem;
  }
  
  .task-actions button {
    padding: 4px 6px;
    font-size: 0.7rem;
  }
  
  .btn-add,
  .btn-save,
  .btn-cancel {
    padding: 6px 8px;
    font-size: 0.75rem;
  }
}

/* Ensure day assignment grid works in settings - Force with higher specificity */
.settings-main #day-assignments .day-assignment-grid {
  display: grid !important;
  grid-template-columns: repeat(7, 1fr) !important;
  gap: 12px !important;
  margin: 16px 0 !important;
}

@media (max-width: 1200px) {
  .settings-main #day-assignments .day-assignment-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

@media (max-width: 768px) {
  .settings-main #day-assignments .day-assignment-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
}

@media (max-width: 480px) {
  .settings-main #day-assignments .day-assignment-grid {
    grid-template-columns: 1fr !important;
  }
}

/* FORCE Settings page styles - highest priority at end of file */
main.settings-main {
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 6px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 32px !important;
}

/* Force day assignment grid for settings */
main.settings-main #day-assignments .day-assignment-grid,
body main.settings-main #day-assignments .day-assignment-grid {
  display: grid !important;
  grid-template-columns: repeat(7, 1fr) !important;
  gap: 12px !important;
  margin: 16px 0 !important;
  width: 100% !important;
}

main.settings-main .day-assignment-card,
body main.settings-main .day-assignment-card {
  background: white !important;
  border: 2px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 12px !important;
  transition: all 0.2s !important;
  min-width: 0 !important;
  flex: 1 !important;
}

@media (max-width: 1200px) {
  main.settings-main #day-assignments .day-assignment-grid,
  body main.settings-main #day-assignments .day-assignment-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

@media (max-width: 768px) {
  main.settings-main #day-assignments .day-assignment-grid,
  body main.settings-main #day-assignments .day-assignment-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
}

@media (max-width: 480px) {
  main.settings-main #day-assignments .day-assignment-grid,
  body main.settings-main #day-assignments .day-assignment-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Backup Section Styles */
.backup-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.backup-card {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.2s;
}

.backup-card:hover {
  border-color: #9b59b6;
  box-shadow: 0 4px 8px rgba(155, 89, 182, 0.2);
}

.backup-card.danger {
  border-color: #ef4444;
  background: #fef2f2;
}

.backup-card.danger:hover {
  border-color: #dc2626;
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.2);
}

.backup-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1a202c;
  margin-bottom: 8px;
}

.backup-card p {
  font-size: 0.875rem;
  color: #64748b;
  margin-bottom: 16px;
  line-height: 1.5;
}

.backup-btn {
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
  min-width: 150px;
}

.backup-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(155, 89, 182, 0.3);
}

.backup-btn.export {
  background: linear-gradient(135deg, #059669, #047857);
}

.backup-btn.export:hover {
  box-shadow: 0 4px 8px rgba(5, 150, 105, 0.3);
}

.backup-btn.import {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.backup-btn.import:hover {
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.backup-btn.danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.backup-btn.danger:hover {
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.import-status {
  margin-top: 12px;
  font-size: 0.875rem;
  font-weight: 500;
}

.import-status.success {
  color: #059669;
}

.import-status.error {
  color: #ef4444;
}

@media (max-width: 768px) {
  .backup-actions {
    grid-template-columns: 1fr;
  }
}

/* Calendar Import Styles */
.calendar-import-info {
  background: linear-gradient(135deg, #e8f4fd, #f0f8ff);
  border: 2px solid #3b82f6;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.calendar-import-info p {
  margin: 0 0 16px 0;
  color: #1e40af;
  font-weight: 600;
  font-size: 0.95rem;
}

.import-instructions {
  margin-top: 16px;
}

.import-instructions h3 {
  margin: 0 0 12px 0;
  color: #1e40af;
  font-size: 1rem;
  font-weight: 600;
}

.import-instructions ol {
  margin: 0;
  padding-left: 20px;
  color: #1e40af;
}

.import-instructions li {
  margin-bottom: 8px;
  line-height: 1.5;
  font-size: 0.9rem;
}

.import-instructions a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(37, 99, 235, 0.1);
  transition: all 0.2s;
}

.import-instructions a:hover {
  background: rgba(37, 99, 235, 0.2);
  text-decoration: underline;
}

.import-instructions strong {
  background: rgba(59, 130, 246, 0.15);
  padding: 1px 4px;
  border-radius: 3px;
}

/* Notification Settings Styles */
.notification-info {
  background: linear-gradient(135deg, #f0fdf4, #f7fee7);
  border: 2px solid #22c55e;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.notification-info p {
  margin: 0;
  color: #15803d;
  font-weight: 600;
  font-size: 0.95rem;
}

.notification-settings {
  display: grid;
  gap: 1.5rem;
}

.notification-card {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s ease;
}

.notification-card:hover {
  border-color: #22c55e;
  box-shadow: 0 4px 8px rgba(34, 197, 94, 0.1);
}

.notification-card h3 {
  margin: 0 0 8px 0;
  color: #1a202c;
  font-size: 1.1rem;
  font-weight: 600;
}

.notification-card p {
  margin: 0 0 16px 0;
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.5;
}

.notification-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.time-selection {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.time-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  font-weight: 500;
}

.time-checkbox:hover {
  border-color: #22c55e;
  background: #f0fdf4;
}

.time-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #22c55e;
}

.time-checkbox input[type="checkbox"]:checked + span {
  color: #15803d;
  font-weight: 600;
}

.time-checkbox span {
  color: #374151;
  transition: all 0.2s ease;
}

.time-info {
  margin-top: 12px;
  padding: 12px;
  background: #fffbeb;
  border: 1px solid #fbbf24;
  border-radius: 6px;
}

.time-info small {
  color: #92400e;
  font-size: 0.8rem;
  line-height: 1.4;
}

/* Time selection visibility control */
.time-card-hidden {
  display: none !important;
}

.time-card-disabled {
  opacity: 0.4 !important;
  pointer-events: none !important;
  transition: opacity 0.3s ease;
}

@media (max-width: 768px) {
  .time-selection {
    grid-template-columns: 1fr;
  }
  
  .notification-controls {
    align-items: stretch;
  }
  
  /* Mobile settings layout */
  main.settings-main {
    padding: 8px !important;
    gap: 20px !important;
  }
  
  /* Mobile section styles */
  .section {
    padding: 12px;
  }
  
  .section-header h4 {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  main.settings-main {
    padding: 6px !important;
    gap: 16px !important;
  }
  
  .section {
    padding: 8px;
  }
  
  .section-header h4 {
    font-size: 0.9rem;
  }
}

/* Notification Mode Selection */
.notification-mode-selection {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.mode-radio {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-radio:hover {
  border-color: #22c55e;
  background: #f0fdf4;
}

.mode-radio input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: #22c55e;
  margin-top: 2px;
}

.mode-radio input[type="radio"]:checked + .mode-info {
  color: #15803d;
}

.mode-radio input[type="radio"]:checked + .mode-info strong {
  color: #15803d;
}

.mode-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s ease;
}

.mode-info strong {
  font-size: 0.95rem;
  font-weight: 600;
  color: #374151;
  transition: all 0.2s ease;
}

.mode-info small {
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.3;
}

/* Time Selection Visibility */
#time-selection {
  display: block;
}

#time-selection.hidden {
  display: none;
}