/* Calendar Screen Styles */
.calendar-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  min-height: calc(100vh - 120px);
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: #e0e0e0;
}

.calendar-header {
  margin-bottom: 30px;
  text-align: center;
}

.calendar-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 10px 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.calendar-subtitle {
  font-size: 1.1rem;
  color: #9ca3af;
  margin: 0;
}

.calendar-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.view-controls {
  display: flex;
  gap: 15px;
  align-items: center;
}

.view-select,
.date-select {
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.view-select:focus,
.date-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
  background: rgba(255, 255, 255, 0.15);
}

.navigation-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav-btn,
.today-btn {
  padding: 10px 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.nav-btn:hover,
.today-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.today-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #667eea;
  color: white;
  font-weight: 600;
}

.today-btn:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
  border-color: #5a6fd8;
}

/* Day View Styles */
.day-view {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  height: 100%;
  backdrop-filter: blur(10px);
}

.day-header {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 30px;
  text-align: center;
}

.day-title {
  margin: 0 0 10px 0;
  color: #ffffff;
  font-size: 2rem;
  font-weight: 700;
}

.day-subtitle {
  margin: 0;
  color: #9ca3af;
  font-size: 1.1rem;
  font-weight: 500;
}

.day-content {
  padding: 30px;
  min-height: 400px;
}

.day-tasks {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.task-group {
  margin-bottom: 30px;
}

.task-group-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #e0e0e0;
  margin: 0 0 15px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.day-task {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 15px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.day-task:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.day-task.completed {
  opacity: 0.6;
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
}

.day-task.recurring {
  border-left: 4px solid #f59e0b;
}

.task-priority-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.task-priority-dot.priority-high {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.task-priority-dot.priority-medium {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.task-priority-dot.priority-low {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.task-priority-dot.priority-none {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  box-shadow: 0 0 10px rgba(107, 114, 128, 0.3);
}

.task-content {
  flex: 1;
}

.task-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.task-description {
  color: #9ca3af;
  font-size: 0.9rem;
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.task-project {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9ca3af;
  font-size: 0.85rem;
}

.project-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.recurring-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.task-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}

/* Date picker styling */
.task-date-picker {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #ffffff;
  padding: 6px 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 120px;
}

.task-date-picker:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.task-date-picker:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.2);
  border-color: #8a2be2;
  box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.3);
}

/* Webkit date picker styling */
.task-date-picker::-webkit-calendar-picker-indicator {
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  filter: invert(1);
}

.task-date-picker::-webkit-datetime-edit-text {
  color: #ffffff;
}

.task-date-picker::-webkit-datetime-edit-month-field,
.task-date-picker::-webkit-datetime-edit-day-field,
.task-date-picker::-webkit-datetime-edit-year-field {
  color: #ffffff;
}

.schedule-instructions {
  color: #9ca3af;
  font-size: 0.9rem;
  margin: 0 0 15px 0;
  line-height: 1.4;
}

.task-action-btn {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.task-action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Grid View Styles */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  min-height: 1400px;
}

.calendar-day {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-height: 320px;
  padding: 10px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.calendar-day:hover {
  background: rgba(255, 255, 255, 0.08);
}


.day-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  gap: 4px;
}

.day-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.day-number-month {
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.day-tasks {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.calendar-task {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  min-height: 40px; /* Allow for 2 lines of text */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 4px 6px;
  gap: 2px;
  font-size: 0.75rem;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.calendar-task:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.calendar-task.completed {
  opacity: 0.6;
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.4);
}

.task-title {
  flex: 1;
  color: #ffffff;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-project-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.empty-day-indicator {
  height: 20px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

/* Empty State */
.empty-day {
  text-align: center;
  padding: 40px 20px;
}

.empty-day-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  opacity: 0.6;
}

.empty-day-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #e0e0e0;
  margin: 0 0 10px 0;
}

.empty-day-description {
  color: #9ca3af;
  margin: 0 0 30px 0;
  font-size: 1rem;
}

.new-task-btn {
  display: inline-block;
  padding: 12px 24px;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.new-task-btn:hover {
  background: linear-gradient(135deg, #20c997 0%, #28a745 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
  color: white;
}

/* Calendar Legend */
.calendar-legend {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 30px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9ca3af;
  font-size: 0.9rem;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-dot.priority-high {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.legend-dot.priority-medium {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.legend-dot.priority-low {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.legend-dot.priority-none {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  box-shadow: 0 0 10px rgba(107, 114, 128, 0.3);
}

/* Error Container */
.error-container {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 30px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.error-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.error-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #ef4444;
  margin: 0 0 10px 0;
}

.error-container p {
  color: #9ca3af;
  margin: 0;
}

/* Drag and Drop Styles */
.unscheduled-task,
.calendar-task {
  cursor: grab;
  transition: all 0.2s ease;
}

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


.calendar-day {
  transition: all 0.2s ease;
  min-height: 120px;
  position: relative;
}

.calendar-day:hover {
  background: rgba(255, 255, 255, 0.02);
}


.empty-day-indicator {
  opacity: 0.3;
  font-style: italic;
  color: #9ca3af;
  text-align: center;
  padding: 20px;
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin: 10px;
  transition: all 0.2s ease;
}

.calendar-day:hover .empty-day-indicator {
  opacity: 0.6;
  border-color: rgba(255, 255, 255, 0.2);
}

.empty-scheduled-section {
  padding: 20px;
  text-align: center;
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin: 10px 0;
  transition: all 0.2s ease;
}

.empty-scheduled-section:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.02);
}

.empty-section-hint {
  color: #9ca3af;
  font-style: italic;
  margin: 0;
  opacity: 0.7;
}

.unscheduled-tasks {
  transition: all 0.2s ease;
  min-height: 100px;
}

.calendar-sidebar {
  transition: all 0.2s ease;
}


/* Calendar Sidebar Styles */
.calendar-sidebar {
  width: 300px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(10px);
  margin-left: 20px;
}

.calendar-sidebar h3 {
  margin: 0 0 15px 0;
  color: #e0e0e0;
  font-size: 1.2rem;
  font-weight: 600;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.drag-instructions {
  margin: 0 0 15px 0;
  color: #9ca3af;
  font-size: 0.8rem;
  font-style: italic;
  line-height: 1.4;
}

.unscheduled-tasks {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 8px 0;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.unscheduled-task {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 4px solid;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: grab;
  transition: all 0.3s ease;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  user-select: none;
  backdrop-filter: blur(10px);
}

.unscheduled-task:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.unscheduled-task:active {
  cursor: grabbing;
}

.unscheduled-task.completed {
  opacity: 0.6;
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
}

.unscheduled-task .task-content {
  flex: 1;
}

.unscheduled-task .task-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: #ffffff;
  line-height: 1.4;
  margin: 0 0 5px 0;
}

.unscheduled-task .task-project-name {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #9ca3af;
  font-weight: 400;
  font-size: 0.8rem;
}

.unscheduled-task .project-color-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.unscheduled-task .task-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.unscheduled-task .task-action-btn {
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 500;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  text-align: center;
}

.unscheduled-task .task-action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
  transform: translateY(-1px);
}

.unscheduled-task .task-action-btn.schedule {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  border-color: #20c997;
  color: white;
}

.unscheduled-task .task-action-btn.schedule:hover {
  background: linear-gradient(135deg, #20c997 0%, #28a745 100%);
  border-color: #28a745;
}

/* Unschedule button styles */
.task-action-btn.unschedule {
  background: linear-gradient(135deg, #ff6b6b, #ee5a52);
  border-color: #ff6b6b;
  color: white;
  font-size: 0.8rem;
  padding: 4px 8px;
  min-width: auto;
}

.task-action-btn.unschedule:hover {
  background: linear-gradient(135deg, #ff5252, #e53935);
  border-color: #ff5252;
}

/* Grid view unschedule button - more compact */
.calendar-task .task-action-btn.unschedule {
  font-size: 0.7rem;
  padding: 2px 6px;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Task title truncation based on view mode */
.day-view .task-title {
  max-width: 20ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-view .task-title {
  max-width: 15ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-view .task-title {
  max-width: 10ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Calendar task title styling */
.calendar-task .task-title {
  max-width: 10ch;
  width: 10ch;
  line-height: 1.2;
  font-size: 0.75rem;
  color: #ffffff;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Task divider between normal and recurring tasks */
.task-divider {
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 20%, rgba(255, 255, 255, 0.6) 50%, rgba(255, 255, 255, 0.4) 80%, transparent 100%);
  margin: 8px 0;
  border: none;
  border-radius: 1px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Recurring task styling */
.calendar-task.recurring-task {
  border-left: 3px solid #42a5f5;
  background: rgba(66, 165, 245, 0.1);
}

.calendar-task.normal-task {
  border-left: 3px solid transparent;
}

/* Recurring badge */
.recurring-badge {
  font-size: 0.6rem;
  background: rgba(66, 165, 245, 0.3);
  color: #42a5f5;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Task title links */
.calendar-task .task-title-link {
  color: #ffffff !important;
  text-decoration: none;
  transition: color 0.2s ease;
}

.calendar-task .task-title-link:hover {
  color: #42a5f5 !important;
  text-decoration: underline;
}

.day-task .task-title-link {
  color: #ffffff !important;
  text-decoration: none;
  transition: color 0.2s ease;
}

.day-task .task-title-link:hover {
  color: #42a5f5 !important;
  text-decoration: underline;
}

/* Calendar task actions positioning */
.calendar-task .task-actions {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 10;
}

/* Empty Unscheduled State */
.empty-unscheduled {
  text-align: center;
  padding: 40px 20px;
}

.empty-unscheduled-icon {
  font-size: 2.5rem;
  margin-bottom: 15px;
  opacity: 0.6;
}

.empty-unscheduled-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: #e0e0e0;
  margin: 0 0 8px 0;
}

.empty-unscheduled-description {
  color: #9ca3af;
  margin: 0;
  font-size: 0.9rem;
}

/* Calendar Content Layout */
.calendar-content {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.calendar-main {
  flex: 1;
}

/* Calendar Instructions */
.calendar-instructions {
  margin-top: 30px;
  text-align: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.calendar-instructions p {
  margin: 0 0 15px 0;
  color: #9ca3af;
  font-size: 0.95rem;
  line-height: 1.5;
}

.calendar-instructions p:last-child {
  margin-bottom: 0;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .calendar-sidebar {
    width: 280px;
    min-width: 280px;
  }
}

@media (max-width: 768px) {
  .calendar-container {
    padding: 15px;
  }
  
  .calendar-controls {
    flex-direction: column;
    gap: 15px;
  }
  
  .view-controls,
  .navigation-controls {
    width: 100%;
    justify-content: center;
  }
  
  .calendar-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .calendar-day {
    min-height: 80px;
  }
  
  .calendar-legend {
    flex-direction: column;
    gap: 15px;
  }
  
  .calendar-content {
    flex-direction: column;
  }
  
  .calendar-sidebar {
    width: 100%;
    margin-left: 0;
    margin-top: 20px;
  }
}
