/* Calendar Grid Styles */
.calendar-grid {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: white;
  border-radius: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.calendar-grid th,
.calendar-grid td {
  border: 1px solid #e5e7eb;
  vertical-align: top;
  position: relative;
}

/* Calendar Header */
.calendar-grid th {
  background: #f8f9fa;
  padding: 12px 8px;
  text-align: center;
  font-weight: 600;
  color: #374151;
  font-size: 14px;
}

/* Calendar Day Cells */
.calendar-grid td {
  height: 120px;
  min-width: 120px;
  padding: 0;
  cursor: pointer;
  transition: background-color 0.2s;
}

.calendar-grid td:hover {
  background-color: #f3f4f6;
}

.calendar-grid td.other-month {
  background-color: #f9fafb;
  color: #9ca3af;
}

.calendar-grid td.today {
  background-color: #dbeafe;
  border-color: #3b82f6;
}

/* Day Number */
.calendar-day-number {
  position: absolute;
  top: 5px;
  left: 8px;
  font-weight: 500;
  color: #374151;
  font-size: 14px;
}

.calendar-grid td.today .calendar-day-number {
  color: #1d4ed8;
  font-weight: 600;
}

.calendar-grid td.other-month .calendar-day-number {
  color: #9ca3af;
}

/* Tasks Container */
.calendar-tasks {
  margin-top: 25px;
  padding: 0 5px 5px 5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 85px;
  overflow: visible;
}

/* Individual Task */
.calendar-task {
  background: #3b82f6;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  overflow: visible;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
}

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

.calendar-task-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
}

.calendar-task-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.4;
  white-space: normal;
  min-width: 200px;
  max-width: 300px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s, visibility 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.calendar-task:hover .calendar-task-tooltip {
  opacity: 1;
  visibility: visible;
}

/* Mini Tooltip for Year and Quarter views */
.calendar-mini-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.5;
  white-space: normal;
  min-width: 180px;
  max-width: 250px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s, visibility 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

div:hover > .calendar-mini-tooltip {
  opacity: 1;
  visibility: visible;
}

/* Task Status Colors */
.calendar-task.status-not-started {
  background: #6b7280;
}

.calendar-task.status-in-progress {
  background: #f59e0b;
}

.calendar-task.status-completed {
  background: #10b981;
}

.calendar-task.status-on-hold {
  background: #ef4444;
}

/* More Tasks Indicator */
.calendar-task-more {
  font-size: 10px;
  color: #6b7280;
  font-weight: 500;
  text-align: center;
  padding: 2px;
  background: #f3f4f6;
  border-radius: 2px;
  cursor: pointer;
}

/* Calendar Navigation */
.calendar-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 0 10px;
}

.calendar-navigation button {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s;
}

.calendar-navigation button:hover {
  background: #2563eb;
}

.calendar-navigation button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.calendar-current-month {
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
}

/* Day Tasks Modal */
.day-tasks-modal {
  border: 1px solid #e5e7eb;
}

.day-tasks-modal h3 {
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 10px;
}

/* Calendar Zoom Levels */
.calendar-zoom-controls {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
}

/* Month Zoom - Default monthly view with task details */
.calendar-container.zoom-month .calendar-grid td {
  height: 120px;
}

.calendar-container.zoom-month .calendar-day-number {
  font-size: 14px;
}

.calendar-container.zoom-month .calendar-tasks {
  max-height: 85px;
}

.calendar-container.zoom-month .calendar-task {
  font-size: 11px;
}

/* Quarter Zoom - 3 months overview */
.calendar-container.zoom-quarter .calendar-grid td {
  height: 80px;
}

.calendar-container.zoom-quarter .calendar-day-number {
  font-size: 12px;
  top: 3px;
  left: 6px;
}

.calendar-container.zoom-quarter .calendar-tasks {
  margin-top: 20px;
  padding: 0 4px 4px 4px;
  max-height: 50px;
  gap: 1px;
}

.calendar-container.zoom-quarter .calendar-task {
  font-size: 10px;
  padding: 1px 4px;
}

.calendar-container.zoom-quarter .calendar-grid th {
  padding: 8px 6px;
  font-size: 12px;
}

/* Year Zoom - 12 months overview */
.calendar-container.zoom-year .calendar-grid td {
  height: 60px;
}

.calendar-container.zoom-year .calendar-day-number {
  font-size: 11px;
  top: 2px;
  left: 4px;
}

.calendar-container.zoom-year .calendar-tasks {
  margin-top: 18px;
  padding: 0 2px 2px 2px;
  max-height: 35px;
  gap: 1px;
}

.calendar-container.zoom-year .calendar-task {
  font-size: 9px;
  padding: 1px 3px;
}

.calendar-container.zoom-year .calendar-grid th {
  padding: 6px 4px;
  font-size: 11px;
}

/* Legacy support - keep old classes for backward compatibility */
.calendar-container.zoom-large .calendar-grid td {
  height: 160px;
}

.calendar-container.zoom-large .calendar-day-number {
  font-size: 16px;
  top: 8px;
  left: 10px;
}

.calendar-container.zoom-large .calendar-tasks {
  margin-top: 32px;
  padding: 0 8px 8px 8px;
  max-height: 115px;
  gap: 3px;
}

.calendar-container.zoom-large .calendar-task {
  font-size: 13px;
  padding: 4px 8px;
}

.calendar-container.zoom-large .calendar-grid th {
  padding: 16px 10px;
  font-size: 16px;
}

.calendar-container.zoom-medium .calendar-grid td {
  height: 120px;
}

.calendar-container.zoom-medium .calendar-day-number {
  font-size: 14px;
}

.calendar-container.zoom-medium .calendar-tasks {
  max-height: 85px;
}

.calendar-container.zoom-medium .calendar-task {
  font-size: 11px;
}

/* Small Zoom - Compact view, more overview */
.calendar-container.zoom-small .calendar-grid td {
  height: 80px;
}

.calendar-container.zoom-small .calendar-day-number {
  font-size: 12px;
  top: 3px;
  left: 6px;
}

.calendar-container.zoom-small .calendar-tasks {
  margin-top: 20px;
  padding: 0 4px 4px 4px;
  max-height: 50px;
  gap: 1px;
}

.calendar-container.zoom-small .calendar-task {
  font-size: 10px;
  padding: 1px 4px;
}

.calendar-container.zoom-small .calendar-grid th {
  padding: 8px 6px;
  font-size: 12px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .calendar-grid td {
    height: 80px;
    font-size: 12px;
  }
  
  .calendar-day-number {
    font-size: 12px;
    top: 3px;
    left: 5px;
  }
  
  .calendar-tasks {
    margin-top: 18px;
    padding: 0 3px 3px 3px;
    max-height: 55px;
  }
  
  .calendar-task {
    font-size: 10px;
    padding: 1px 4px;
  }
  
  .calendar-current-month {
    font-size: 18px;
  }
  
  .calendar-navigation button {
    padding: 6px 12px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .calendar-grid td {
    height: 60px;
  }
  
  .calendar-day-number {
    font-size: 11px;
  }
  
  .calendar-tasks {
    margin-top: 15px;
    max-height: 40px;
  }
  
  .calendar-task {
    font-size: 9px;
    padding: 1px 3px;
  }
}