/* ========== components.css ========== */
/* Enthält alle komponentenspezifischen Styles für Dashboard, Gruppen, Todos, Kalender, Notizen, Auth und Modal */

/* ------------------------------------------------------------------
   1. DASHBOARD & GRUPPEN
------------------------------------------------------------------ */
.dashboard-page {
  background: var(--dashboard-gradient, linear-gradient(145deg, #f0f4ff 0%, #f8faff 100%));
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Hintergrund-Effekte (optional) */
.dashboard-page::before {
  content: '';
  position: fixed;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.02) 0%, transparent 20%),
    radial-gradient(circle at 90% 50%, rgba(168, 85, 247, 0.02) 0%, transparent 30%),
    radial-gradient(circle at 30% 80%, rgba(99, 102, 241, 0.02) 0%, transparent 25%),
    radial-gradient(circle at 70% 10%, rgba(168, 85, 247, 0.02) 0%, transparent 35%);
  pointer-events: none;
  z-index: 0;
  animation: pulseBackground 15s ease-in-out infinite alternate;
}

@keyframes pulseBackground {
  0% { opacity: 0.5; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.1); }
}

/* Dashboard Header */
.dashboard-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
  padding: 0.75rem 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.6);
  padding: 0.5rem 1rem 0.5rem 0.5rem;
  border-radius: 60px;
  color: var(--text);
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  transition: all 0.3s ease;
}
.user-badge:hover {
  background: white;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
  transform: scale(1.02);
}
.user-badge i {
  font-size: 1.5rem;
  color: #6366f1;
  background: white;
  border-radius: 50%;
  padding: 0.25rem;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

/* Welcome Section */
.welcome-section {
  text-align: left;
  margin-bottom: 3rem;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px);
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  position: relative;
  overflow: hidden;
}
.welcome-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
  animation: lightMove 10s ease-in-out infinite;
  pointer-events: none;
}
@keyframes lightMove {
  0% { transform: translate(0,0) rotate(0deg); opacity:0.3; }
  50% { transform: translate(10%,10%) rotate(5deg); opacity:0.6; }
  100% { transform: translate(0,0) rotate(0deg); opacity:0.3; }
}
.welcome-section h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  line-height: 1.2;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  display: inline-block;
}
.welcome-section h1::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, #6366f1, #a855f7);
  border-radius: 4px;
  animation: underlineGrow 2s ease-out forwards;
}
@keyframes underlineGrow {
  from { width: 0; opacity: 0; }
  to { width: 80px; opacity: 1; }
}
.welcome-section p {
  color: #475569;
  font-size: 1.125rem;
  max-width: 600px;
  padding-left: 1rem;
  border-left: 3px solid rgba(99, 102, 241, 0.3);
}

/* Gruppen-Grid & Karten */
.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
  position: relative;
  z-index: 10;
}

.group-card {
  background: var(--card-gradient, linear-gradient(145deg, #ffffff, #fafcff));
  border-radius: 32px;
  padding: 2rem 1.5rem;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}
.group-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 30px 50px -15px rgba(99, 102, 241, 0.3), 0 0 0 2px rgba(255, 255, 255, 0.9) inset, 0 0 30px var(--glow-color, rgba(99,102,241,0.15));
}
.group-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.4) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.group-card:hover::before {
  opacity: 1;
}
.group-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background: linear-gradient(90deg, var(--group-color, #6366f1), #a855f7);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}
.group-card:hover::after {
  transform: scaleX(1);
}

.group-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(255,255,255,0.5));
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  box-shadow: 0 15px 25px -10px rgba(0,0,0,0.1), 0 0 0 1px rgba(255,255,255,0.8) inset;
  transition: all 0.3s ease;
}
.group-card:hover .group-icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 20px 30px -10px var(--group-color, #6366f1), 0 0 0 2px white inset;
}
.group-icon i {
  font-size: 2rem;
  color: var(--group-color, #6366f1);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
  transition: all 0.3s ease;
}
.group-card:hover .group-icon i {
  transform: scale(1.1);
  filter: drop-shadow(0 4px 8px var(--group-color, #6366f1));
}

.group-card h3 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  color: #1e293b;
  letter-spacing: -0.02em;
}

.personal-badge {
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(168,85,247,0.1));
  color: #6366f1;
  padding: 0.35rem 1rem;
  border-radius: 60px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(99,102,241,0.2);
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(99,102,241,0.1);
}

.group-card p {
  color: #64748b;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.group-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #64748b;
  font-size: 0.875rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding-top: 1.25rem;
}
.group-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.5);
  padding: 0.35rem 1rem;
  border-radius: 60px;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.5);
  transition: all 0.3s ease;
}
.group-card:hover .group-meta span {
  background: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}
.group-meta i {
  color: #6366f1;
  font-size: 0.875rem;
}

/* Floating Action Button */
.fab {
  position: fixed;
  bottom: 2.5rem;
  right: 2.5rem;
  width: 70px;
  height: 70px;
  border-radius: 35px;
  background: linear-gradient(145deg, #6366f1, #8b5cf6);
  color: white;
  border: none;
  box-shadow: 0 20px 30px -10px rgba(99, 102, 241, 0.5), 0 0 0 2px rgba(255, 255, 255, 0.5) inset;
  font-size: 1.75rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  animation: fabPulse 2s ease-in-out infinite;
}
@keyframes fabPulse {
  0%,100% { transform: scale(1); box-shadow: 0 20px 30px -10px rgba(99,102,241,0.5); }
  50% { transform: scale(1.05); box-shadow: 0 25px 40px -5px rgba(99,102,241,0.7); }
}
.fab:hover {
  transform: scale(1.15) rotate(90deg);
  box-shadow: 0 30px 40px -10px rgba(99,102,241,0.7), 0 0 0 4px rgba(255,255,255,0.8) inset;
}
.fab i {
  transition: all 0.3s ease;
}
.fab:hover i {
  transform: rotate(90deg);
}

/* ------------------------------------------------------------------
   2. GROUP PAGE (Sidebar, Hauptbereich)
------------------------------------------------------------------ */
.group-page {
  background: linear-gradient(145deg, #f1f5f9 0%, #ffffff 100%);
  min-height: 100vh;
}
.group-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.group-sidebar {
  width: 320px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  transition: width 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 4px 0 20px rgba(0,0,0,0.02);
  z-index: 30;
}
.group-sidebar.collapsed {
  width: 100px;
}
.group-sidebar.collapsed .group-info,
.group-sidebar.collapsed .sidebar-nav span,
.group-sidebar.collapsed .back-link span,
.group-sidebar.collapsed .nav-badge {
  display: none;
}
.sidebar-header {
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.group-avatar {
  width: 80px;
  height: 80px;
  background: linear-gradient(145deg, var(--primary), #a855f7);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  box-shadow: 0 15px 25px -8px rgba(99,102,241,0.3);
}
.group-avatar i {
  font-size: 2.5rem;
  color: white;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}
.group-info {
  text-align: center;
}
.group-info h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  word-break: break-word;
}
.member-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(99,102,241,0.1);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
}
.sidebar-nav {
  flex: 1;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: none;
  background: transparent;
  border-radius: 20px;
  color: var(--text-light);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}
.nav-item i {
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
}
.nav-item span {
  flex: 1;
}
.nav-badge {
  background: rgba(99,102,241,0.1);
  color: var(--primary);
  padding: 0.25rem 0.5rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}
.nav-item:hover {
  background: rgba(99,102,241,0.05);
  color: var(--primary);
}
.nav-item.active {
  background: linear-gradient(145deg, var(--primary), #8183f3);
  color: white;
  box-shadow: 0 8px 16px -4px rgba(99,102,241,0.3);
}
.nav-item.active .nav-badge {
  background: rgba(255,255,255,0.25);
  color: white;
}
.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(0,0,0,0.05);
}
.back-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-light);
  font-weight: 500;
  transition: color 0.2s;
}
.back-link:hover {
  color: var(--primary);
}

/* Hauptbereich */
.group-main {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}
.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  padding: 1.5rem 2rem;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  border-radius: 32px;
  box-shadow: 0 8px 20px -6px rgba(0,0,0,0.02);
}
.header-title h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  background: linear-gradient(145deg, var(--text), #4b5563);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.subtitle {
  color: var(--text-light);
  font-size: 0.95rem;
}
.view-container {
  animation: fadeSlideIn 0.3s ease;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ------------------------------------------------------------------
   3. TODO-DETAILS SIDEBAR (rechts)
------------------------------------------------------------------ */
.todo-details-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  height: 100vh;
  background: white;
  box-shadow: -5px 0 25px rgba(0,0,0,0.1);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
.todo-details-sidebar.show {
  transform: translateX(0);
}
.todo-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.todo-details-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
}
.todo-details-close {
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
}
.todo-details-close i {
  font-size: 1.5rem;
}
.todo-details-close:hover {
  background: rgba(0,0,0,0.05);
  color: #ef4444;
}
.todo-details-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}
.todo-details-section {
  margin-bottom: 2rem;
}
.todo-details-section h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}
.todo-details-field {
  margin-bottom: 1.25rem;
}
.todo-details-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-light);
}
.todo-details-field input,
.todo-details-field textarea,
.todo-details-field select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.95rem;
}
.todo-details-field textarea {
  min-height: 100px;
  resize: vertical;
}
.todo-details-footer {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.todo-details-footer button {
  flex: 1;
  padding: 0.75rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}
.btn-save {
  background: var(--primary);
  color: white;
}
.btn-delete {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.btn-delete:hover {
  background: #fecaca;
}

/* Unteraufgaben */
.subtasks-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
}
.subtask-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background: rgba(0,0,0,0.02);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}
.subtask-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
}
.subtask-item span {
  flex: 1;
  font-size: 0.95rem;
}
.subtask-item button {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.25rem;
}
.subtask-item button:hover {
  color: #ef4444;
}
.add-subtask {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.add-subtask input {
  flex: 1;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.add-subtask button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0 1rem;
  border-radius: 8px;
  cursor: pointer;
}

/* Dateianhänge */
.attachments-list {
  margin-bottom: 1rem;
}
.attachment-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background: rgba(0,0,0,0.02);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}
.attachment-item i {
  color: var(--primary);
}
.attachment-item span {
  flex: 1;
  font-size: 0.9rem;
}
.attachment-item button,
.attachment-btn {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: color 0.2s;
}
.attachment-btn:hover,
.attachment-item button:hover {
  color: var(--primary);
}
.attachment-btn:hover .fa-trash,
.attachment-item button:hover .fa-trash {
  color: #ef4444;
}
.upload-btn {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
}
.upload-btn input {
  display: none;
}

/* ------------------------------------------------------------------
   4. TODO-ÜBERSICHT (Karten)
------------------------------------------------------------------ */
.todo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.5rem;
}
.todo-card {
  background: white;
  border-radius: 24px;
  padding: 1.5rem;
  border: 1px solid rgba(0,0,0,0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.todo-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 30px -10px rgba(99,102,241,0.15);
  border-color: rgba(99,102,241,0.3);
}
.todo-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}
.todo-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #1e293b;
}
.todo-desc {
  color: #64748b;
  font-size: 0.9rem;
  margin-top: 0.25rem;
  line-height: 1.5;
}
.todo-meta {
  background: rgba(249,250,251,0.8);
  padding: 0.75rem 1rem;
  border-radius: 16px;
  margin-top: 1rem;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.todo-assignee,
.todo-date {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  padding: 0.4rem 0.8rem;
  border-radius: 30px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
  max-width: 100%;
  word-break: break-word;
}
.todo-assignee i,
.todo-date i {
  color: var(--primary);
}
.todo-check {
  position: relative;
  width: 24px;
  height: 24px;
  margin-top: 0.25rem;
}
.todo-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  background: white;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.todo-check input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
  position: relative;
}
.todo-check input[type="checkbox"]:checked::after {
  content: "✓";
  color: white;
  font-size: 14px;
  font-weight: bold;
}

/* ------------------------------------------------------------------
   5. KALENDER
------------------------------------------------------------------ */
.calendar-wrapper {
  background: white;
  border-radius: 32px;
  padding: 2rem;
  box-shadow: 0 15px 35px -10px rgba(0,0,0,0.05);
}
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}
.calendar-month {
  font-size: 1.5rem;
  font-weight: 700;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.75rem;
}
.calendar-weekday {
  text-align: center;
  font-weight: 600;
  color: var(--text-light);
  padding: 0.75rem;
}
.calendar-day {
  background: rgba(249,250,251,0.6);
  border-radius: 20px;
  padding: 1rem 0.5rem;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.calendar-day:hover {
  background: white;
  border-color: var(--primary);
  box-shadow: 0 8px 16px rgba(0,0,0,0.02);
}
.calendar-day.today {
  background: rgba(99,102,241,0.05);
  border: 2px solid var(--primary);
}
.calendar-day.weekend {
  background: rgba(239,68,68,0.05);
  border-color: rgba(239,68,68,0.2);
}
.calendar-day.weekend .day-number {
  color: #ef4444;
}
.day-number {
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.event-item {
  background: linear-gradient(145deg, var(--primary), #a855f7);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Kalender-Picker (eigener DatePicker) */
.calendar-picker-wrapper {
  position: relative;
  width: 100%;
}
.calendar-picker-input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 2.75rem;
  border: 2px solid var(--border);
  border-radius: 16px;
  font-size: 1rem;
  background: white;
  cursor: pointer;
}
.calendar-picker-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  pointer-events: none;
}
.calendar-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 220px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.15);
  border: 1px solid var(--border);
  padding: 0.75rem;
  z-index: 1000;
  display: none;
}
.calendar-popup.show {
  display: block;
}
.calendar-popup .calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.calendar-popup .calendar-header button {
  background: none;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  transition: background 0.2s;
  font-size: 0.75rem;
}
.calendar-popup .calendar-header button:hover {
  background: rgba(99,102,241,0.1);
}
.calendar-popup .calendar-month-year {
  font-weight: 600;
  font-size: 0.85rem;
}
.calendar-popup .calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: 600;
  font-size: 0.65rem;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}
.calendar-popup .calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}
.calendar-picker-day {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.7rem;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.calendar-picker-day:hover {
  background: rgba(99,102,241,0.1);
  border-color: var(--primary);
}
.calendar-picker-day.selected {
  background: var(--primary);
  color: white;
  font-weight: 600;
}
.calendar-picker-day.empty {
  pointer-events: none;
  opacity: 0.3;
}
.calendar-picker-day.today {
  border: 2px solid var(--primary);
  font-weight: 600;
}
.calendar-popup .calendar-footer {
  margin-top: 0.5rem;
  display: flex;
  justify-content: flex-end;
}
.calendar-popup .calendar-footer button {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 30px;
  cursor: pointer;
  font-size: 0.7rem;
}
.calendar-popup .calendar-footer button:hover {
  background: rgba(99,102,241,0.1);
}

/* ------------------------------------------------------------------
   6. NOTIZEN
------------------------------------------------------------------ */
.notes-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  height: calc(100vh - 200px);
}
.notes-sidebar {
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(8px);
  border-radius: 32px;
  padding: 1.5rem;
  overflow-y: auto;
}
.notes-editor {
  background: white;
  border-radius: 32px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 15px 35px -10px rgba(0,0,0,0.05);
}
.tree-view {
  list-style: none;
  padding-left: 1.25rem;
  margin-top: 0.5rem;
}
.tree-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text);
}
.tree-item:hover {
  background: rgba(99,102,241,0.05);
}
.tree-item.active {
  background: rgba(99,102,241,0.1);
  color: var(--primary);
  font-weight: 500;
}
.tree-item i {
  width: 20px;
  color: var(--text-light);
}
.ql-container {
  min-height: 300px;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
}
.ql-toolbar {
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  border: 1px solid var(--border);
}
.ql-container {
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  border: 1px solid var(--border);
  border-top: none;
}

/* ------------------------------------------------------------------
   7. AUTH SEITEN (Login / Register)
------------------------------------------------------------------ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow-y: auto;
  padding: 3rem 1rem;
}
.auth-page::before {
  content: '';
  position: fixed;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
  animation: rotate 30s linear infinite;
  top: -50%;
  left: -50%;
  z-index: 1;
  pointer-events: none;
}
@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.auth-container {
  width: 100%;
  max-width: 440px;
  margin: auto;
  position: relative;
  z-index: 2;
}
.auth-card {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 32px;
  padding: 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  animation: fadeInUp 0.6s ease;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}
.auth-header .logo {
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 1rem;
  color: var(--text);
}
.auth-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.auth-header p {
  color: var(--text-light);
  font-size: 0.95rem;
}
.auth-form-group {
  margin-bottom: 1.5rem;
  position: relative;
}
.auth-form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.auth-input-wrapper i {
  position: absolute;
  left: 1rem;
  color: var(--text-light);
  font-size: 1rem;
  z-index: 2;
  pointer-events: none;
}
.auth-input-wrapper input {
  width: 100%;
  padding: 0.875rem 3rem 0.875rem 2.75rem;
  border: 2px solid var(--border);
  border-radius: 16px;
  font-size: 1rem;
  transition: all 0.2s;
  background: rgba(255,255,255,0.8);
}
.auth-input-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
  outline: none;
  background: white;
}
.toggle-password {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  font-size: 1.125rem;
  z-index: 3;
  border-radius: 8px;
}
.toggle-password:hover {
  color: var(--primary);
  background: rgba(99,102,241,0.05);
}
.auth-error {
  background: #fee2e2;
  color: #dc2626;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-left: 4px solid #dc2626;
}
.auth-btn {
  width: 100%;
  padding: 0.875rem;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(99,102,241,0.5);
}
.auth-footer {
  text-align: center;
  color: var(--text-light);
  font-size: 0.95rem;
}
.auth-footer a {
  color: var(--primary);
  font-weight: 600;
  transition: color 0.2s;
}
.auth-footer a:hover {
  color: #a855f7;
  text-decoration: underline;
}

/* ------------------------------------------------------------------
   8. MODAL (einheitlich)
------------------------------------------------------------------ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.3s ease;
}
.modal {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  padding: 2.5rem;
  border-radius: 48px;
  width: 90%;
  max-width: 550px;
  box-shadow: 0 50px 70px -20px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.8) inset;
  animation: modalFloat 0.5s cubic-bezier(0.34,1.56,0.64,1);
  border: 1px solid rgba(255,255,255,0.5);
}
@keyframes modalFloat {
  0% { opacity:0; transform:scale(0.9) translateY(20px); }
  100% { opacity:1; transform:scale(1) translateY(0); }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}
.modal-header h3 {
  font-size: 1.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.modal-header h3 i {
  background: linear-gradient(135deg, #6366f1, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.75rem;
}
.modal-close {
  background: rgba(255,255,255,0.3);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.5);
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  padding: 0;
}
.modal-close i {
  font-size: 1.5rem;
  color: #1e293b;
  transition: color 0.25s ease;
}
.modal-close:hover i {
  color: #6366f1;
}
.modal-close:hover {
  background: rgba(255,255,255,0.8);
  transform: scale(1.08);
  border-color: #6366f1;
  box-shadow: 0 8px 20px rgba(99,102,241,0.2);
}
/* Modal Footer Buttons */
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 2.5rem;
}
.modal-footer .btn {
  padding: 0.875rem 2rem;
  border-radius: 40px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 120px;
}
.modal-footer .btn-outline {
  background: transparent;
  border: 2px solid rgba(99,102,241,0.2);
  color: #475569;
}
.modal-footer .btn-outline:hover {
  background: white;
  border-color: #6366f1;
  color: #6366f1;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99,102,241,0.15);
}
.modal-footer {
  color: white;
}

.btn-primary {
  background: var(--primary); /* Feste Farbe, kein Gradient */
  border: none;
  padding: 0.875rem 1.75rem;
  border-radius: 40px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 10px 20px -8px rgba(99,102,241,0.4);
  line-height: 1;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary i {
  font-size: 1.2rem;
}
.btn-primary:hover {
  background: #a855f7; /* Helleres Lila beim Hover */
  transform: translateY(-2px);
  box-shadow: 0 15px 25px -8px rgba(99,102,241,0.5);
}
/* ------------------------------------------------------------------
   9. FORMULAR-FELDER (global)
------------------------------------------------------------------ */
.form-group {
  margin-bottom: 1.75rem;
}
.form-group label {
  display: block;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: #1e293b;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrapper i {
  position: absolute;
  left: 1rem;
  color: var(--text-light);
  font-size: 1rem;
  z-index: 2;
  pointer-events: none;
}
.input-wrapper input,
.input-wrapper textarea,
.input-wrapper select {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 2.75rem;
  border: 2px solid var(--border);
  border-radius: 16px;
  font-size: 1rem;
  transition: all 0.2s;
  background: white;
}
.input-wrapper input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99,102,241,0.1), 0 8px 20px rgba(99,102,241,0.1);
  outline: none;
  transform: scale(1.02);
}
.input-wrapper input:focus + i {
  transform: scale(1.1);
  color: #a855f7;
}
input[type="color"] {
  padding: 0.5rem;
  height: 60px;
  cursor: pointer;
}

/* ------------------------------------------------------------------
   10. LOADING & EMPTY STATES
------------------------------------------------------------------ */
.loading-spinner {
  grid-column: 1 / -1;
  text-align: center;
  padding: 5rem 2rem;
  color: #6366f1;
  font-size: 1.25rem;
  background: rgba(255,255,255,0.3);
  backdrop-filter: blur(8px);
  border-radius: 48px;
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 20px 40px -15px rgba(0,0,0,0.05);
}
.loading-spinner i {
  margin-right: 1rem;
  font-size: 2rem;
  animation: spin 1s linear infinite;
  filter: drop-shadow(0 0 10px #6366f1);
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 5rem 3rem;
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(12px);
  border-radius: 48px;
  border: 1px solid rgba(255,255,255,0.8);
  box-shadow: 0 30px 50px -20px rgba(0,0,0,0.1);
}
.empty-state i {
  font-size: 5rem;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}
.empty-state h3 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #1e293b;
}
.empty-state p {
  color: #64748b;
  margin-bottom: 2rem;
  font-size: 1.125rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}
.empty-state .btn {
  padding: 1rem 2.5rem;
  font-size: 1.125rem;
  border-radius: 40px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: white;
  border: none;
  box-shadow: 0 15px 25px -8px rgba(99,102,241,0.4);
  transition: all 0.3s ease;
}
.empty-state .btn:hover {
  transform: scale(1.05) translateY(-3px);
  box-shadow: 0 20px 35px -8px rgba(99,102,241,0.6);
}

/* ------------------------------------------------------------------
   11. RESPONSIVE (zusammengefasst)
------------------------------------------------------------------ */
@media (max-width: 1024px) {
  .group-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
  }
  .welcome-section h1 {
    font-size: 2.5rem;
  }
}
@media (max-width: 768px) {
  .group-layout {
    flex-direction: column;
  }
  .group-sidebar {
    width: 100%;
    height: auto;
  }
  .group-sidebar.collapsed {
    width: 100%;
    height: 80px;
    overflow: hidden;
  }
  .group-main {
    padding: 1rem;
  }
  .notes-layout {
    grid-template-columns: 1fr;
  }
  .dashboard-header {
    padding: 0.75rem 1rem;
  }
  .user-badge span:not(#userEmail) {
    display: none;
  }
  .welcome-section {
    padding: 1.5rem;
    text-align: center;
  }
  .welcome-section h1 {
    font-size: 2rem;
  }
  .welcome-section h1::after {
    left: 50%;
    transform: translateX(-50%);
  }
  .welcome-section p {
    border-left: none;
    padding-left: 0;
    text-align: center;
  }
  .group-grid {
    grid-template-columns: 1fr;
  }
  .group-card {
    max-width: 400px;
    margin: 0 auto;
  }
  .fab {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }
  .modal {
    padding: 2rem 1.5rem;
    border-radius: 32px;
    margin: 1rem;
  }
}
@media (max-width: 480px) {
  .welcome-section h1 {
    font-size: 1.75rem;
  }
  .group-card {
    padding: 1.5rem;
  }
  .group-icon {
    width: 60px;
    height: 60px;
  }
  .group-icon i {
    font-size: 1.75rem;
  }
  .group-card h3 {
    font-size: 1.5rem;
  }
  .modal-footer {
    flex-direction: column;
  }
  .modal-footer .btn {
    width: 100%;
  }
  .fab {
    bottom: 1rem;
    right: 1rem;
    width: 56px;
    height: 56px;
  }
  .auth-page {
    padding: 1rem 0.5rem;
  }
  .auth-card {
    padding: 1.5rem;
  }
}