/* ==========================================
   SPACE-THEMED TASK MANAGER
   Clean, functional, subtle aesthetics
   ========================================== */

:root {
  /* Space theme colors - deep and muted */
  --space-bg: #0a0e27;
  --space-bg-secondary: #141829;
  --card-bg: rgba(20, 24, 45, 0.85);
  --card-border: rgba(124, 139, 173, 0.2);

  /* Accent colors - soft and purposeful */
  --accent-cyan: #7dd3fc;
  --accent-amber: #fbbf24;
  --accent-red: #f87171;
  --accent-green: #4ade80;

  /* Text colors */
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* UI elements */
  --border-radius: 8px;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  --glow-subtle: 0 0 20px rgba(125, 211, 252, 0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
  background: var(--space-bg);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  padding-top: 50px; /* Space for guest banner */
}

/* ==========================================
   STARRY BACKGROUND - Random dispersed stars
   ========================================== */

.stars, .stars2, .stars3 {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.stars span, .stars2 span, .stars3 span {
  position: absolute;
  background: white;
  border-radius: 50%;
  opacity: 0;
  animation: twinkle 12s infinite ease-in-out;
}

@keyframes twinkle {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

/* ==========================================
   LAYOUT
   ========================================== */

.container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  min-height: 100vh;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================
   HOME LINK (ROCKET)
   ========================================== */

.home-link {
  width: 36px;
  height: 36px;
  background: var(--space-bg-secondary);
  border: 2px solid var(--card-border);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: border-color 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.home-link:hover {
  border-color: var(--accent-cyan);
}

.home-link .rocket {
  font-size: 18px;
  line-height: 1;
}

@media (max-width: 768px) {
  .home-link {
    width: 32px;
    height: 32px;
  }

  .home-link .rocket {
    font-size: 16px;
  }
}

/* ==========================================
   HEADER
   ========================================== */

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

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

.header h1 {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.version-badge {
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  background: var(--space-bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: 4px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
}

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

/* ==========================================
   BUTTONS
   ========================================== */

.btn-add {
  background: var(--card-bg);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.2s ease;
}

.btn-add:hover {
  background: rgba(125, 211, 252, 0.1);
}

.btn-delete {
  background: transparent;
  border: none;
  color: var(--accent-red);
  padding: 0.2rem;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  transition: all 0.2s ease;
  min-width: auto;
  width: auto;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-delete:hover {
  color: #ff5555;
  transform: scale(1.2);
}

.btn-secondary {
  background: var(--space-bg-secondary);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 0.8rem;
  transition: border-color 0.2s ease;
}

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

/* ==========================================
   PROJECT CARDS - Floating effect
   ========================================== */

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

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 1rem;
  cursor: pointer;
  transition: border-color 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
}

.project-card:hover {
  border-color: var(--accent-cyan);
}

/* View All - Single line box above projects */
.view-all-banner {
  width: 100%;
  margin-bottom: 1.5rem;
  padding: 1rem 1.5rem;
  background: rgba(125, 211, 252, 0.05);
  border: 2px dashed var(--accent-cyan);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 60px;
}

.view-all-banner:hover {
  background: rgba(125, 211, 252, 0.08);
  border-color: var(--accent-green);
  transform: translateX(4px);
}

.view-all-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
}

.view-all-title {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.view-all-progress {
  flex: 1;
  height: 6px;
  background: rgba(125, 211, 252, 0.2);
  border-radius: 3px;
  overflow: hidden;
  margin: 0 1rem;
}

.view-all-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green));
  border-radius: 3px;
  transition: width 0.3s ease;
}

.view-all-percentage {
  font-size: 1.15rem;
  color: var(--accent-cyan);
  font-weight: 500;
  flex-shrink: 0;
  min-width: 50px;
  text-align: right;
}

.project-header-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.project-emoji {
  font-size: 2.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.project-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
  margin-top: 0;
  color: var(--text-primary);
}

.project-card p {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-bottom: 0;
  line-height: 1.4;
}

.project-customize-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(125, 211, 252, 0.1);
  border: 1px solid rgba(125, 211, 252, 0.3);
  border-radius: 6px;
  padding: 0.4rem 0.5rem;
  color: #7dd3fc;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
  z-index: 10;
  line-height: 1;
}

.project-customize-btn:hover {
  background: rgba(125, 211, 252, 0.2);
  border-color: #7dd3fc;
}

.completion-display {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.completion-bar-container {
  width: 100px;
  height: 6px;
  background: rgba(148, 163, 184, 0.2);
  border-radius: 3px;
  overflow: hidden;
}

.completion-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan) 0%, var(--accent-green) 100%);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.completion-box {
  width: 28px;
  height: 28px;
  border: 2px solid var(--card-border);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--space-bg-secondary);
  transition: all 0.2s ease;
}

.completion-box:hover {
  border-color: var(--accent-cyan);
  transform: scale(1.05);
  box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.2);
}

.completion-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--accent-cyan);
  transition: height 0.3s ease;
  opacity: 0.3;
}

.completion-text {
  position: relative;
  z-index: 1;
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

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

.deadline.urgent {
  color: var(--accent-amber);
  font-weight: 500;
}

.deadline.overdue {
  color: var(--accent-red);
  font-weight: 600;
}

/* ==========================================
   BREADCRUMB NAVIGATION
   ========================================== */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.breadcrumb a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb a:hover {
  color: var(--text-primary);
}

.breadcrumb .separator {
  color: var(--text-muted);
}

/* ==========================================
   PROJECT DETAIL VIEW
   ========================================== */

.project-detail {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
}

.project-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  margin-bottom: 0.5rem;
}

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

.project-emoji-display {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

.project-header-right {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-items: flex-end;
  flex-shrink: 0;
}

.project-header-right .completion-display {
  flex-shrink: 0;
}

.project-header-right .completion-bar-container {
  width: 120px;
  height: 6px;
}

.project-header h2 {
  font-size: 1.5rem;
  margin: 0 0 0.4rem 0;
  color: var(--text-primary);
  outline: none;
  padding: 0.2rem;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.project-header h2:focus {
  background: rgba(125, 211, 252, 0.1);
}

.project-description {
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
  outline: none;
  padding: 0.2rem;
  border-radius: 4px;
  transition: background 0.2s ease;
  font-size: 0.9rem;
}

.project-description:focus {
  background: rgba(125, 211, 252, 0.1);
}

.project-meta {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  padding-top: 0.5rem;
  margin-bottom: 0.75rem;
  border-top: 1px solid var(--card-border);
}

.project-header-right .deadline {
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 0.85rem;
}

.project-header-right .deadline:hover {
  background: rgba(125, 211, 252, 0.1);
}

.inline-date-input {
  background: var(--card-bg);
  border: 2px solid #7dd3fc;
  border-radius: 6px;
  padding: 0.5rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
}

.inline-date-input:focus {
  outline: none;
  border-color: #7dd3fc;
}

/* ==========================================
   CONTROLS & FILTERS
   ========================================== */

.controls {
  display: flex;
  gap: 0.75rem;
  margin: 1rem 0;
  flex-wrap: wrap;
  align-items: center;
}

.bottom-controls {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: center;
}

.controls select {
  background: var(--space-bg-secondary);
  border: 2px solid var(--card-border);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.2s ease;
  font-family: inherit;
}

.controls select:hover, .controls select:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.toggle-separator {
  color: var(--text-muted);
  font-size: 1.2rem;
  opacity: 0.5;
  margin: 0 0.25rem;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.toggle input[type="checkbox"] {
  position: relative;
  width: 48px;
  height: 24px;
  appearance: none;
  background: var(--space-bg-secondary);
  border: 2px solid var(--card-border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.toggle input[type="checkbox"]:hover {
  border-color: var(--accent-cyan);
}

.toggle input[type="checkbox"]:checked {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.toggle input[type="checkbox"]::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-primary);
  top: 2px;
  left: 2px;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle input[type="checkbox"]:checked::before {
  transform: translateX(24px);
  background: var(--space-bg);
}

.toggle span {
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 500;
}

/* ==========================================
   ACTIVITIES LIST
   ========================================== */

.activities-list {
  margin-top: 1.5rem;
}

.activity-item,
.task-item {
  background: var(--space-bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  transition: all 0.2s ease;
}

.activity-item:hover,
.task-item:hover {
  border-color: var(--accent-cyan);
}

.activity-header,
.task-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.5rem;
  margin: -0.5rem; /* Negative margin to maintain spacing */
  border-radius: 6px;
  transition: background 0.2s ease;
}

.activity-header:hover {
  background: rgba(125, 211, 252, 0.05);
}

.checkbox {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid var(--accent-cyan);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkbox.checked {
  background: var(--accent-cyan);
}

.checkbox.checked::after {
  content: '✓';
  color: var(--space-bg);
  font-weight: bold;
  font-size: 14px;
}

.activity-emoji {
  font-size: 1rem;
  line-height: 1;
  user-select: none;
}

.date-picker-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.2rem;
  opacity: 0.6;
  transition: all 0.2s ease;
  line-height: 1;
}

.date-picker-btn:hover {
  opacity: 1;
  transform: scale(1.15);
}

.activity-title,
.task-title {
  flex: 1;
  font-size: 1rem;
  color: var(--text-primary);
  outline: none;
  padding: 0.3rem;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.activity-title:focus,
.task-title:focus {
  background: rgba(125, 211, 252, 0.1);
}

.activity-title.completed,
.task-title.completed {
  text-decoration: line-through;
  opacity: 0.5;
}

.task-activity-context {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.2rem 0.5rem;
  background: rgba(100, 116, 139, 0.2);
  border-radius: 3px;
  font-style: italic;
}

.task-project-context {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  padding: 0.2rem 0.5rem;
  background: rgba(125, 211, 252, 0.1);
  border-radius: 3px;
  margin-left: 0.5rem;
}

.tasks-container {
  margin-top: 0.8rem;
  margin-left: 2rem;
  padding-left: 1rem;
  border-left: 2px solid var(--card-border);
  display: none;
}

.tasks-container.expanded {
  display: block;
}

.task-item {
  background: rgba(20, 24, 45, 0.5);
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
  .container {
    padding: 0.75rem;
  }

  .header h1 {
    font-size: 1.3rem;
  }

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

  .controls,
  .filters {
    flex-direction: column;
    width: 100%;
  }

  .controls button,
  .filters select {
    width: 100%;
  }

  /* Hide toggle separator on mobile */
  .toggle-separator {
    display: none;
  }

  /* Compact activity and task headers for mobile */
  .activity-header,
  .task-header {
    gap: 0.7rem;
    padding: 0.4rem;
    margin: -0.4rem;
  }

  .activity-title,
  .task-title {
    font-size: 0.95rem;
    line-height: 1.3;
  }

  /* Make deadline text wrap better */
  .deadline {
    font-size: 0.75rem;
    white-space: nowrap;
  }

  /* Compact buttons */
  .date-picker-btn {
    font-size: 1.1rem;
    padding: 0.2rem;
  }

  .btn-delete {
    font-size: 1.1rem;
  }

  /* Ensure activity items don't overflow */
  .activity-item,
  .task-item {
    overflow: hidden;
  }

  /* Make completion box slightly smaller */
  .completion-box {
    width: 24px;
    height: 24px;
    min-width: 24px;
  }

  .completion-text {
    font-size: 0.6rem;
  }

  /* Smaller checkbox */
  .checkbox {
    width: 18px;
    height: 18px;
    min-width: 18px;
  }

  /* Hide activity context on mobile to save space */
  .task-activity-context {
    display: none;
  }

  /* Compact project context tags */
  .task-project-context {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
  }
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

.hidden {
  display: none !important;
}

.fadeIn {
  animation: fadeIn 0.3s ease;
}

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

/* ==========================================
   AUTH UI
   ========================================== */

/* Guest Banner */
.guest-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #a855f7;
  color: white;
  padding: 0.75rem 1rem;
  text-align: center;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.guest-banner-text {
  font-size: 0.9rem;
}

.guest-banner a {
  color: white;
  text-decoration: underline;
  cursor: pointer;
}

.guest-banner a:hover {
  opacity: 0.8;
}

/* Auth Modal */
.auth-modal {
  background: rgba(0, 0, 0, 0.8);
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.auth-modal-content {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 2rem;
  width: 90%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.auth-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.auth-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.auth-modal h2 {
  margin: 0 0 1.5rem 0;
  color: var(--text-primary);
  text-align: center;
}

.auth-modal p {
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1.5rem;
}

/* Auth Forms */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-form input {
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

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

.btn-primary {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-pink) 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.4);
}

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

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 0.5rem 0;
  color: var(--text-muted);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--card-border);
}

.auth-divider span {
  padding: 0 0.75rem;
  font-size: 0.8rem;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: white;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-google:hover {
  background: #f8f9fa;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-google svg {
  flex-shrink: 0;
}

.auth-switch {
  text-align: center;
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-switch a {
  color: var(--accent-purple);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-error {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #f87171;
  padding: 0.75rem;
  border-radius: 6px;
  margin-top: 1rem;
  font-size: 0.9rem;
  text-align: center;
}

/* Migration Modal */
.migration-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* User Menu */
.user-menu {
  position: relative;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 6px;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.user-menu-btn:hover {
  background: rgba(168, 85, 247, 0.2);
}

.user-icon {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  min-width: 200px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 100;
}

.user-menu-item {
  width: 100%;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s ease;
}

.user-menu-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.user-menu-item:first-child {
  border-radius: 6px 6px 0 0;
}

.user-menu-item:last-child {
  border-radius: 0 0 6px 6px;
}

/* Sync Status */
.sync-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(125, 211, 252, 0.1);
  border: 1px solid rgba(125, 211, 252, 0.3);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.sync-icon {
  font-size: 0.6rem;
  color: #7dd3fc;
}

.sync-status[data-status="syncing"] .sync-icon {
  color: #fbbf24;
  animation: pulse 1.5s ease-in-out infinite;
}

.sync-status[data-status="error"] .sync-icon {
  color: #f87171;
}

.sync-status[data-status="guest"] {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.3);
}

.sync-status[data-status="guest"] .sync-icon {
  color: #a855f7;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Emoji Badge */
.emoji-badge,
.emoji-badge-placeholder {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.emoji-badge {
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.emoji-badge:hover {
  background: rgba(168, 85, 247, 0.2);
  transform: scale(1.1);
}

.emoji-badge-placeholder {
  background: rgba(148, 163, 184, 0.1);
  border: 1px dashed rgba(148, 163, 184, 0.3);
  opacity: 0.5;
}

.emoji-badge-placeholder:hover {
  background: rgba(148, 163, 184, 0.2);
  opacity: 1;
}

/* Emoji Picker Modal */
.emoji-picker-modal {
  background: rgba(0, 0, 0, 0.5);
  z-index: 3000;
}

.emoji-picker-content {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.5rem;
  width: 90%;
  max-width: 300px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.emoji-picker-content.project-customizer {
  max-width: 280px;
  padding: 1rem;
  max-height: 90vh;
  overflow-y: auto;
}

.customizer-compact {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.compact-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.compact-section h4 {
  margin: 0;
  font-size: 0.8rem;
  color: #7dd3fc;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.emoji-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.project-customizer .emoji-picker-header {
  margin-bottom: 0.75rem;
}

.emoji-picker-header h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.project-customizer .emoji-picker-header h3 {
  font-size: 0.95rem;
}

.emoji-picker-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.emoji-picker-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  margin-bottom: 1rem;
  padding: 0.5rem;
}

.emoji-picker-grid.compact {
  grid-template-columns: repeat(6, 1fr);
  gap: 0.35rem;
  padding: 0.25rem;
  margin-bottom: 0;
}

.emoji-option {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 6px;
  padding: 0.5rem;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emoji-option:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.4);
  transform: scale(1.1);
}

.emoji-picker-grid.compact .emoji-option {
  padding: 0.3rem;
  font-size: 1.2rem;
  border-radius: 4px;
}

.emoji-option.selected {
  background: rgba(125, 211, 252, 0.2);
  border-color: #7dd3fc;
  box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.3);
}

.emoji-remove-btn {
  width: 100%;
  padding: 0.5rem;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #f87171;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.emoji-remove-btn.compact {
  padding: 0.4rem;
  font-size: 0.8rem;
}

.emoji-remove-btn:hover {
  background: rgba(248, 113, 113, 0.2);
}

.project-deadline-input {
  width: 100%;
  padding: 0.5rem;
  background: var(--card-bg);
  border: 1px solid rgba(125, 211, 252, 0.3);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.project-deadline-input:focus {
  outline: none;
  border-color: #7dd3fc;
  background: rgba(125, 211, 252, 0.05);
}

.customizer-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.customizer-actions button {
  flex: 1;
}

.project-delete-btn {
  padding: 0.4rem;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #f87171;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.project-delete-btn:hover {
  background: rgba(248, 113, 113, 0.2);
  border-color: #f87171;
}

/* Color Picker Styles */
.emoji-picker-section,
.color-picker-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(125, 211, 252, 0.2);
}

.emoji-picker-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.color-picker-section h4 {
  font-size: 0.95rem;
  color: #7dd3fc;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.color-picker-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem;
}

.color-picker-grid.compact {
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  padding: 0.25rem;
  margin-bottom: 0;
}

.color-option {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.color-picker-grid.compact .color-option {
  border-radius: 4px;
  border-width: 1.5px;
}

.color-option:hover {
  transform: scale(1.1);
  border-color: rgba(125, 211, 252, 0.5);
}

.color-option.selected {
  border-color: #7dd3fc;
  box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.3);
}

.color-option.selected::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 1.2rem;
  font-weight: bold;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

.color-picker-grid.compact .color-option.selected::after {
  font-size: 0.9rem;
}

.color-reset-btn {
  width: 100%;
  padding: 0.6rem;
  background: rgba(125, 211, 252, 0.1);
  border: 1px solid rgba(125, 211, 252, 0.3);
  border-radius: 6px;
  color: #7dd3fc;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

.color-reset-btn:hover {
  background: rgba(125, 211, 252, 0.2);
  border-color: #7dd3fc;
}

/* ==========================================
   CALENDAR PICKER
   ========================================== */

.calendar-overlay {
  background: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

.calendar-modal {
  background: var(--space-bg-secondary);
  border: 2px solid var(--card-border);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 320px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

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

.calendar-header h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.1rem;
  flex: 1;
  text-align: center;
}

.calendar-nav {
  background: rgba(125, 211, 252, 0.1);
  border: 1px solid rgba(125, 211, 252, 0.3);
  border-radius: 6px;
  color: var(--accent-cyan);
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 1.5rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-nav:hover {
  background: rgba(125, 211, 252, 0.2);
  border-color: var(--accent-cyan);
}

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

.calendar-weekdays div {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 1rem;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.2);
  transition: all 0.2s ease;
}

.calendar-day:hover:not(.empty) {
  background: rgba(125, 211, 252, 0.2);
  border-color: var(--accent-cyan);
}

.calendar-day.empty {
  background: transparent;
  border: none;
  cursor: default;
}

.calendar-day.today {
  background: rgba(251, 191, 36, 0.2);
  border-color: var(--accent-amber);
  font-weight: 600;
}

.calendar-day.selected {
  background: rgba(125, 211, 252, 0.3);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 600;
}

.calendar-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
}

.calendar-btn {
  flex: 1;
  padding: 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  border: 1px solid;
}

.calendar-clear {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.3);
  color: var(--accent-red);
}

.calendar-clear:hover {
  background: rgba(248, 113, 113, 0.2);
  border-color: var(--accent-red);
}

.calendar-cancel {
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.3);
  color: var(--text-muted);
}

.calendar-cancel:hover {
  background: rgba(148, 163, 184, 0.2);
  border-color: var(--text-muted);
}

/* Responsive Auth UI */
@media (max-width: 768px) {
  .auth-modal-content {
    padding: 1.5rem;
  }

  .guest-banner {
    padding: 0.5rem;
  }

  .guest-banner-text {
    font-size: 0.8rem;
  }

  .user-menu-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }

  .sync-status {
    font-size: 0.8rem;
  }
}
