/* ====== 增强版实验日历样式 ====== */

/* 主容器 */
.enhanced-calendar-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: linear-gradient(135deg, #F0FFF4 0%, #E6FFFA 50%, #EBF8FF 100%);
}

/* 顶部工具栏 */
.calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 32px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(128, 237, 153, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* 视图切换器 */
.calendar-view-switcher {
  display: flex;
  gap: 8px;
  background: #F0FFF4;
  padding: 6px;
  border-radius: 12px;
}

.view-btn {
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  color: #4A5568;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.view-btn:hover {
  background: rgba(255, 255, 255, 0.6);
}

.view-btn.active {
  background: white;
  color: #16A34A;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* 日期导航器 */
.calendar-date-navigator {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #C6F6D5;
  background: white;
  color: #4A5568;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-btn:hover {
  background: #F0FFF4;
  border-color: #9AE6B4;
}

.date-selectors {
  display: flex;
  gap: 8px;
  align-items: center;
}

.date-selectors select {
  padding: 8px 12px;
  border: 1px solid #C6F6D5;
  border-radius: 8px;
  background: white;
  font-size: 1rem;
  color: #4A5568;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
}

.date-selectors select:focus {
  border-color: #48BB78;
  box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.15);
}

.today-btn {
  padding: 8px 16px;
  background: #F0FFF4;
  border: 1px solid #C6F6D5;
  border-radius: 8px;
  font-size: 1rem;
  color: #16A34A;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.today-btn:hover {
  background: #DCFFE4;
  border-color: #9AE6B4;
}

/* 日历内容区 */
.calendar-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* 月视图 */
.month-view {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.calendar-header-info h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1A202C;
  margin-bottom: 20px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.weekday {
  text-align: center;
  padding: 12px;
  font-weight: 600;
  color: #718096;
  background-color: #F7FAFC;
  border-radius: 8px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  padding: 12px;
  background-color: #F7FAFC;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  min-height: 100px;
}

.calendar-day:hover {
  background-color: #E0F2FE;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.calendar-day.empty {
  background-color: transparent;
  cursor: default;
}

.calendar-day.today {
  background-color: #FBCFE8;
  border-color: #EC4899;
}

.calendar-day.has-events {
  background-color: #E0F2FE;
}

.day-number {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2D3748;
  margin-bottom: 8px;
}

.day-events-preview {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.event-bar {
  height: 6px;
  border-radius: 3px;
  opacity: 0.8;
}

.more-events {
  font-size: 1.0625rem;
  color: #718096;
  text-align: center;
}

/* 周视图 */
.week-view {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.week-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
}

.week-day-column {
  background: #F7FAFC;
  border-radius: 12px;
  padding: 16px;
  min-height: 400px;
  transition: all 0.2s;
}

.week-day-column.today {
  background: #FBCFE8;
  border: 2px solid #EC4899;
}

.week-day-header {
  text-align: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(0, 0, 0, 0.06);
}

.day-name {
  font-size: 1rem;
  color: #718096;
  margin-bottom: 4px;
}

.day-date {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2D3748;
}

.week-day-events {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.week-event-bar {
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.week-event-bar:hover {
  transform: translateX(2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.event-title-text {
  font-size: 1.0625rem;
  font-weight: 600;
  color: white;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 日视图 - 时间轴 */
.day-view {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.day-view-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #E2E8F0;
}

.day-view-header h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1A202C;
  margin-bottom: 8px;
}

.day-view-header p {
  color: #718096;
  font-size: 1.0625rem;
}

.timeline-container {
  position: relative;
  height: 1440px; /* 24 hours * 60 pixels per hour */
  display: flex;
}

.time-axis {
  width: 80px;
  position: relative;
}

.time-slot {
  height: 60px;
  position: relative;
  display: flex;
  align-items: flex-start;
}

.time-label {
  position: absolute;
  right: 12px;
  top: -8px;
  font-size: 1.0625rem;
  color: #718096;
  font-weight: 500;
}

.time-line {
  position: absolute;
  left: 80px;
  right: 0;
  top: 0;
  height: 1px;
  background: #E2E8F0;
}

.timeline-events {
  flex: 1;
  position: relative;
  margin-left: 12px;
  border-left: 2px solid #E2E8F0;
}

.timeline-event-bar {
  position: absolute;
  left: 10px;
  right: 10px;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 1;
}

.timeline-event-bar:hover {
  z-index: 10;
  transform: scale(1.02);
}

.event-bar-content {
  padding: 12px;
  border-radius: 10px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: all 0.2s;
}

.event-bar-content:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.event-time-range {
  font-size: 1.0625rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 4px;
  font-weight: 500;
}

.event-bar-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: white;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-bar-type {
  font-size: 1.0625rem;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 4px;
}

.no-events-message {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #A0AEC0;
  font-size: 1rem;
}

/* 事件提示框 */
.event-tooltip {
  position: fixed;
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  min-width: 250px;
  max-width: 350px;
  border: 1px solid #E2E8F0;
}

.tooltip-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1A202C;
  margin-bottom: 8px;
}

.tooltip-time,
.tooltip-type {
  font-size: 1rem;
  color: #4A5568;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tooltip-desc {
  font-size: 1.0625rem;
  color: #718096;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #E2E8F0;
  line-height: 1.5;
}

/* Dashboard 今日日程样式 */
.today-event-badge {
  display: inline-block;
  padding: 2px 8px;
  background: linear-gradient(135deg, #F59E0B, #FBBF24);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
  margin-left: 8px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .calendar-toolbar {
    flex-wrap: wrap;
    gap: 12px;
  }
  
  .calendar-view-switcher {
    order: 1;
    width: 100%;
    justify-content: center;
  }
  
  .calendar-date-navigator {
    order: 2;
    width: 100%;
    justify-content: center;
  }
  
  .week-header {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .calendar-grid {
    grid-template-columns: repeat(1, 1fr);
  }
  
  .calendar-day {
    aspect-ratio: auto;
    min-height: 80px;
  }
  
  .week-header {
    grid-template-columns: 1fr;
  }
  
  .timeline-container {
    height: 1200px;
  }
}
