/**
 * Leave Calendar Integration Styles
 * 请假计划日历集成样式
 */

/* ============================================================================
   请假日期样式
   ============================================================================ */

/* 请假日期 - 需要请假的工作日 */
.cell.leave-plan-date {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 152, 0, 0.1) 100%);
  border: 1.5px solid rgba(255, 152, 0, 0.4);
  color: #ff9800;
  font-weight: 500;
  position: relative;
}

.cell.leave-plan-date::before {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 4px;
  height: 4px;
  background: #ff9800;
  border-radius: 50%;
}

/* 连休日期 - 自然假期（周末或法定假日） */
.cell.rest-day-date {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, rgba(56, 142, 60, 0.08) 100%);
  border: 1.5px solid rgba(76, 175, 80, 0.3);
  color: #4caf50;
  font-weight: 500;
}

.cell.rest-day-date::before {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 4px;
  height: 4px;
  background: #4caf50;
  border-radius: 50%;
}

/* 计划高亮 - 悬停或选中时 */
.cell[data-plan-id]:hover,
.cell.plan-highlight {
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.2) 0%, rgba(25, 118, 210, 0.15) 100%);
  border-color: rgba(33, 150, 243, 0.6);
  box-shadow: 0 0 8px rgba(33, 150, 243, 0.3);
  transform: scale(1.05);
  z-index: 10;
}

/* 闪烁动画 - 用于请假日期 */
@keyframes pulsing {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.cell.pulsing {
  animation: pulsing 2s ease-in-out infinite;
}

/* ============================================================================
   请假计划详情卡片
   ============================================================================ */

.leave-plan-detail {
  padding: 16px;
  background: var(--card-bg, #ffffff);
  border-radius: 8px;
  border: 1px solid var(--border-color, #e0e0e0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.detail-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #333);
}

.detail-cp {
  font-size: 14px;
  font-weight: 500;
  color: #ff9800;
  background: rgba(255, 152, 0, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
}

.detail-dates {
  margin-bottom: 12px;
}

.date-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-secondary, #666);
}

.date-label {
  font-weight: 500;
  color: var(--text-secondary, #666);
}

.date-value {
  color: var(--text-primary, #333);
  font-weight: 500;
}

.detail-leave-dates {
  margin-bottom: 12px;
  padding: 10px;
  background: var(--bg-secondary, #f5f5f5);
  border-radius: 6px;
}

.leave-dates-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #666);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.leave-dates-list {
  font-size: 12px;
  color: var(--text-primary, #333);
  word-break: break-all;
  line-height: 1.6;
  font-family: 'Courier New', monospace;
}

.detail-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.tag {
  display: inline-block;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.1) 0%, rgba(25, 118, 210, 0.08) 100%);
  color: #1976d2;
  border: 1px solid rgba(33, 150, 243, 0.3);
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.detail-notes {
  font-size: 12px;
  color: var(--text-secondary, #666);
  padding: 8px;
  background: var(--bg-secondary, #f5f5f5);
  border-left: 3px solid #ff9800;
  border-radius: 4px;
  line-height: 1.5;
}

/* ============================================================================
   响应式调整
   ============================================================================ */

@media (max-width: 768px) {
  .cell.leave-plan-date,
  .cell.rest-day-date {
    font-size: 12px;
    padding: 4px;
  }

  .cell[data-plan-id]:hover,
  .cell.plan-highlight {
    transform: scale(1.02);
  }

  .leave-plan-detail {
    padding: 12px;
  }

  .detail-title {
    font-size: 14px;
  }

  .detail-cp {
    font-size: 12px;
  }

  .date-row {
    font-size: 12px;
  }

  .leave-dates-list {
    font-size: 11px;
  }
}

/* ============================================================================
   深色主题适配
   ============================================================================ */

@media (prefers-color-scheme: dark) {
  .cell.leave-plan-date {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2) 0%, rgba(255, 152, 0, 0.15) 100%);
    border-color: rgba(255, 152, 0, 0.5);
  }

  .cell.rest-day-date {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15) 0%, rgba(56, 142, 60, 0.1) 100%);
    border-color: rgba(76, 175, 80, 0.4);
  }

  .cell[data-plan-id]:hover,
  .cell.plan-highlight {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.25) 0%, rgba(25, 118, 210, 0.2) 100%);
    border-color: rgba(33, 150, 243, 0.7);
    box-shadow: 0 0 12px rgba(33, 150, 243, 0.4);
  }

  .leave-plan-detail {
    background: var(--card-bg, #2a2a2a);
    border-color: var(--border-color, #404040);
  }

  .detail-header {
    border-bottom-color: var(--border-color, #404040);
  }

  .detail-leave-dates,
  .detail-notes {
    background: var(--bg-secondary, #1a1a1a);
  }

  .tag {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.15) 0%, rgba(25, 118, 210, 0.1) 100%);
    border-color: rgba(33, 150, 243, 0.4);
  }
}

/* ============================================================================
   动画和过渡
   ============================================================================ */

.cell[data-plan-id] {
  transition: all 0.2s ease-out;
}

.cell[data-plan-id]:active {
  transform: scale(0.98);
}

.leave-plan-detail {
  animation: slideIn 0.3s ease-out;
}

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

/* ============================================================================
   无障碍支持
   ============================================================================ */

.cell[data-plan-id]:focus-visible {
  outline: 2px solid #1976d2;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .cell.pulsing {
    animation: none;
    opacity: 0.85;
  }

  .cell[data-plan-id] {
    transition: none;
  }

  .leave-plan-detail {
    animation: none;
  }
}
