/* ========================================
   DailyStruggle - Premium Design System v2
   ======================================== */

/* Local Fonts (DSGVO-konform - keine externen Requests) */
@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-Variable.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Outfit';
  src: url('/fonts/Outfit-Variable.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Dashboard Filter Controls */
.filter-controls-wrapper {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.filter-toggle-container {
  position: relative;
  flex: 1;
}

/* Tasks List View Overrides */
.tasks-grid.list-view {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tasks-grid.list-view .task-card {
  display: grid;
  grid-template-columns: 40px auto 1fr auto auto;
  /* Checkbox | Title | Meta | Edit | Delete */
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.5rem;
  flex-direction: row;
  /* Fallback */
}

.tasks-grid.list-view .task-drag-handle {
  display: none;
  /* Hide drag handle in list view for now */
}

.tasks-grid.list-view .task-content {
  display: contents;
  /* Let children participate in the card grid */
}

.tasks-grid.list-view .task-title {
  margin-bottom: 0;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.tasks-grid.list-view .task-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0;
  flex-wrap: nowrap;
  overflow: hidden;
}

.tasks-grid.list-view .btn-edit-task,
.tasks-grid.list-view .btn-delete-task {
  position: static;
  opacity: 1;
  transform: none;
}

:root {
  /* Colors */
  --primary: #6366f1;
  --primary-rgb: 99, 102, 241;
  --primary-dark: #4f46e5;
  --secondary: #8b5cf6;
  --accent: #06b6d4;
  --success: #10b981;
  --danger: #ef4444;

  /* Backgrounds */
  --bg-app: #f0f4f8;
  --surface-glass: rgba(255, 255, 255, 0.85);
  --surface-card: #ffffff;
  --surface-hover: #f8fafc;

  /* Text */
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  /* Borders & Shadows */
  --border-color: rgba(148, 163, 184, 0.2);
  --glass-border: 1px solid rgba(255, 255, 255, 0.5);
  --shadow-sm: 0 2px 4px rgba(148, 163, 184, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(148, 163, 184, 0.1), 0 2px 4px -1px rgba(148, 163, 184, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(148, 163, 184, 0.1), 0 4px 6px -2px rgba(148, 163, 184, 0.05);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);

  /* Layout */
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --font-main: 'Outfit', sans-serif;
}

[data-theme="dark"] {
  --bg-app: #0f172a;
  --surface-glass: rgba(30, 41, 59, 0.7);
  --surface-card: #1e293b;
  --surface-hover: #334155;

  --text-main: #f8fafc;
  --text-muted: #cbd5e1;

  --border-color: rgba(255, 255, 255, 0.1);
  --glass-border: 1px solid rgba(255, 255, 255, 0.1);

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.5);
}

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

html {
  height: 100%;
  background: var(--bg-app);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* Background Gradients */
body::before {
  content: '';
  position: fixed;
  top: -20%;
  left: -10%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  bottom: -20%;
  right: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.dashboard-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container-narrow {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ========================================
   Glass Header
   ======================================== */
.glass-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  border-bottom-color: var(--border-color);
  padding: 1rem 0;
}

.header-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.logo-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo:hover .logo-img {
  transform: scale(1.15);
}

.logo-text {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-md);
  transition: background 0.2s ease;
}

.user-profile:hover {
  background: var(--surface-hover);
}

.avatar-placeholder {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-email {
  display: none;
  /* Hidden on mobile */
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .user-email {
    display: block;
  }
}

/* Profile Picture Modal */
.profile-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.profile-modal.show {
  display: flex;
}

.profile-modal-content {
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
}

[data-theme="dark"] .profile-modal-content {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.profile-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.profile-modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

/* Light mode button improvements */
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-main);
  font-size: 0.875rem;
}

.btn-ghost:hover {
  background: var(--surface-hover);
  border-color: var(--text-muted);
}

.btn-ghost.text-danger {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-ghost.text-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--danger);
}

/* Back Link Animation */
.back-link-animated svg {
  transition: transform 0.2s ease;
}

.back-link-animated:hover svg {
  transform: translateX(-4px);
}

.profile-preview-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.profile-preview {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--bg-app);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 3px solid var(--border-color);
}

.profile-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-preview-placeholder {
  font-size: 3rem;
  color: var(--text-muted);
}

/* Interactive Cropper */
.crop-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.crop-container {
  position: relative;
  width: 250px;
  height: 250px;
  background: #1a1a2e;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

.crop-container:active {
  cursor: grabbing;
}

.crop-container img {
  position: absolute;
  transform-origin: center center;
  user-select: none;
  pointer-events: none;
}

.crop-circle-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* Circle mask using box-shadow */
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.crop-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 250px;
}

.crop-icon {
  font-size: 1rem;
}

.crop-zoom-slider {
  flex: 1;
  height: 6px;
  appearance: none;
  background: var(--border-color);
  border-radius: 3px;
  cursor: pointer;
}

.crop-zoom-slider::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.crop-zoom-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
}

.crop-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  display: block;
  width: 100%;
}

.profile-modal-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.profile-modal-actions button {
  flex: 1;
  min-width: 100px;
}

.btn-upload {
  position: relative;
  overflow: hidden;
}

.btn-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* ========================================
   Greeting & Input
   ======================================== */
.dashboard-main {
  padding-top: 4rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Force centering */
}

.heading-section {
  text-align: center;
  margin-bottom: 2.5rem;
  width: 100%;
}

.greeting-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 0.5rem;
  text-align: center;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.greeting-subtitle {
  color: var(--text-muted);
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
}

.floating-input-card {
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  padding: 0.75rem;
  box-shadow: var(--shadow-lg);
  border: var(--glass-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 2rem;
  width: 100%;
}

.floating-input-card:focus-within {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow), var(--shadow-lg);
}

.input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-app);
  border-radius: 99px;
  /* Pill shape */
  padding: 0.5rem 1rem;
  min-height: 3rem;
  /* Uniform height */
}

.input-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.input-wrapper.textarea-wrapper {
  border-radius: 20px;
  align-items: flex-start;
  padding-top: 1rem;
  height: auto;
}

.input-wrapper textarea {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 1.125rem;
  color: var(--text-main);
  outline: none;
  font-family: var(--font-main);
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}

.textarea-wrapper .input-icon {
  padding-top: 0.25rem;
}

.input-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

input {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 1.125rem;
  color: var(--text-main);
  outline: none;
  font-family: var(--font-main);
}

.btn-password-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color 0.2s;
  font-size: 1.25rem;
  width: 32px;
  /* Increased clickable area */
  height: 32px;
  border-radius: 50%;
  transition: all 0.2s ease;
  margin-right: 0.75rem;
}

.btn-password-toggle:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
}

.toggle-icon {
  width: 20px;
  /* Reduced size */
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  /* Keep sleek outline */
  fill: none;
  animation: scaleIn 0.2s ease-out;
}

@keyframes scaleIn {
  from {
    transform: scale(0.5);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.btn-add {
  background: var(--primary);
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  /* Circle */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

.plus-icon {
  font-size: 1.25rem;
  line-height: 1;
}

/* ========================================
   Auth Page Specifics & Cards
   ======================================== */
.auth-container-narrow {
  max-width: 480px;
}

.auth-card-glass {
  padding: 2.5rem;
}

.glass-tabs {
  display: flex;
  background: var(--bg-app);
  padding: 4px;
  border-radius: 99px;
  margin-bottom: 2rem;
}

.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.75rem;
  border-radius: 99px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab.active {
  background: var(--surface-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.auth-title {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.auth-form {
  display: none;
  animation: popIn 0.3s ease-out;
}

.auth-form.active {
  display: block;
}

.auth-input {
  margin-bottom: 1rem;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  cursor: pointer;
}

.checkbox-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  flex: 1;
}

/* Hide from Calendar Checkbox Option */
.hide-calendar-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.hide-calendar-option input[type="checkbox"] {
  display: none;
}

.hide-calendar-option .checkbox-custom {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  background: var(--surface-card);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hide-calendar-option input[type="checkbox"]:checked+.checkbox-custom {
  background: var(--primary);
  border-color: var(--primary);
}

.hide-calendar-option input[type="checkbox"]:checked+.checkbox-custom::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.hide-calendar-option .checkbox-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hide-calendar-option:hover .checkbox-custom {
  border-color: var(--primary);
}

/* ... */
.btn-primary-block {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  padding: 1rem;
  border-radius: 99px;
  /* Pill shape */
  font-size: 1.125rem;
  font-weight: 700;
  text-align: center;


  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary-block:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.form-error {
  color: var(--danger);
  min-height: 1.5rem;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  text-align: center;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  margin-bottom: 1rem;
  margin-left: 0.5rem;
  line-height: 1.4;
}

/* ========================================
   Progress & Loaded Tasks
   ======================================== */
.stats-mini {
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.progress-bar-container {
  height: 6px;
  background: var(--border-color);
  border-radius: 99px;
  overflow: hidden;
}

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

.stats-text {
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Filter Dropdown */
.filter-section {
  margin-bottom: 1.5rem;
  position: relative;
}

.filter-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-main);
  font-size: 0.9rem;
}

.filter-toggle:hover {
  border-color: var(--primary);
}

.filter-toggle.open {
  border-color: var(--primary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.filter-toggle-icon {
  font-size: 1rem;
}

.filter-toggle-text {
  flex: 1;
  text-align: left;
  font-weight: 500;
}

.filter-toggle-arrow {
  font-size: 0.6rem;
  transition: transform 0.2s;
  opacity: 0.5;
}

.filter-toggle.open .filter-toggle-arrow {
  transform: rotate(180deg);
}

.filter-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--surface-card);
  border: 1px solid var(--primary);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  z-index: 100;
  animation: dropdownSlide 0.15s ease-out;
}

.filter-dropdown.open {
  display: block;
}

@keyframes dropdownSlide {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem;
  max-height: 200px;
  overflow-y: auto;
}

.filter-btn {
  padding: 0.4rem 0.85rem;
  border-radius: 99px;
  border: 1px solid var(--border-color);
  background: var(--bg-app);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

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

/* ========================================
   Task Items
   ======================================== */
@media (min-width: 768px) {
  .tasks-grid:not(.list-view) {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    align-items: start;
  }

  .tasks-grid:not(.list-view) .tasks-empty-celebration {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    width: 100%;
    margin: 2rem auto;
  }
}

.tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  padding-bottom: 4rem;
  width: 100%;
}

.task-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  animation: slideIn 0.4s ease-out backwards;
  position: relative;
}

/* Card adjustments for Grid View (Default) */
.tasks-grid:not(.list-view) .task-card {
  flex-direction: column;
  align-items: flex-start;
  padding: 1.75rem;
  height: 100%;
  min-height: 180px;
}

.task-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(99, 102, 241, 0.4);
}

.task-card.completed {
  opacity: 0.6;
  background: var(--bg-app);
  box-shadow: none;
}

/* Custom Checkbox */
.custom-checkbox {
  position: relative;
  width: 24px;
  height: 24px;
  border: 2px solid var(--text-light);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.custom-checkbox.small {
  width: 20px;
  height: 20px;
  border-radius: 6px;
}

.custom-checkbox:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
  /* very light primary */
}

.custom-checkbox.checked,
.custom-checkbox.active {
  background: var(--primary);
  border-color: var(--primary);
}

.check-icon {
  color: white;
  font-size: 14px;
  display: none;
  transform: scale(0);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-checkbox.small .check-icon {
  font-size: 12px;
}

.custom-checkbox.checked .check-icon,
.custom-checkbox.active .check-icon {
  display: block;
  transform: scale(1);
}

.task-content {
  flex: 1;
  font-size: 1rem;
  line-height: 1.5;
  transition: color 0.2s ease;
  /* Prevent long text overflow */
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
  /* Allow flex item to shrink */
}

.task-card.completed .task-content {
  text-decoration: line-through;
  color: var(--text-muted);
}

.btn-delete-task {
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
  opacity: 0.4;
  /* Always visible, but subtle */
}

.task-card:hover .btn-delete-task {
  opacity: 1;
}

.btn-delete-task:hover {
  background: #fee2e2;
  color: var(--danger);
}

/* Task Drag Handle */
.task-drag-handle {
  color: var(--text-light);
  cursor: grab;
  font-size: 1.1rem;
  letter-spacing: 1px;
  opacity: 0.4;
  transition: opacity 0.2s;
  user-select: none;
  flex-shrink: 0;
}

.task-card:hover .task-drag-handle {
  opacity: 0.8;
}

.task-drag-handle:active {
  cursor: grabbing;
}

/* Drag States */
.task-card.dragging {
  opacity: 0.5;
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

.task-card.drag-over {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
  transform: translateY(2px);
}

/* Task Title and Meta */
.task-title {
  font-size: 1rem;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.task-meta:empty {
  display: none;
}

/* Time Badge */
.task-time-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 99px;
  font-weight: 500;
}

/* Tags */
.task-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 99px;
  border: 1px solid;
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: default;
}

.task-tag:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Assignees */
.task-assignees {
  display: flex;
  gap: -0.25rem;
}

.task-assignee {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  margin-left: -4px;
  border: 2px solid var(--surface-card);
}

.task-assignee:first-child {
  margin-left: 0;
}

/* Edit Button */
.btn-edit-task {
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
  opacity: 0.4;
}

.task-card:hover .btn-edit-task {
  opacity: 1;
}

/* Position adjustments for Grid View */
.tasks-grid:not(.list-view) .task-title {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  padding-right: 2rem;
}

.tasks-grid:not(.list-view) .task-meta {
  margin-top: auto;
  width: 100%;
}

.tasks-grid:not(.list-view) .task-drag-handle {
  position: absolute;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
}

.tasks-grid:not(.list-view) .task-card:hover .task-drag-handle {
  opacity: 0.4;
}

.tasks-grid:not(.list-view) .btn-edit-task,
.tasks-grid:not(.list-view) .btn-delete-task {
  position: absolute;
  opacity: 0;
  background: var(--surface);
  border: 1px solid var(--border-color);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tasks-grid:not(.list-view) .btn-edit-task {
  top: 1rem;
  right: 3.25rem;
}

.tasks-grid:not(.list-view) .btn-delete-task {
  top: 1rem;
  right: 1rem;
}

.tasks-grid:not(.list-view) .task-card:hover .btn-edit-task,
.tasks-grid:not(.list-view) .task-card:hover .btn-delete-task {
  opacity: 1;
  transform: translateY(0);
}

.btn-edit-task:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
}

/* Form Group for Edit Modal */
.form-group {
  margin-bottom: 0;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 0.6rem;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-light);
}

.form-input:hover,
.form-textarea:hover {
  border-color: var(--text-light);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-app);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

/* Textarea */
.form-textarea {
  resize: vertical;
  min-height: 60px;
  max-height: 150px;
  line-height: 1.5;
}

/* Custom resize handle indicator */
.form-textarea::-webkit-resizer {
  background: linear-gradient(135deg, transparent 50%, var(--primary) 50%);
  border-radius: 0 0 var(--radius-lg) 0;
}

/* Notes icon on task card */
.task-notes-icon {
  font-size: 0.8rem;
  opacity: 0.7;
  cursor: default;
}

/* Group badge */
.task-group-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  padding: 0.2rem 0.5rem;
  border-radius: 99px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Datetime-local Input Styling */
input[type="datetime-local"].form-input {
  position: relative;
  cursor: pointer;
}

input[type="datetime-local"].form-input::-webkit-calendar-picker-indicator {
  background: transparent;
  cursor: pointer;
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  opacity: 0.6;
  transition: opacity 0.2s;
  filter: var(--calendar-icon-filter, none);
}

input[type="datetime-local"].form-input:hover::-webkit-calendar-picker-indicator {
  opacity: 1;
}

[data-theme="dark"] input[type="datetime-local"].form-input::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

/* Custom datetime appearance */
input[type="datetime-local"].form-input {
  padding-right: 3rem;
  appearance: none;
  -webkit-appearance: none;
}

/* Tag suggestions container */
.tag-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.tag-suggestion {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: var(--surface-card);
  color: var(--text-muted);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.tag-suggestion:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
  transform: translateY(-1px);
}

.tag-suggestion.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* SVG Icons in Labels */
.label-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

/* SVG Icons in Tags */
.tag-icon {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

/* Form Select Styling */
.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--surface-card);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 12px 12px;
  padding-right: 2.5rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-select:hover {
  border-color: var(--primary);
  background-color: var(--surface-hover);
}

.form-select:focus {
  background-color: var(--bg-app);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 12px 12px;
}

/* Animated Icon Effects */
.tag-suggestion:hover .star-icon {
  stroke: #f59e0b;
  animation: starPulse 0.6s ease-in-out;
}

.tag-suggestion:hover .fire-icon {
  stroke: #ef4444;
  animation: firePulse 0.4s ease-in-out infinite;
}

.tag-suggestion:hover .idea-icon {
  stroke: #fbbf24;
  animation: ideaGlow 0.6s ease-in-out;
}

.tag-suggestion:hover .sun-icon {
  stroke: #f59e0b;
  animation: sunRotate 2s linear infinite;
}

.tag-suggestion:hover .sunrise-icon {
  stroke: #fb923c;
  animation: riseUp 0.5s ease-out;
}

.tag-suggestion:hover .sunset-icon {
  stroke: #f97316;
  animation: setDown 0.5s ease-out;
}

.tag-suggestion:hover .moon-icon {
  stroke: #8b5cf6;
  animation: moonGlow 1s ease-in-out infinite;
}

.tag-suggestion:hover .folder-icon,
.label-icon.folder-icon:hover {
  stroke: #f59e0b;
}

.label-icon.recurrence-icon {
  animation: none;
}

.form-group:hover .label-icon.recurrence-icon {
  animation: spin 2s linear infinite;
}

.label-icon.notes-icon {
  transition: transform 0.3s ease;
}

.form-group:hover .label-icon.notes-icon {
  transform: rotate(-3deg);
}

/* Icon Animations */
@keyframes starPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
    fill: rgba(245, 158, 11, 0.3);
  }
}

@keyframes firePulse {

  0%,
  100% {
    transform: scale(1) translateY(0);
  }

  50% {
    transform: scale(1.05) translateY(-1px);
  }
}

@keyframes ideaGlow {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

@keyframes sunRotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes riseUp {
  0% {
    transform: translateY(2px);
    opacity: 0.5;
  }

  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes setDown {
  0% {
    transform: translateY(-2px);
    opacity: 0.5;
  }

  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes moonGlow {

  0%,
  100% {
    opacity: 1;
    filter: drop-shadow(0 0 2px rgba(139, 92, 246, 0.5));
  }

  50% {
    opacity: 0.8;
    filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.8));
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Recurrence Icon in Task Cards */
.recurrence-icon {
  display: inline-flex;
  font-size: 0.7rem;
  margin-left: 0.25rem;
  animation: spin 3s linear infinite;
}

/* ========================================
   Footer Actions
   ======================================== */
.dashboard-footer-actions {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding-bottom: 2rem;
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.btn-text:hover {
  color: var(--primary);
  background: rgba(0, 0, 0, 0.03);
}

.text-danger {
  color: var(--danger);
}

.text-danger:hover {
  color: var(--danger);
}

.divider {
  color: var(--border-color);
}

/* ========================================
   Buttons & Utils
   ======================================== */
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-ghost:hover {
  background: var(--bg-app);
  border-color: var(--text-muted);
}

/* Theme Toggle Switch */
.theme-toggle-wrapper {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 32px;
}

.theme-toggle-input {
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-toggle-label {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--surface-card);
  border: 1px solid var(--border-color);
  transition: .4s;
  border-radius: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.theme-toggle-label:before {
  position: absolute;
  content: "";
  height: 24px;
  width: 24px;
  left: 4px;
  bottom: 3px;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  /* Sun gradient */
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

.toggle-icon {
  font-size: 14px;
  z-index: 1;
  line-height: 1;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

.toggle-icon.sun {
  opacity: 1;
}

.toggle-icon.moon {
  opacity: 0.3;
}

/* Checked State (Dark Mode) */
#theme-toggle-checkbox:checked+.theme-toggle-label {
  background-color: var(--surface-hover);
  border-color: var(--border-color);
}

#theme-toggle-checkbox:checked+.theme-toggle-label:before {
  transform: translateX(24px);
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  /* Moon gradient */
}

#theme-toggle-checkbox:checked+.theme-toggle-label .toggle-icon.sun {
  opacity: 0.3;
}

#theme-toggle-checkbox:checked+.theme-toggle-label .toggle-icon.moon {
  opacity: 1;
}

/* Hide default button styles if present */
button.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

/* Animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popIn {
  0% {
    transform: scale(0.95);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Modal */
.modal,
.glass-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.modal.show,
.glass-modal.show {
  display: flex;
}

.glass-modal .modal-content,
.modal .modal-content {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  border-radius: 24px;
  padding: 0;
  width: 95%;
  max-width: 1000px;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.25s ease-out;
  overflow: hidden;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-radius: 24px 24px 0 0;
  flex-shrink: 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-body {
  padding: 1rem 1.5rem;
  color: var(--text-main);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.form-group.span-full {
  grid-column: 1 / -1;
}

@media (max-width: 768px) {
  .modal-body {
    grid-template-columns: 1fr;
  }
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 0.875rem 1.5rem;
  background: var(--bg-app);
  border-top: 1px solid var(--border-color);
  border-radius: 0 0 24px 24px;
  flex-shrink: 0;
}

.btn-close {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0;
  line-height: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  color: white;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close::before,
.btn-close::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-close::before {
  transform: rotate(45deg);
}

.btn-close::after {
  transform: rotate(-45deg);
}

.btn-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg) scale(1.1);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-close:active {
  transform: rotate(90deg) scale(0.95);
}

.btn-danger {
  background: var(--danger);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.btn-secondary {
  background: var(--bg-app);
  color: var(--text-main);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
}

/* Confetti Canvas */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

.tasks-loading {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
  font-size: 0.875rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 1rem 1.5rem;
  z-index: 100;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.glass-toast {
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: var(--glass-border);
  box-shadow: var(--shadow-lg);
  color: var(--text-main);
  font-weight: 500;
  border-radius: var(--radius-lg);
}

/* ========================================
   Landing Page Styles
   ======================================== */

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Reuse glass header styles if possible, or define .header alias */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  border-bottom-color: var(--border-color);
  padding: 1rem 0;
}

.main {
  flex: 1;
}

/* Hero Section */
.hero {
  padding: 6rem 1.5rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.badge {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  padding: 0.5rem 1rem;
  border-radius: 99px;
  font-weight: 600;
  font-size: 0.875rem;
  align-self: flex-start;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.hero-title {
  font-size: 3.5rem;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -1.5px;
}

.hero-description {
  font-size: 1.125rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 90%;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 99px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--surface-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--text-muted);
}

/* Header Actions (Landing) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-outline-sm {
  padding: 0.5rem 1.25rem;
  border-radius: 99px;
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--primary);
  border: 1px solid var(--primary);
  background: transparent;
  transition: all 0.2s;
}

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

/* Large Button */
.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

/* Centered Hero */
.hero-centered {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4rem 1.5rem;
}

.hero-centered .hero-content {
  max-width: 700px;
}

.hero-centered .hero-title {
  font-size: 2.75rem;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.hero-centered .hero-description {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
}

.hero-centered .hero-actions {
  justify-content: center;
}

.hero-subtext {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Hero Signup Form */
.hero-signup-form {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.signup-input-wrapper {
  display: flex;
  gap: 0.5rem;
  padding: 0.375rem;
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: 99px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

.signup-input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.hero-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.5rem 0.5rem 0.5rem 1.5rem;
  font-size: 1rem;
  color: var(--text-main);
  outline: none;
  min-width: 0;
}

.hero-input::placeholder {
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .signup-input-wrapper {
    flex-direction: column;
    border-radius: 1.5rem;
    padding: 1rem;
    gap: 1rem;
  }

  .hero-input {
    padding: 0.5rem;
    text-align: center;
    width: 100%;
    border-bottom: 1px solid var(--border-color);
  }

  .signup-input-wrapper:focus-within .hero-input {
    border-bottom-color: var(--primary);
  }

  .hero-signup-form .btn-lg {
    width: 100%;
  }
}

.badge-new {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

/* How It Works / Steps */
.how-it-works {
  padding: 4rem 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.steps-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.step-item {
  text-align: center;
  padding: 1.5rem;
  flex: 1;
  min-width: 180px;
  max-width: 250px;
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  font-weight: 700;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.step-item h4 {
  color: var(--text-main);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.step-item p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.step-arrow {
  font-size: 1.5rem;
  color: var(--primary);
  opacity: 0.5;
}

/* App Preview Section */
.preview-section {
  padding: 2rem 1.5rem 4rem;
  max-width: 1000px;
  margin: 0 auto;
}

.preview-container {
  position: relative;
  text-align: center;
}

.preview-badge {
  display: inline-block;
  background: var(--surface-card);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 99px;
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.preview-wrapper {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  background: var(--surface-card);
  padding: 8px;
}

.preview-image {
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius-xl) - 4px);
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.preview-wrapper:hover .preview-image {
  transform: scale(1.02);
}

.preview-zoom-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 99px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

.preview-wrapper:hover .preview-zoom-hint {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.preview-wrapper {
  cursor: zoom-in;
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 2rem;
  backdrop-filter: blur(10px);
}

.lightbox.show {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  max-width: 95%;
  max-height: 90vh;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox.show .lightbox-content {
  transform: scale(1);
}

.lightbox-image {
  width: 100%;
  height: auto;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: white;
  color: #0f172a;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  font-size: 1.5rem;
  transition: all 0.2s ease;
  z-index: 10001;
}

.lightbox-close:hover {
  transform: rotate(90deg) scale(1.1);
  background: var(--primary);
  color: white;
}

@media (max-width: 768px) {
  .lightbox-close {
    top: 1rem;
    right: 1rem;
  }

  .preview-zoom-hint {
    display: none;
    /* Hide hint on mobile, tap is enough */
  }
}

/* Theme-adaptive preview images */
.preview-dark {
  display: block;
}

.preview-light {
  display: none;
}

[data-theme="light"] .preview-dark {
  display: none;
}

[data-theme="light"] .preview-light {
  display: block;
}

/* CTA Section */
.cta-section {
  padding: 4rem 1.5rem;
  max-width: 700px;
  margin: 0 auto;
}

.cta-card {
  background: linear-gradient(145deg, var(--primary), var(--secondary));
  padding: 3rem 2rem;
  border-radius: var(--radius-xl);
  text-align: center;
  color: white;
}

.cta-card h3 {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

.cta-card p {
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

.cta-card .btn-primary {
  background: white;
  color: var(--primary);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.cta-card .btn-primary:hover {
  background: #f1f5f9;
}

@media (max-width: 768px) {
  .hero-centered .hero-title {
    font-size: 2rem;
  }

  .step-arrow {
    display: none;
  }

  .steps-grid {
    flex-direction: column;
  }
}

.btn-arrow {
  margin-left: 0.5rem;
  transition: transform 0.2s;
}

.btn-primary:hover .btn-arrow {
  transform: translateX(4px);
}

/* Hero Visual & Parallax */
.hero-visual {
  position: relative;
  height: 400px;
  display: none;
  /* hidden on mobile default */
}

@media (min-width: 768px) {
  .hero-visual {
    display: block;
  }
}

.floating-card {
  position: absolute;
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border-color, rgba(255, 255, 255, 0.2));
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: float 6s ease-in-out infinite;
}

.card-1 {
  top: 10%;
  right: 10%;
  animation-delay: 0s;
}

.card-2 {
  top: 45%;
  left: 0%;
  animation-delay: 2s;
}

.card-3 {
  bottom: 10%;
  right: 20%;
  animation-delay: 4s;
}

.card-icon {
  font-size: 1.5rem;
}

.card-text {
  font-weight: 600;
  color: var(--text-main);
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-20px);
  }
}

/* Features Section */
.features {
  padding: 4rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  text-align: center;
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 3rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.feature-card {
  background: var(--surface-card);
  padding: 2rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg), 0 10px 40px rgba(99, 102, 241, 0.1);
  border-color: var(--primary);
}

.feature-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.feature-svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  transition: transform 0.3s ease;
}

.feature-card:hover .feature-svg {
  transform: scale(1.1);
}

/* SVG Gradient Colors */
.feature-svg-tasks {
  color: #22c55e;
}

.feature-svg-tags {
  color: #f59e0b;
}

.feature-svg-calendar {
  color: #6366f1;
}

.feature-svg-darkmode {
  color: #8b5cf6;
}

.feature-svg-notes {
  color: #06b6d4;
}

.feature-svg-mobile {
  color: #ec4899;
}

/* Check animation */
.check-animate {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: drawCheck 1.5s ease forwards infinite;
}

@keyframes drawCheck {

  0%,
  100% {
    stroke-dashoffset: 30;
  }

  50% {
    stroke-dashoffset: 0;
  }
}

/* Tag dot pulse */
.tag-dot {
  fill: currentColor;
  animation: tagPulse 2s ease-in-out infinite;
}

@keyframes tagPulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.3);
    opacity: 0.7;
  }
}

/* Calendar dot */
.calendar-dot {
  fill: currentColor;
  animation: calendarBlink 1.5s ease-in-out infinite;
}

@keyframes calendarBlink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

/* Stars twinkle */
.star {
  fill: currentColor;
  animation: starTwinkle 2s ease-in-out infinite;
}

.star-1 {
  animation-delay: 0s;
}

.star-2 {
  animation-delay: 0.3s;
}

.star-3 {
  animation-delay: 0.6s;
}

@keyframes starTwinkle {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.3;
    transform: scale(0.6);
  }
}

/* Note lines appear */
.note-line {
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
  animation: writeLine 2s ease forwards infinite;
}

.note-1 {
  animation-delay: 0s;
}

.note-2 {
  animation-delay: 0.2s;
}

.note-3 {
  animation-delay: 0.4s;
}

@keyframes writeLine {

  0%,
  100% {
    stroke-dashoffset: 20;
  }

  50% {
    stroke-dashoffset: 0;
  }
}

/* Swipe animation */
.swipe-anim {
  animation: swipeDown 1.5s ease-in-out infinite;
}

@keyframes swipeDown {

  0%,
  100% {
    transform: translateY(-3px);
    opacity: 0.5;
  }

  50% {
    transform: translateY(3px);
    opacity: 1;
  }
}

/* Home button pulse */
.home-btn {
  fill: currentColor;
  animation: homePulse 2s ease-in-out infinite;
}

@keyframes homePulse {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

.feature-card h4 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.feature-card p {
  color: var(--text-muted);
  line-height: 1.5;
  font-size: 0.95rem;
}

/* Mobile responsive - 2 then 1 column */
@media (max-width: 900px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .features-grid {
    grid-template-columns: 1fr;
  }

  .feature-icon {
    width: 60px;
    height: 60px;
  }
}

/* Stats Section */
.stats {
  padding: 4rem 1.5rem;
  background: var(--surface-card);
  margin-top: 4rem;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.stats-grid {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  text-align: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-label {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 1rem;
}

/* Footer */
.footer {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1rem;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--primary);
}

/* Mobile Responsive */
@media (max-width: 768px) {

  /* Landing Page */
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 2rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .hero-actions {
    justify-content: center;
    flex-wrap: wrap;
  }

  .badge {
    align-self: center;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-description {
    max-width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .features-grid {
    gap: 1rem;
  }

  .feature-card {
    padding: 1.5rem;
  }

  /* Dashboard */
  .dashboard-main {
    padding-top: 2rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .container-narrow {
    padding: 0 1rem;
  }

  .greeting-title {
    font-size: 1.75rem;
  }

  .floating-input-card {
    padding: 0.5rem;
  }

  .input-wrapper {
    padding: 0.5rem 0.75rem;
  }

  /* Task Cards */
  .task-card {
    padding: 1rem;
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .task-drag-handle {
    font-size: 0.85rem;
  }

  .task-content {
    flex: 1 1 calc(100% - 100px);
    min-width: 0;
  }

  .task-title {
    font-size: 0.95rem;
  }

  .task-meta {
    gap: 0.35rem;
    margin-top: 0.4rem;
  }

  .task-time-badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
  }

  .task-tag {
    font-size: 0.6rem;
    padding: 0.15rem 0.4rem;
  }

  .task-assignee {
    width: 20px;
    height: 20px;
    font-size: 0.55rem;
  }

  .btn-edit-task,
  .btn-delete-task {
    padding: 6px;
  }

  .btn-edit-task svg,
  .btn-delete-task svg {
    width: 14px;
    height: 14px;
  }

  /* Header */
  .glass-header .container,
  .header-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .user-email {
    display: none;
  }

  /* Auth */
  .auth-container-narrow {
    width: 100%;
    max-width: 100%;
    padding: 0 1rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
  }

  .auth-card-glass {
    padding: 1.5rem;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .auth-title {
    font-size: 1.5rem;
  }

  .auth-subtitle {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
  }

  .auth-input .input-wrapper {
    padding: 0.5rem 0.75rem;
  }

  .auth-input input {
    font-size: 16px;
    /* Prevents iOS zoom on focus */
  }

  .auth-form .btn-primary-block {
    padding: 0.875rem;
    font-size: 1rem;
  }

  .glass-tabs {
    margin-bottom: 1.5rem;
  }

  .auth-tab {
    padding: 0.625rem;
    font-size: 0.9rem;
  }

  .checkbox-wrapper {
    margin-bottom: 1rem;
  }

  .checkbox-label {
    font-size: 0.8rem;
  }

  .form-hint {
    font-size: 0.7rem;
    margin-bottom: 0.75rem;
  }

  /* Footer actions */
  .dashboard-footer-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  /* Modal */
  .glass-modal .modal-content {
    width: calc(100% - 1.5rem);
    max-width: none;
    margin: 0.75rem;
    border-radius: 20px;
    max-height: calc(100vh - 1.5rem);
  }

  .modal-header {
    padding: 0.875rem 1rem;
    border-radius: 20px 20px 0 0;
  }

  .modal-header h3 {
    font-size: 1rem;
  }

  .modal-body {
    padding: 0.875rem 1rem;
    gap: 0.5rem;
  }

  .modal-actions {
    padding: 0.75rem 1rem;
    flex-direction: column;
    border-radius: 0 0 20px 20px;
  }

  .modal-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Form */
  .form-group {
    margin-bottom: 0;
  }

  .form-group label {
    font-size: 0.7rem;
    margin-bottom: 0.25rem;
  }

  .form-input,
  .form-textarea {
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 10px;
  }

  .tag-suggestions {
    gap: 0.35rem;
  }

  .tag-suggestion {
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
  }
}

/* Extra small screens (phones) */
@media (max-width: 480px) {
  .hero-title {
    font-size: 1.5rem;
  }

  .greeting-title {
    font-size: 1.35rem;
  }

  .greeting-subtitle {
    font-size: 0.95rem;
  }

  .btn {
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
  }

  .stat-number {
    font-size: 2.5rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  /* Task cards - more compact */
  .task-card {
    padding: 0.75rem;
  }

  .task-title {
    font-size: 0.9rem;
  }

  .task-meta {
    gap: 0.25rem;
  }

  .task-time-badge {
    font-size: 0.6rem;
  }

  .task-tag {
    font-size: 0.55rem;
    padding: 0.1rem 0.35rem;
  }

  .task-assignee {
    width: 18px;
    height: 18px;
    font-size: 0.5rem;
  }

  /* Hide drag handle on very small screens */
  .task-drag-handle {
    display: none;
  }

  /* Modal full width */
  .glass-modal .modal-content {
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
  }

  .modal-header {
    border-radius: 0;
  }

  /* Input section */
  .input-wrapper {
    padding: 0.4rem 0.6rem;
    gap: 0.5rem;
  }

  .input-icon {
    display: none;
  }

  #task-input {
    font-size: 0.9rem;
  }

  .btn-add {
    width: 36px;
    height: 36px;
  }
}

/* Very small phones (320px) */
@media (max-width: 360px) {
  .greeting-title {
    font-size: 1.2rem;
  }

  .container-narrow {
    padding: 0 0.75rem;
  }

  .task-card {
    padding: 0.6rem;
  }
}

/* =========================================
   Contacts Redesign (Unified Look)
   ========================================= */

/* Premium Contacts Header & Toggle */
.contacts-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 500px;
  margin-top: 1.5rem;
}

.view-toggle {
  display: flex;
  background: var(--surface-card);
  padding: 4px;
  border-radius: 99px;
  /* Pill shape */
  border: 1px solid var(--border-color);
  gap: 4px;
}

.btn-icon {
  background: transparent;
  border: none;
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--surface-hover);
  color: var(--primary);
}

.btn-icon.active {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.toggle-icon-svg {
  width: 20px;
  height: 20px;
}

.search-bar-wrapper {
  width: 100%;
}


/* Premium Contacts Header */
.contacts-header-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2.5rem;
  text-align: center;
  width: 100%;
}

.search-bar-wrapper {
  width: 100%;
  max-width: 500px;
  position: relative;
  margin-top: 1rem;
}

.search-bar-wrapper .form-input {
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  border-radius: 99px;
  background: var(--surface-card);
  transition: all 0.2s ease;
  font-size: 1rem;
}

.search-bar-wrapper .form-input:focus {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  border-color: var(--primary);
}

/* Cleanup old overrides if any */
.page-header h2 {
  display: none;
  /* Just in case */
}


/* Fixed Page Header Styling */
.page-header h2 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}


.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

/* List View Overrides */
.contacts-grid.list-view {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contacts-grid.list-view .contact-card {
  display: grid;
  grid-template-columns: 240px 1fr auto;
  /* Name | Details | Actions */
  align-items: center;
  padding: 0.75rem 1.5rem;
  gap: 1.5rem;
}

.contacts-grid.list-view .contact-header {
  margin-bottom: 0;
  display: flex;
  align-items: center;
  min-width: 0;
}

.contacts-grid.list-view .contact-details {
  display: grid;
  grid-template-columns: 150px 250px 110px 1fr;
  /* Strict Columns for Phone, Email, Link, Notes */
  gap: 1rem;
  align-items: center;
  margin: 0;
  width: 100%;
}

.contacts-grid.list-view .contact-actions {
  position: static;
  opacity: 1;
  transform: none;
  display: flex;
  gap: 0.5rem;
}

/* Assign Detail Columns */
.contacts-grid.list-view .contact-phone {
  grid-column: 1;
}

.contacts-grid.list-view .contact-email {
  grid-column: 2;
}

.contacts-grid.list-view .contact-link {
  grid-column: 3;
}

.contacts-grid.list-view .contact-note-item {
  grid-column: 4;
}

/* Handle overflow/ellipsis */
.contacts-grid.list-view .contact-detail-item,
.contacts-grid.list-view .contact-note-item {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0;
}

.contacts-grid.list-view .contact-detail-item a,
.contacts-grid.list-view .contact-note-item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* Note specific styling for list view */
.contacts-grid.list-view .contact-notes {
  margin-top: 0;
  background: transparent;
  border: none;
  padding: 0;
}

/* Hide verbose details in list view on small screens */
@media (max-width: 1100px) {
  .contacts-grid.list-view .contact-details {
    display: none;
  }

  .contacts-grid.list-view .contact-card {
    grid-template-columns: 1fr auto;
  }
}


.contact-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.contact-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(99, 102, 241, 0.3);
}

.contact-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.contact-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface-hover);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
}

@keyframes shine-avatar {
  0% {
    transform: translateX(-100%) rotate(45deg);
  }

  20%,
  100% {
    transform: translateX(100%) rotate(45deg);
  }
}

.contact-info h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-detail-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color 0.2s;
  padding: 0.25rem 0;
}

.contact-detail-item:hover {
  color: var(--text-main);
}

.contact-detail-item a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.contact-detail-item a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Action Buttons */
.contact-actions {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(-5px);
  transition: all 0.2s ease-out;
}

.contact-card:hover .contact-actions {
  opacity: 1;
  transform: translateY(0);
}

.icon-btn {
  background: var(--surface);
  border: 1px solid var(--border-color);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
}

.icon-btn:hover {
  background: var(--surface-hover);
  color: var(--primary);
  border-color: var(--primary);
  transform: scale(1.1);
}

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

/* SVG Animations */
.svg-icon {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Phone shake */
.contact-detail-item:hover .icon-phone {
  animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

/* Mail envelope open */
.contact-detail-item:hover .icon-mail {
  animation: pulse 1s infinite;
}

/* Trash lid open */
.icon-btn.danger:hover .icon-trash-lid {
  transform-origin: right bottom;
  transform: rotate(-25deg);
  transition: transform 0.2s;
}

/* Edit pencil write */
.icon-btn:hover .icon-edit {
  animation: write 1s ease-in-out infinite;
}

@keyframes shake {

  10%,
  90% {
    transform: translate3d(-1px, 0, 0);
  }

  20%,
  80% {
    transform: translate3d(2px, 0, 0);
  }

  30%,
  50%,
  70% {
    transform: translate3d(-3px, 0, 0);
  }

  40%,
  60% {
    transform: translate3d(3px, 0, 0);
  }
}

@keyframes write {
  0% {
    transform: rotate(0) translate(0, 0);
  }

  25% {
    transform: rotate(10deg) translate(2px, -2px);
  }

  50% {
    transform: rotate(-5deg) translate(-1px, 1px);
  }

  75% {
    transform: rotate(5deg) translate(1px, -1px);
  }

  100% {
    transform: rotate(0) translate(0, 0);
  }
}

/* FAB Redesign */
.fab-premium {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 100;
}

.fab-premium:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 12px 28px rgba(var(--primary-rgb), 0.6);
}

.fab-icon {
  width: 32px;
  height: 32px;
  stroke-width: 2.5;
}

/* @Mention Suggestions in Main Input */
.suggestion-dropdown {
  position: absolute;
  top: 110%;
  left: 2rem;
  right: 2rem;
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  padding: 0.5rem;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background 0.2s;
  color: var(--text-main);
}

.suggestion-item:hover {
  background: var(--surface-hover);
}

.suggestion-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
}


/* Contact Notes (Card-in-Card) */
.contact-notes {
  margin-top: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  line-height: 1.5;
}

.contact-notes .svg-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--primary);
  opacity: 0.8;
}

/* Premium Modal Close Button */
.close-modal-premium {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-modal-premium:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  transform: rotate(90deg);
}


/* =========================================
   VISCERAL REWARD SYSTEM
   ========================================= */

/* Screen Shake Animation */
@keyframes shake-hard {
  0% {
    transform: translate(1px, 1px) rotate(0deg);
  }

  10% {
    transform: translate(-1px, -2px) rotate(-1deg);
  }

  20% {
    transform: translate(-3px, 0px) rotate(1deg);
  }

  30% {
    transform: translate(3px, 2px) rotate(0deg);
  }

  40% {
    transform: translate(1px, -1px) rotate(1deg);
  }

  50% {
    transform: translate(-1px, 2px) rotate(-1deg);
  }

  60% {
    transform: translate(-3px, 1px) rotate(0deg);
  }

  70% {
    transform: translate(3px, 1px) rotate(-1deg);
  }

  80% {
    transform: translate(-1px, -1px) rotate(1deg);
  }

  90% {
    transform: translate(1px, 2px) rotate(0deg);
  }

  100% {
    transform: translate(1px, -2px) rotate(-1deg);
  }
}

.shake-effect {
  animation: shake-hard 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

/* Victory Overlay */
.victory-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.victory-overlay.show {
  opacity: 1;
  pointer-events: all;
}

/* Massive Victory Text */
.victory-text {
  font-family: 'Inter', sans-serif;
  /* Ensure bold font */
  font-weight: 900;
  font-size: 6rem;
  /* Massive */
  text-transform: uppercase;
  color: transparent;
  background: linear-gradient(135deg, #FFD700, #FDB931, #FFFFFF, #FDB931);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 0 30px rgba(253, 185, 49, 0.5), 0 0 60px rgba(253, 185, 49, 0.3);
  animation: victory-pop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards, shine 3s linear infinite;
  transform: scale(0.5);
  opacity: 0;
  text-align: center;
  line-height: 1.1;
  padding: 0 20px;
}

.victory-subtext {
  font-size: 2rem;
  color: #fff;
  margin-top: 1rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(20px);
  animation: slideUpFade 0.5s ease 0.4s forwards;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

@keyframes victory-pop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }

  70% {
    transform: scale(1.1);
    opacity: 1;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes shine {
  to {
    background-position: 200% center;
  }
}

@keyframes slideUpFade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Confetti Canvas z-index boost */
#confetti-canvas {
  z-index: 9998 !important;
}

/* ========================================
   Flatpickr Premium Customization
   ======================================== */
.flatpickr-calendar {
  background: rgba(15, 23, 42, 0.96) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(99, 102, 241, 0.3) !important;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset !important;
  font-family: 'Outfit', sans-serif !important;
  border-radius: 16px !important;
  padding: 14px !important;
  width: 320px !important;
  z-index: 99999 !important;
}

/* Hide default arrows */
.flatpickr-calendar.arrowTop:before,
.flatpickr-calendar.arrowTop:after,
.flatpickr-calendar.arrowBottom:before,
.flatpickr-calendar.arrowBottom:after {
  display: none !important;
}

/* Month Navigation */
.flatpickr-months {
  margin-bottom: 8px !important;
  padding: 0 !important;
  height: 36px !important;
  align-items: center !important;
}

.flatpickr-months .flatpickr-month {
  background: transparent !important;
  height: 36px !important;
  display: flex !important;
  align-items: center !important;
}

.flatpickr-current-month {
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  color: white !important;
  padding-top: 0 !important;
  height: 36px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
}

.flatpickr-current-month input.cur-year {
  font-weight: 700 !important;
  color: white !important;
  font-size: 1.1rem !important;
  background: rgba(99, 102, 241, 0.2) !important;
  border: 1px solid rgba(99, 102, 241, 0.3) !important;
  border-radius: 6px !important;
  padding: 4px 8px !important;
  height: 30px !important;
  width: 70px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.flatpickr-current-month input.cur-year:hover,
.flatpickr-current-month input.cur-year:focus {
  background: rgba(99, 102, 241, 0.3) !important;
  border-color: var(--primary) !important;
  outline: none !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
  background: rgba(99, 102, 241, 0.2) !important;
  border: 1px solid rgba(99, 102, 241, 0.3) !important;
  border-radius: 6px !important;
  color: white !important;
  font-weight: 600 !important;
  padding: 4px 8px !important;
  font-size: 1rem !important;
  height: 30px !important;
}

/* Navigation Buttons - Custom SVG */
.flatpickr-prev-month,
.flatpickr-next-month {
  padding: 0 !important;
  height: 30px !important;
  width: 30px !important;
  border-radius: 8px !important;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2)) !important;
  border: 1px solid rgba(99, 102, 241, 0.4) !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  top: 0 !important;
  position: relative !important;
  cursor: pointer !important;
}

.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
  background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
  border-color: transparent !important;
  transform: scale(1.1) !important;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4) !important;
}

.flatpickr-prev-month:active,
.flatpickr-next-month:active {
  transform: scale(0.95) !important;
}

/* Custom SVG Arrows */
.flatpickr-prev-month .nav-arrow,
.flatpickr-next-month .nav-arrow {
  width: 18px !important;
  height: 18px !important;
  stroke: white !important;
  transition: transform 0.2s ease !important;
}

.flatpickr-prev-month:hover .nav-arrow {
  transform: translateX(-2px) !important;
}

.flatpickr-next-month:hover .nav-arrow {
  transform: translateX(2px) !important;
}

/* Weekdays */
.flatpickr-weekdays {
  margin-bottom: 10px !important;
  background: transparent !important;
}

.flatpickr-weekday {
  color: rgba(255, 255, 255, 0.5) !important;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

/* Days Grid */
.flatpickr-days {
  width: 100% !important;
}

.dayContainer {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
}

.flatpickr-day {
  color: white !important;
  border-radius: 10px !important;
  height: 46px !important;
  line-height: 46px !important;
  font-size: 1rem !important;
  font-weight: 500 !important;
  margin: 2px !important;
  border: 2px solid transparent !important;
  transition: all 0.2s ease !important;
  max-width: none !important;
  flex-basis: calc(14.285% - 4px) !important;
}

.flatpickr-day:hover {
  background: rgba(99, 102, 241, 0.2) !important;
  border-color: rgba(99, 102, 241, 0.4) !important;
}

.flatpickr-day.today {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  font-weight: 700 !important;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
  border-color: transparent !important;
  color: white !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.5) !important;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
  color: rgba(255, 255, 255, 0.3) !important;
}

.flatpickr-day.flatpickr-disabled {
  color: rgba(255, 255, 255, 0.2) !important;
}

/* Time Picker */
.flatpickr-time {
  height: 40px !important;
  max-height: 40px !important;
  line-height: 40px !important;
  padding: 5px 14px !important;
  margin-top: 8px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: rgba(0, 0, 0, 0.1) !important;
  border-radius: 0 0 12px 12px !important;
  margin: 8px -14px -14px -14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
}

.flatpickr-time .numInputWrapper {
  height: 30px !important;
  flex: 0 0 70px !important;
  display: flex !important;
  align-items: center !important;
}

.flatpickr-time input {
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  color: white !important;
  background: rgba(99, 102, 241, 0.2) !important;
  border: 1px solid rgba(99, 102, 241, 0.3) !important;
  border-radius: 6px !important;
  height: 30px !important;
  width: 70px !important;
  padding: 4px 8px !important;
  text-align: center !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.flatpickr-time input:hover,
.flatpickr-time input:focus {
  background: rgba(99, 102, 241, 0.3) !important;
  border-color: var(--primary) !important;
  outline: none !important;
}

.flatpickr-time .flatpickr-time-separator {
  color: rgba(255, 255, 255, 0.6) !important;
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  line-height: 30px !important;
}

.flatpickr-time .numInputWrapper span.arrowUp,
.flatpickr-time .numInputWrapper span.arrowDown {
  border: none !important;
  background: rgba(99, 102, 241, 0.15) !important;
  opacity: 1 !important;
  right: 0 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.flatpickr-time .numInputWrapper span.arrowUp:hover,
.flatpickr-time .numInputWrapper span.arrowDown:hover {
  background: rgba(99, 102, 241, 0.4) !important;
}

.flatpickr-time .numInputWrapper span.arrowUp:after {
  border-bottom-color: white !important;
}

.flatpickr-time .numInputWrapper span.arrowDown:after {
  border-top-color: white !important;
}

/* Ensure modal doesn't clip */
.modal-content {
  overflow: visible !important;
}

#edit-task-modal .modal-body {
  overflow: visible !important;
}

/* ========================================
   Calendar Page Styles
   ======================================== */
.calendar-container {
  max-width: 900px;
}

/* Unified Calendar Toolbar */
.calendar-toolbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.toolbar-controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
}

.toolbar-section {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Navigation Section */
.toolbar-nav {
  background: var(--bg-app);
  border-radius: var(--radius-lg);
  padding: 0.25rem;
}

.toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.toolbar-btn:hover {
  background: var(--surface-hover);
  color: var(--primary);
}

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

.toolbar-today-btn {
  width: auto;
  padding: 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-main);
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.toolbar-today-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
}

/* Date Display */
.toolbar-date {
  justify-content: center;
}

.toolbar-date-text {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.calendar-overall-progress {
  margin-bottom: 2rem;
  padding: 1rem 1.5rem;
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
}

.global-progress-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: 100%;
}

.global-progress-bar-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.global-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-app);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.global-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.global-progress-text {
  font-size: 0.9rem;
  color: var(--text-main);
  font-weight: 600;
  white-space: nowrap;
}

.global-progress-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .global-progress-container {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .global-progress-bar-wrapper {
    width: 100%;
  }
}

/* View Selector */
.toolbar-views {
  background: var(--bg-app);
  border-radius: var(--radius-lg);
  padding: 0.25rem;
}

.toolbar-view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.toolbar-view-btn:hover {
  background: var(--surface-hover);
  color: var(--text-main);
}

.toolbar-view-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Responsive Toolbar */
@media (max-width: 600px) {
  .calendar-toolbar {
    padding: 0.5rem;
    gap: 0.5rem;
  }

  .toolbar-controls-row {
    gap: 0.5rem;
  }

  .toolbar-nav {
    padding: 0.15rem;
  }

  .toolbar-date-text {
    font-size: 1.15rem;
  }

  .toolbar-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
  }

  .toolbar-today-btn {
    padding: 0 0.5rem;
    font-size: 0.7rem;
  }

  .toolbar-view-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
  }

  .toolbar-views {
    gap: 0.15rem;
  }
}

.calendar-card {
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.calendar-weekday {
  text-align: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0.5rem;
}

.calendar-weekday.weekend {
  color: var(--primary);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
}

.calendar-day {
  min-height: 100px;
  background: var(--bg-app);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.day-progress-text {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  background: var(--surface-hover);
  padding: 1px 4px;
  border-radius: 4px;
}

.day-progress-bar {
  width: 100%;
  height: 3px;
  background: var(--border-color);
  border-radius: 2px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.day-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.3s ease;
}

.calendar-day:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
  transform: translateY(-2px);
  z-index: 2;
  box-shadow: var(--shadow-md);
}

.calendar-day.empty,
.calendar-day.other-month {
  background: transparent;
  cursor: default;
  border-color: transparent;
  opacity: 0.4;
}

.calendar-day.other-month .day-events,
.calendar-day.other-month .day-progress-bar,
.calendar-day.other-month .day-progress-text {
  display: none;
}

.calendar-day.empty:hover,
.calendar-day.other-month:hover {
  transform: none;
  box-shadow: none;
  border-color: transparent;
}

.calendar-day.today {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.15));
  border-color: var(--primary);
}

.calendar-day.today .day-number {
  background: var(--primary);
  color: white;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-day.weekend {
  background: rgba(99, 102, 241, 0.05);
}

.calendar-day.has-events {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(6, 182, 212, 0.08));
}

.calendar-day.all-completed {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
}

.day-number {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-main);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.day-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow: hidden;
}

.day-event {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 4px;
  font-size: 0.7rem;
  overflow: hidden;
}

.day-event.completed {
  opacity: 0.5;
  text-decoration: line-through;
}

.event-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.event-dot.completed {
  background: var(--success);
}

.event-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
  flex: 1;
}

/* Recurrence icon in calendar events */
.event-recurrence-icon {
  width: 10px;
  height: 10px;
  stroke: var(--primary);
  flex-shrink: 0;
  animation: spin 3s linear infinite;
  margin-left: 2px;
}

.day-event.recurring {
  background: rgba(99, 102, 241, 0.15);
  border-left: 2px solid var(--primary);
}

/* Virtual (Recurring Preview) Events */
.day-event.virtual,
.event-item.virtual {
  opacity: 0.7;
  border-left-style: dashed;
  background: rgba(var(--primary-rgb), 0.05);
}

.day-event.virtual:hover,
.event-item.virtual:hover {
  opacity: 0.9;
  background: rgba(var(--primary-rgb), 0.1);
}

/* Recurrence icon in upcoming task titles */
.title-recurrence-icon {
  width: 14px;
  height: 14px;
  stroke: var(--primary);
  display: inline-block;
  vertical-align: middle;
  margin-left: 4px;
  animation: spin 3s linear infinite;
}

.more-events {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  padding: 2px;
}

/* Day View Styles */
.calendar-grid.day-view {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.calendar-grid.day-view .day-view-header {
  text-align: center;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(6, 182, 212, 0.1));
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
}

.calendar-grid.day-view .day-view-date {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.calendar-grid.day-view .day-view-weekday {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.calendar-grid.day-view .day-task-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-app);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary);
  transition: all 0.2s ease;
}

.calendar-grid.day-view .day-task-item:hover {
  transform: translateX(4px);
  background: var(--surface-hover);
}

.calendar-grid.day-view .day-task-item.completed {
  opacity: 0.6;
  border-left-color: var(--success);
}

.calendar-grid.day-view .day-task-time {
  font-weight: 600;
  color: var(--primary);
  min-width: 50px;
}

.calendar-grid.day-view .day-task-title {
  flex: 1;
}

.calendar-grid.day-view .day-task-title.completed {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Week View Styles */
.calendar-weekdays.week-view,
.calendar-weekdays.workweek-view {
  grid-template-columns: repeat(7, 1fr);
}

.calendar-weekdays.workweek-view {
  grid-template-columns: repeat(5, 1fr);
}

.calendar-grid.week-view {
  grid-template-columns: repeat(7, 1fr);
}

.calendar-grid.workweek-view {
  grid-template-columns: repeat(5, 1fr);
}

.calendar-grid.week-view .calendar-day,
.calendar-grid.workweek-view .calendar-day {
  min-height: 150px;
}

/* Responsive view toggle */
@media (max-width: 768px) {
  .calendar-view-toggle {
    gap: 0.125rem;
  }

  .view-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }

  .view-btn-icon {
    width: 14px;
    height: 14px;
  }

  .view-btn span {
    display: none;
  }

  /* Mobile calendar - compact height */
  .calendar-grid {
    gap: 0.15rem;
  }

  .calendar-day {
    min-height: 55px;
    padding: 0.25rem;
    gap: 0.15rem;
  }

  .day-number {
    font-size: 0.85rem;
  }

  .day-header {
    margin-bottom: 0.1rem;
  }

  .day-progress-text {
    font-size: 0.55rem;
    padding: 0 3px;
  }

  .day-progress-bar {
    height: 2px;
    margin-bottom: 0.25rem;
  }

  /* Hide event titles on mobile, show only dots */
  .day-events {
    gap: 2px;
  }

  .day-event {
    padding: 2px 4px;
    font-size: 0;
    min-height: 14px;
  }

  .day-event .event-dot {
    width: 6px;
    height: 6px;
    min-width: 6px;
  }

  .day-event .event-title {
    display: none;
  }

  .day-event .event-recurrence-icon {
    width: 8px;
    height: 8px;
  }

  .more-events {
    font-size: 0.6rem;
  }

  /* Compact weekday headers */
  .calendar-weekday {
    font-size: 0.7rem;
    padding: 0.35rem;
  }

  /* Calendar card styling */
  .calendar-card {
    padding: 0.5rem;
  }

  /* Toolbar compact */
  .calendar-toolbar {
    padding: 0.5rem;
    gap: 0.5rem;
  }

  .toolbar-date-text {
    font-size: 1rem;
  }
}

/* Upcoming Section */
.upcoming-section {
  margin-top: 1rem;
  padding-bottom: 4rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.upcoming-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.upcoming-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.upcoming-header h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.upcoming-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.upcoming-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.upcoming-card.completed {
  opacity: 0.6;
}

.upcoming-card.completed .upcoming-title {
  text-decoration: line-through;
}

.upcoming-card.overdue {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.05);
}

/* Edit button for calendar tasks */
.btn-edit-calendar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0;
}

.upcoming-card:hover .btn-edit-calendar {
  opacity: 1;
}

.btn-edit-calendar:hover {
  background: var(--surface-hover);
  color: var(--primary);
}

/* Notes preview in calendar */
.upcoming-notes-preview {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upcoming-card-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.upcoming-checkbox {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  color: transparent;
}

.upcoming-checkbox:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.upcoming-checkbox.checked {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.upcoming-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.upcoming-title {
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upcoming-group {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.upcoming-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  flex-shrink: 0;
}

.upcoming-date {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-main);
  padding: 0.25rem 0.5rem;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 4px;
}

.upcoming-date.today {
  background: var(--primary);
  color: white;
}

.upcoming-date.overdue {
  background: var(--danger);
  color: white;
}

.upcoming-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.no-events {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.no-events-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
}

.no-events p {
  margin-bottom: 0.5rem;
}

.text-muted {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Responsive Calendar */
@media (max-width: 768px) {
  .calendar-day {
    min-height: 60px;
    padding: 0.25rem;
  }

  .day-events {
    display: none;
  }

  .calendar-day.has-events::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    margin: 0 auto;
  }

  .calendar-month-title {
    font-size: 1.25rem;
    min-width: 150px;
  }

  .upcoming-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .upcoming-card-right {
    flex-direction: row;
    gap: 0.75rem;
    width: 100%;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
  }
}

/* ========================================
   Animated SVG Icons for Calendar
   ======================================== */

/* Button with SVG icon */
.btn-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-svg-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Title Icons */
.title-icon {
  width: 40px;
  height: 40px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.5rem;
  stroke: var(--primary);
}

.section-title-icon {
  width: 24px;
  height: 24px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.5rem;
  stroke: var(--primary);
}

/* Calendar Icon - Static dots */
.calendar-icon-animated .calendar-dot {
  fill: var(--primary);
  stroke: none;
}

/* List Icon Animation - Lines sliding in */
.list-icon-animated .list-line {
  stroke-dasharray: 13;
  stroke-dashoffset: 13;
  animation: lineSlideIn 0.6s ease-out forwards;
}

.list-icon-animated .line-2 {
  animation-delay: 0.1s;
}

.list-icon-animated .line-3 {
  animation-delay: 0.2s;
}

.list-icon-animated .list-dot {
  fill: var(--primary);
  stroke: none;
  animation: dotFadeIn 0.4s ease-out forwards;
  opacity: 0;
}

.list-icon-animated .dot-1 {
  animation-delay: 0.3s;
}

.list-icon-animated .dot-2 {
  animation-delay: 0.4s;
}

.list-icon-animated .dot-3 {
  animation-delay: 0.5s;
}

@keyframes lineSlideIn {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes dotFadeIn {
  to {
    opacity: 1;
  }
}

/* Clock Icon Animation */
.clock-animated {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: middle;
}

.clock-animated .clock-hands {
  transform-origin: 12px 12px;
  animation: clockTick 3s steps(12) infinite;
}

@keyframes clockTick {
  to {
    transform: rotate(360deg);
  }
}

/* Folder Icon */
.folder-icon {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: middle;
}

/* Sparkle Animation for No Events */
.no-events-svg {
  width: 64px;
  height: 64px;
  stroke: var(--primary);
  margin-bottom: 1rem;
}

.sparkle-animated .sparkle-1 {
  fill: var(--primary);
  stroke: none;
  animation: sparkleGlow 2s ease-in-out infinite;
}

.sparkle-animated .sparkle-2 {
  fill: var(--accent);
  stroke: none;
  animation: sparkleGlow 2s ease-in-out infinite 0.5s;
}

.sparkle-animated .sparkle-3 {
  fill: var(--secondary);
  stroke: none;
  animation: sparkleGlow 2s ease-in-out infinite 1s;
}

@keyframes sparkleGlow {

  0%,
  100% {
    opacity: 0.4;
    transform: scale(0.8);
  }

  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* Inline Icon Base */
.inline-icon {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
}

/* Toast Icons */
.toast.glass-toast {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast-icon.success-icon {
  stroke: var(--success);
}

.toast-icon.success-icon .check-mark {
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
  animation: checkDraw 0.4s ease-out forwards 0.2s;
}

.toast-icon.success-icon .check-circle {
  stroke-dasharray: 63;
  stroke-dashoffset: 63;
  animation: circleDraw 0.4s ease-out forwards;
}

@keyframes checkDraw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes circleDraw {
  to {
    stroke-dashoffset: 0;
  }
}

.toast-icon.error-icon {
  stroke: var(--danger);
}

.toast-icon.refresh-icon {
  stroke: var(--accent);
  animation: refreshSpin 0.6s ease-out;
}

@keyframes refreshSpin {
  from {
    transform: rotate(-180deg);
  }

  to {
    transform: rotate(0deg);
  }
}

/* Profile SVG */
.profile-svg {
  width: 100%;
  height: 100%;
  stroke: var(--text-muted);
}

/* Upcoming group with icon */
.upcoming-group {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.upcoming-group .inline-icon,
.upcoming-group .folder-icon {
  width: 12px;
  height: 12px;
}

/* Upcoming time with icon */
.upcoming-time {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.upcoming-time .inline-icon,
.upcoming-time .clock-animated {
  width: 12px;
  height: 12px;
}

/* ========================================
   Mobile Navigation System
   ======================================== */

/* Hamburger Button */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: background 0.2s ease;
}

.mobile-menu-btn:hover {
  background: var(--surface-hover);
}

.hamburger {
  width: 24px;
  height: 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

/* Hamburger → X Animation */
.mobile-menu-btn.active .hamburger span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.mobile-menu-btn.active .hamburger span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mobile-menu-btn.active .hamburger span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Mobile Navigation Panel */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  right: -100%;
  width: min(320px, 85vw);
  height: 100vh;
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid var(--border-color);
  z-index: 1000;
  padding: 5rem 1.5rem 2rem;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-nav.active {
  right: 0;
}

/* Mobile Nav Close Button */
.mobile-nav-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
}

.mobile-nav-close:hover {
  background: var(--danger);
  border-color: var(--danger);
  transform: rotate(90deg) scale(1.1);
}

.mobile-nav-close:hover .close-icon-animated {
  stroke: white;
}

.mobile-nav-close:active {
  transform: rotate(90deg) scale(0.95);
}

.close-icon-animated {
  width: 20px;
  height: 20px;
  stroke: var(--text-main);
  transition: stroke 0.2s ease;
}

.close-line {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: drawLine 0.4s ease-out forwards;
}

.close-line-1 {
  animation-delay: 0.1s;
}

.close-line-2 {
  animation-delay: 0.2s;
}

@keyframes drawLine {
  to {
    stroke-dashoffset: 0;
  }
}

/* Reset animation when nav is not active */
.mobile-nav:not(.active) .close-line {
  animation: none;
  stroke-dashoffset: 24;
}

/* Mobile Nav Items */
.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.mobile-nav-item:hover {
  background: var(--surface-hover);
  transform: translateX(-4px);
  border-color: var(--primary);
}

.mobile-nav-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.1));
  border-color: var(--primary);
  color: var(--primary);
}

.mobile-nav-item svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  flex-shrink: 0;
}

.mobile-nav-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.75rem 0;
}

.mobile-nav-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.5rem 1.25rem;
  margin-top: 0.5rem;
}

/* Mobile user info in nav */
.mobile-nav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-lg);
  color: white;
  margin-bottom: 1rem;
}

.mobile-nav-user .avatar-placeholder {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.mobile-nav-user-info {
  flex: 1;
  min-width: 0;
}

.mobile-nav-user-email {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-nav-user-label {
  font-size: 0.7rem;
  opacity: 0.8;
}

/* Mobile Theme Toggle */
#mobile-theme-toggle {
  justify-content: flex-start;
}

#mobile-theme-toggle .mobile-theme-icon-sun,
#mobile-theme-toggle .mobile-theme-icon-moon {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

[data-theme="dark"] #mobile-theme-toggle .mobile-theme-icon-sun {
  display: none !important;
}

[data-theme="dark"] #mobile-theme-toggle .mobile-theme-icon-moon {
  display: block !important;
}

[data-theme="light"] #mobile-theme-toggle .mobile-theme-icon-sun,
:root:not([data-theme]) #mobile-theme-toggle .mobile-theme-icon-sun {
  display: block !important;
}

[data-theme="light"] #mobile-theme-toggle .mobile-theme-icon-moon,
:root:not([data-theme]) #mobile-theme-toggle .mobile-theme-icon-moon {
  display: none !important;
}

/* ========================================
   Celebration Animations (All Tasks Done)
   ======================================== */

.tasks-empty-celebration {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
  animation: fadeInUp 0.6s ease-out;
}

.celebration-icon {
  width: 120px;
  height: 120px;
  margin-bottom: 1.5rem;
  animation: celebrationBounce 1s ease-out;
  overflow: visible;
}

.celebration-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

.celebration-subtext {
  font-size: 0.9rem;
  color: var(--text-muted);
  animation: fadeInUp 0.6s ease-out 0.4s both;
}

@keyframes celebrationBounce {
  0% {
    transform: scale(0) rotate(-10deg);
    opacity: 0;
  }

  50% {
    transform: scale(1.2) rotate(5deg);
  }

  70% {
    transform: scale(0.9) rotate(-3deg);
  }

  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Trophy Animation */
.celebration-trophy {
  animation: celebrationBounce 1s ease-out, trophyShine 2s ease-in-out infinite 1s;
}

.celebration-trophy .sparkle {
  animation: sparkle 1.5s ease-in-out infinite;
}

.celebration-trophy .sparkle-1 {
  animation-delay: 0s;
}

.celebration-trophy .sparkle-2 {
  animation-delay: 0.5s;
}

.celebration-trophy .sparkle-3 {
  animation-delay: 1s;
}

@keyframes trophyShine {

  0%,
  100% {
    filter: brightness(1);
  }

  50% {
    filter: brightness(1.2);
  }
}

@keyframes sparkle {

  0%,
  100% {
    opacity: 0;
    transform: scale(0);
  }

  50% {
    opacity: 1;
    transform: scale(1.5);
  }
}

/* Rocket Animation */
.celebration-rocket {
  animation: celebrationBounce 1s ease-out, rocketFloat 3s ease-in-out infinite 1s;
}

.celebration-rocket .flame {
  animation: flameFlicker 0.15s ease-in-out infinite alternate;
  transform-origin: center top;
}

.celebration-rocket .flame-inner {
  animation: flameFlicker 0.1s ease-in-out infinite alternate-reverse;
}

.celebration-rocket .star {
  animation: starTwinkle 2s ease-in-out infinite;
}

.celebration-rocket .star-1 {
  animation-delay: 0s;
}

.celebration-rocket .star-2 {
  animation-delay: 0.7s;
}

.celebration-rocket .star-3 {
  animation-delay: 1.4s;
}

@keyframes rocketFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes flameFlicker {
  from {
    transform: scaleY(1) scaleX(1);
  }

  to {
    transform: scaleY(1.15) scaleX(0.9);
  }
}

@keyframes starTwinkle {

  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }

  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* Star Animation */
.celebration-star {
  animation: celebrationBounce 1s ease-out, starPulse 2s ease-in-out infinite 1s;
}

.celebration-star .main-star {
  transform-origin: center;
}

.celebration-star .burst-1 {
  animation: burstSpin 8s linear infinite;
}

.celebration-star .burst-2 {
  animation: burstSpin 6s linear infinite reverse;
}

.celebration-star .mini-star {
  animation: miniStarFloat 2s ease-in-out infinite;
}

.celebration-star .mini-star-1 {
  animation-delay: 0s;
}

.celebration-star .mini-star-2 {
  animation-delay: 0.5s;
}

.celebration-star .mini-star-3 {
  animation-delay: 1s;
}

.celebration-star .mini-star-4 {
  animation-delay: 1.5s;
}

@keyframes starPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

@keyframes burstSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes miniStarFloat {

  0%,
  100% {
    opacity: 0.5;
    transform: translateY(0);
  }

  50% {
    opacity: 1;
    transform: translateY(-5px);
  }
}

/* Check Animation */
.celebration-check {
  animation: celebrationBounce 1s ease-out;
}

.celebration-check .checkmark {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: drawCheck 0.8s ease-out 0.5s forwards;
}

.celebration-check .check-ring {
  animation: ringPulse 1.5s ease-out infinite 1s;
}

.celebration-check .particle {
  animation: particleFly 2s ease-out infinite;
}

.celebration-check .particle-1 {
  animation-delay: 0s;
}

.celebration-check .particle-2 {
  animation-delay: 0.3s;
}

.celebration-check .particle-3 {
  animation-delay: 0.6s;
}

.celebration-check .particle-4 {
  animation-delay: 0.9s;
}

.celebration-check .particle-5 {
  animation-delay: 1.2s;
}

@keyframes drawCheck {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes ringPulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

@keyframes particleFly {

  0%,
  100% {
    opacity: 0.3;
    transform: translate(0, 0) scale(1);
  }

  50% {
    opacity: 1;
    transform: translate(var(--tx, 5px), var(--ty, -5px)) scale(1.3);
  }
}

.celebration-check .particle-1 {
  --tx: -8px;
  --ty: -10px;
}

.celebration-check .particle-2 {
  --tx: 10px;
  --ty: -12px;
}

.celebration-check .particle-3 {
  --tx: -12px;
  --ty: 8px;
}

.celebration-check .particle-4 {
  --tx: 8px;
  --ty: 10px;
}

.celebration-check .particle-5 {
  --tx: 0px;
  --ty: -15px;
}

/* Party Animation */
.celebration-party {
  animation: celebrationBounce 1s ease-out;
}

.celebration-party .confetti {
  animation: confettiFall 2s ease-in-out infinite;
}

.celebration-party .confetti-1 {
  animation-delay: 0s;
}

.celebration-party .confetti-2 {
  animation-delay: 0.2s;
}

.celebration-party .confetti-3 {
  animation-delay: 0.4s;
}

.celebration-party .confetti-4 {
  animation-delay: 0.6s;
}

.celebration-party .confetti-5 {
  animation-delay: 0.8s;
}

.celebration-party .confetti-6 {
  animation-delay: 1s;
}

.celebration-party .confetti-7 {
  animation-delay: 1.2s;
}

.celebration-party .streamer {
  animation: streamerWave 1s ease-in-out infinite alternate;
}

.celebration-party .streamer-1 {
  animation-delay: 0s;
}

.celebration-party .streamer-2 {
  animation-delay: 0.3s;
}

.celebration-party .popper {
  transform-origin: bottom left;
  animation: popperShake 0.5s ease-in-out infinite alternate 1s;
}

@keyframes confettiFall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateY(20px) rotate(180deg);
  }
}

@keyframes streamerWave {
  from {
    transform: translateX(-2px);
  }

  to {
    transform: translateX(2px);
  }
}

@keyframes popperShake {
  from {
    transform: rotate(-3deg);
  }

  to {
    transform: rotate(3deg);
  }
}

/* ========================================
   Mobile Responsive Breakpoints
   ======================================== */

@media (max-width: 768px) {

  /* Show mobile elements */
  .mobile-menu-btn,
  .mobile-nav-overlay,
  .mobile-nav {
    display: flex;
  }

  /* Hide desktop nav buttons */
  .header-actions .btn.btn-secondary.btn-with-icon {
    display: none;
  }

  /* Hide desktop theme toggle on mobile (it's now in mobile nav) */
  .header-actions .theme-toggle-wrapper {
    display: none;
  }

  /* Adjust header */
  .header-content {
    gap: 0.5rem;
  }

  .logo-img {
    width: 48px;
    height: 48px;
  }

  .logo-text {
    font-size: 1rem;
  }

  /* Theme toggle stays visible but smaller */
  .theme-toggle-wrapper {
    order: -1;
  }

  .theme-toggle-label {
    width: 48px;
    height: 26px;
  }

  /* User profile compact */
  .user-profile {
    padding: 0.25rem;
  }

  .user-profile>svg {
    display: none;
  }

  /* Header section improvements on mobile */
  .heading-section {
    margin-bottom: 1.75rem;
    text-align: center;
  }

  .greeting-title {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
  }

  .greeting-subtitle {
    text-align: center;
    margin-bottom: 1rem;
  }

  .filter-section h2 {
    text-align: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }

  .floating-input-card {
    margin-bottom: 1.5rem;
  }

  /* Calendar improvements */
  .calendar-weekdays {
    font-size: 0.7rem;
  }

  .calendar-day {
    min-height: 60px;
    padding: 0.25rem;
  }

  .day-number {
    font-size: 0.75rem;
  }

  .day-event {
    font-size: 0.6rem;
    padding: 0.15rem 0.3rem;
  }

  .event-title {
    max-width: 50px;
  }

  /* Calendar toolbar */
  .calendar-toolbar {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem;
  }

  .toolbar-view-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.7rem;
  }

  .calendar-nav {
    gap: 0.25rem;
  }

  .btn-nav {
    width: 36px;
    height: 36px;
  }

  #current-month {
    font-size: 1rem;
    min-width: 140px;
  }

  /* Upcoming sidebar */
  .calendar-layout {
    flex-direction: column;
  }

  .upcoming-sidebar {
    width: 100%;
    max-width: none;
    border-left: none;
    border-top: 1px solid var(--border-color);
    max-height: 300px;
  }

  /* Filter section - keep on same row */
  .filter-controls-wrapper {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: space-between;
  }

  .filter-toggle {
    flex: 1;
    min-width: 0;
  }

  .view-toggle {
    flex-shrink: 0;
  }

  .task-progress {
    width: 100%;
    order: 3;
    text-align: center;
    font-size: 0.85rem;
  }

  /* Tasks grid - Mobile Grid View - Compact Card Layout */
  .tasks-grid {
    gap: 0.75rem;
    grid-template-columns: repeat(2, 1fr);
  }

  /* Mobile Grid Card Style - Compact Cards in 2-Column Grid */
  .tasks-grid:not(.list-view) .task-card {
    flex-direction: column;
    text-align: left;
    padding: 1rem;
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    min-height: 120px;
    max-height: 180px;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
  }

  .tasks-grid:not(.list-view) .task-checkbox {
    margin-bottom: 0;
    align-self: flex-start;
    transform: scale(1);
  }

  .tasks-grid:not(.list-view) .task-content {
    width: 100%;
    margin-bottom: 0;
    flex: 1;
    overflow: hidden;
  }

  .tasks-grid:not(.list-view) .task-title {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-right: 0;
  }

  .tasks-grid:not(.list-view) .task-meta {
    margin-top: 0.25rem;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: flex-start;
    font-size: 0.7rem;
  }

  .tasks-grid:not(.list-view) .task-meta .task-tag {
    font-size: 0.6rem;
    padding: 0.15rem 0.4rem;
  }

  .tasks-grid:not(.list-view) .task-meta .due-date-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.35rem;
  }

  .tasks-grid:not(.list-view) .task-meta .due-date-badge svg {
    width: 10px;
    height: 10px;
  }

  /* Mobile Grid - Position buttons directly in top-right corner */
  /* Note: Buttons are direct children of .task-card, not wrapped in .task-actions */
  .tasks-grid:not(.list-view) .btn-edit-task {
    position: absolute;
    top: 0.5rem;
    right: 2.25rem;
  }

  .tasks-grid:not(.list-view) .btn-delete-task {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
  }


  .task-card {
    padding: 0.875rem;
    min-height: 70px;
    display: flex;
    flex-direction: column;
  }

  .task-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .task-title {
    font-size: 0.95rem;
    line-height: 1.3;
    -webkit-line-clamp: 2;
  }

  .task-meta {
    font-size: 0.8rem;
    margin-top: 0.25rem;
  }

  .task-actions {
    flex-shrink: 0;
  }

  /* Due date badge compact */
  .due-date-badge {
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
  }

  .due-date-badge svg {
    width: 12px;
    height: 12px;
  }

  /* LIST VIEW - Force horizontal layout on mobile */
  .tasks-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .tasks-grid.list-view .task-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    min-height: auto;
  }

  .tasks-grid.list-view .task-checkbox {
    flex-shrink: 0;
  }

  .tasks-grid.list-view .task-content {
    display: flex !important;
    flex-direction: column !important;
    flex: 1;
    min-width: 0;
    gap: 0.25rem;
  }

  .tasks-grid.list-view .task-title {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0;
  }

  .tasks-grid.list-view .task-meta {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.75rem;
    margin-top: 0;
  }

  .tasks-grid.list-view .task-actions {
    display: flex;
    flex-direction: row;
    gap: 0.25rem;
    flex-shrink: 0;
  }

  .tasks-grid.list-view .btn-edit-task,
  .tasks-grid.list-view .btn-delete-task {
    width: 32px;
    height: 32px;
    padding: 0.25rem;
  }



  /* GRID VIEW - Compact Buttons in Top Right Corner */
  .tasks-grid:not(.list-view) .btn-edit-task,
  .tasks-grid:not(.list-view) .btn-delete-task {
    position: absolute !important;
    opacity: 1 !important;
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 0;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    top: 0.5rem;
    transition: all 0.2s ease;
    transform: scale(1);
  }

  .tasks-grid:not(.list-view) .btn-edit-task {
    right: 2.75rem;
  }

  .tasks-grid:not(.list-view) .btn-delete-task {
    right: 0.5rem;
  }

  /* Hover animations for mobile grid buttons */
  .tasks-grid:not(.list-view) .btn-edit-task:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary);
    color: var(--primary);
    transform: scale(1.1);
  }

  .tasks-grid:not(.list-view) .btn-delete-task:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--danger);
    color: var(--danger);
    transform: scale(1.1);
  }

  [data-theme="dark"] .tasks-grid:not(.list-view) .btn-edit-task,
  [data-theme="dark"] .tasks-grid:not(.list-view) .btn-delete-task {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
  }

  [data-theme="dark"] .tasks-grid:not(.list-view) .btn-edit-task:hover {
    background: rgba(99, 102, 241, 0.25);
  }

  [data-theme="dark"] .tasks-grid:not(.list-view) .btn-delete-task:hover {
    background: rgba(239, 68, 68, 0.25);
  }

  .tasks-grid:not(.list-view) .btn-edit-task svg,
  .tasks-grid:not(.list-view) .btn-delete-task svg {
    width: 14px;
    height: 14px;
    stroke-width: 2;
  }

  /* Prevent body scroll when mobile nav open */
  body.mobile-nav-open {
    overflow: hidden;
  }
}

/* Extra small phones */
@media (max-width: 480px) {
  .logo-text {
    display: none;
  }

  .greeting-title {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    line-height: 1.2;
  }

  .greeting-subtitle {
    font-size: 0.85rem;
    margin-bottom: 1rem;
    text-align: center;
  }

  .heading-section {
    margin-bottom: 1.5rem;
    text-align: center;
  }

  /* Single column grid on very small phones */
  .tasks-grid {
    grid-template-columns: 1fr;
  }

  .tasks-grid:not(.list-view) .task-card {
    min-height: auto;
    max-height: none;
  }

  /* Section title "Was steht heute an?" */
  .filter-section h2,
  .section-title {
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 1rem;
  }

  /* Floating input card */
  .floating-input-card {
    margin-bottom: 1.25rem;
  }

  .calendar-day {
    min-height: 50px;
  }

  .day-events {
    display: none;
  }

  .day-header {
    justify-content: center;
  }

  .day-progress-text {
    display: none;
  }

  /* Stacked modal actions */
  .modal-actions {
    flex-direction: column;
  }

  .modal-actions .btn {
    width: 100%;
  }

  /* Compact cards */
  .upcoming-card {
    padding: 0.75rem;
  }

  .upcoming-title {
    font-size: 0.9rem;
  }
}

/* Landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
  .mobile-nav {
    padding-top: 3rem;
  }

  .mobile-nav-item {
    padding: 0.75rem 1rem;
  }

  .dashboard-main {
    padding-top: 1.5rem;
  }
}

/* ========================================
   Legal Pages (Datenschutz, Impressum)
   ======================================== */

.legal-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-app);
}

.legal-header {
  padding: 1.5rem 2rem;
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}

.legal-header .logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
}

.legal-header .logo-img {
  width: 40px;
  height: 40px;
}

.legal-header .logo-text {
  font-size: 1.25rem;
  font-weight: 700;
}

.legal-content {
  flex: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 2rem;
  width: 100%;
}

.legal-content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.legal-updated {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.legal-intro {
  color: var(--text-main);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 2.5rem;
  padding: 1.25rem;
  background: var(--surface-hover);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--primary);
}

/* ========================================
   Contact Page
   ======================================== */

.contact-main {
  padding: 3rem 1.5rem;
}

.contact-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.contact-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.contact-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.contact-card {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin-bottom: 2rem;
}

.contact-form .form-group {
  margin-bottom: 1.5rem;
}

.contact-form label {
  display: block;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.contact-form .input-wrapper {
  position: relative;
}

.contact-form .input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 20px;
  height: 20px;
}

.contact-form input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 3rem;
  background: var(--surface-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-main);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.contact-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.contact-form .textarea-wrapper .input-icon {
  display: none;
}

.contact-form textarea {
  width: 100%;
  padding: 1rem;
  background: var(--surface-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-main);
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  min-height: 120px;
  transition: all 0.2s ease;
}

.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.contact-form .form-error {
  color: var(--danger);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  min-height: 1.25rem;
}

.contact-form .form-success {
  color: var(--success);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  min-height: 1.25rem;
}

.contact-form .btn-block {
  width: 100%;
  justify-content: center;
}

.contact-info {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.contact-email-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  margin-top: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
}

.contact-email-link:hover {
  background: rgba(99, 102, 241, 0.1);
}

.contact-email-link svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 768px) {
  .contact-header h1 {
    font-size: 1.75rem;
  }

  .contact-card {
    padding: 1.5rem;
  }
}

.legal-content section {
  margin-bottom: 2.5rem;
}

.legal-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
}

.legal-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.legal-content p {
  color: var(--text-main);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.legal-content ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.legal-content li {
  color: var(--text-main);
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

.legal-content a {
  color: var(--primary);
  text-decoration: underline;
}

.legal-content a:hover {
  color: var(--primary-dark);
}

.legal-content code {
  background: var(--surface-hover);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
}

/* Cookie Table */
.cookie-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95rem;
}

.cookie-table th,
.cookie-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border: 1px solid var(--border-color);
}

.cookie-table th {
  background: var(--surface-hover);
  font-weight: 600;
  color: var(--text-main);
}

.cookie-table td {
  background: var(--surface-card);
  color: var(--text-main);
}

.cookie-table code {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
}

/* Legal Footer */
.legal-footer {
  padding: 2rem;
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--primary);
}

.legal-footer p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
}

/* Dashboard Footer with Legal Links */
.dashboard-footer {
  padding: 1.5rem 2rem;
  text-align: center;
  margin-top: 2rem;
}

.dashboard-footer .footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

.dashboard-footer .footer-divider {
  color: var(--text-light);
  font-size: 0.8rem;
}

/* ========================================
   Logged-in User Banner (Landing Page)
   ======================================== */

.logged-in-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin: 1rem auto 2rem;
  max-width: 700px;
  animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.logged-in-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.logged-in-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-main);
  font-size: 0.95rem;
}

.logged-in-info svg {
  color: var(--success);
  flex-shrink: 0;
}

.logged-in-email {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.logged-in-email:hover {
  background: rgba(99, 102, 241, 0.15);
  text-decoration: underline;
}



.btn-primary-sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--primary);
  color: white;
  border: 1px solid var(--primary);
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.btn-primary-sm:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .logged-in-banner {
    margin: 0.75rem 1rem 1.5rem;
    padding: 1rem;
  }

  .logged-in-banner-content {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .logged-in-info {
    flex-direction: column;
    gap: 0.5rem;
  }

  .logged-in-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ========================================
   Cookie Consent Overlay (Blocking)
   ======================================== */

.cookie-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.cookie-overlay.show {
  opacity: 1;
  visibility: visible;
}

.cookie-modal {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cookie-overlay.show .cookie-modal {
  transform: scale(1) translateY(0);
}

.cookie-modal-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cookie-modal-icon svg {
  width: 36px;
  height: 36px;
  color: white;
}

.cookie-modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 1rem;
}

.cookie-modal-text {
  margin-bottom: 2rem;
}

.cookie-modal-text p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0 0 0.75rem;
}

.cookie-modal-text p:last-child {
  margin-bottom: 0;
}

.cookie-modal-text a {
  color: var(--primary);
  text-decoration: underline;
  font-weight: 500;
}

.cookie-modal-text a:hover {
  color: var(--primary-dark);
}

.cookie-btn {
  padding: 1rem 2rem;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.cookie-btn-accept {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  width: 100%;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.cookie-btn-accept svg {
  width: 20px;
  height: 20px;
}

.cookie-btn-accept:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

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

/* Mobile Cookie Overlay */
@media (max-width: 768px) {
  .cookie-overlay {
    padding: 1rem;
  }

  .cookie-modal {
    padding: 2rem 1.5rem;
  }

  .cookie-modal-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1.25rem;
  }

  .cookie-modal-icon svg {
    width: 30px;
    height: 30px;
  }

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

  .cookie-modal-text p {
    font-size: 0.9rem;
  }

  .cookie-btn {
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
  }

  /* Legal page mobile */
  .legal-content {
    padding: 2rem 1.25rem;
  }

  .legal-content h1 {
    font-size: 1.75rem;
  }

  .legal-content h2 {
    font-size: 1.25rem;
  }

  .footer-links {
    gap: 1rem;
    flex-wrap: wrap;
  }

  .cookie-table {
    font-size: 0.8rem;
  }

  .cookie-table th,
  .cookie-table td {
    padding: 0.5rem;
  }
}

/* ========================================
   Cookie Banner (Non-blocking - for legal pages)
   ======================================== */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  padding: 1.25rem 2rem;
  z-index: 9999;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-banner.show {
  transform: translateY(0);
}

.cookie-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.cookie-banner-text {
  flex: 1;
}

.cookie-banner-text p {
  color: var(--text-main);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
}

.cookie-banner-actions {
  flex-shrink: 0;
}

/* Mobile Cookie Banner */
@media (max-width: 768px) {
  .cookie-banner {
    padding: 1rem 1.25rem;
  }

  .cookie-banner-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .cookie-banner-text p {
    font-size: 0.85rem;
  }

  .cookie-banner-actions {
    width: 100%;
  }

  .cookie-banner-actions .cookie-btn {
    width: 100%;
  }
}