/**
 * 酒店活动日历样式
 * Hotel Event Calendar Styles
 * 多酒店联合活动展示版本
 */

/* 日历组件容器 */
.hotel-calendar-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  font-family: "Hiragino Kaku Gothic ProN", "ヒラギノ角ゴ ProN", "Yu Gothic", "游ゴシック", sans-serif;
}

/* 日历标题 */
.hotel-calendar-title {
  text-align: center;
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 30px;
  color: #333;
}

/* 日历容器 - Flexbox 布局 */
.hotel-calendar-container {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
}

/* ====== 日历区域 ====== */
.calendar-section {
  flex: 1;
  min-width: 300px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 15px rgba(0,0,0,0.1);
  padding: 20px;
}

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

.calendar-nav-btn {
  background: #2c5282;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
}

.calendar-nav-btn:hover {
  background: #1a365d;
}

.calendar-month-year {
  font-size: 20px;
  font-weight: bold;
  color: #333;
}

/* 星期标题 */
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-bottom: 10px;
}

.weekday {
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  color: #666;
  padding: 10px 0;
}

.weekday.sun { color: #e53e3e; }
.weekday.sat { color: #3182ce; }

/* 日期格子 */
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  background: #f7fafc;
}

.calendar-day:hover {
  background: #bee3f8;
}

.calendar-day.selected {
  background: #2c5282;
  color: #fff;
}

/* 有活动的日期标记 */
.calendar-day.has-event {
  position: relative;
  font-weight: bold;
}

.calendar-day.has-event::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 6px;
  height: 6px;
  background: #ed8936;
  border-radius: 50%;
}

.calendar-day.other-month {
  color: #ccc;
}

.calendar-day.sun { color: #e53e3e; }
.calendar-day.sat { color: #3182ce; }
.calendar-day.selected.sun,
.calendar-day.selected.sat { color: #fff; }

/* ====== 活动展示区域 - 新布局 ====== */
.events-section {
  flex: 1.5;
  min-width: 400px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 15px rgba(0,0,0,0.1);
  padding: 20px;
  max-height: 520px;
  overflow-y: auto;
}

.events-date-title {
  font-size: 18px;
  font-weight: bold;
  color: #333;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #2c5282;
}

/* 活动网格容器 */
.events-grid-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* 时间段区域 */
.time-slot-section {
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px;
  border: 1px solid #e2e8f0;
}

.time-slot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #cbd5e0;
}

.time-slot-date {
  font-size: 14px;
  font-weight: bold;
  color: #2d3748;
}

.time-slot-time {
  font-size: 13px;
  color: #4a5568;
  background: #edf2f7;
  padding: 4px 10px;
  border-radius: 15px;
}

/* 酒店网格 - 横坐标3家酒店 */
.hotels-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

/* 酒店单元格 */
.hotel-cell {
  position: relative;
  min-height: 80px;
}

.hotel-cell-content {
  background: #fff;
  border-radius: 8px;
  padding: 10px 8px;
  height: 100%;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid #e2e8f0;
  box-sizing: border-box;
}

.hotel-cell-content.has-event {
  border-color: var(--hotel-color, #2c5282);
  border-left-width: 4px;
}

.hotel-cell-content.has-event:hover,
.hotel-cell-content.has-event.active {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  z-index: 10;
  border-color: var(--hotel-color, #2c5282);
}

.hotel-cell-content.no-event {
  background: #f7fafc;
  border-style: dashed;
  cursor: default;
}

.hotel-label {
  font-size: 11px;
  font-weight: bold;
  color: #718096;
  margin-bottom: 5px;
  text-align: center;
}

.has-event .hotel-label {
  color: var(--hotel-color, #2c5282);
}

.event-preview {
  text-align: center;
}

.event-mini-title {
  font-size: 12px;
  font-weight: 600;
  color: #2d3748;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.no-event-text {
  font-size: 16px;
  color: #cbd5e0;
}

/* 活动详情弹窗 */
.event-detail-popup {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  overflow: hidden;
  margin-top: 8px;
}

.event-detail-popup.visible {
  opacity: 1;
  visibility: visible;
}

.event-detail-popup::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 10px solid #fff;
}

.popup-image {
  width: 100%;
  height: 140px;
  overflow: hidden;
  background: #f0f0f0;
}

.popup-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.popup-no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

.popup-no-image span {
  font-size: 40px;
  opacity: 0.5;
}

.popup-content {
  padding: 15px;
}

.popup-hotel {
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 5px;
}

.popup-title {
  font-size: 16px;
  font-weight: bold;
  color: #2d3748;
  margin-bottom: 8px;
  line-height: 1.4;
}

.popup-time {
  font-size: 12px;
  color: #718096;
  margin-bottom: 10px;
}

.popup-description {
  font-size: 13px;
  color: #4a5568;
  line-height: 1.6;
  max-height: 100px;
  overflow-y: auto;
}

/* 空状态提示 */
.no-events {
  text-align: center;
  color: #a0aec0;
  padding: 40px 20px;
}

/* 加载中提示 */
.loading-message {
  text-align: center;
  color: #718096;
  padding: 20px;
}

/* ====== 响应式设计 - 手机端 ====== */
@media (max-width: 900px) {
  .hotels-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .event-detail-popup {
    width: 250px;
  }
}

@media (max-width: 768px) {
  .hotel-calendar-container {
    flex-direction: column;
  }

  .calendar-section,
  .events-section {
    min-width: 100%;
  }

  .hotel-calendar-title {
    font-size: 22px;
  }

  .hotel-calendar-wrapper {
    padding: 20px 10px;
  }

  .hotels-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .hotel-cell-content {
    min-height: 70px;
    padding: 8px 6px;
  }

  .hotel-label {
    font-size: 10px;
  }

  .event-mini-title {
    font-size: 11px;
  }

  .event-detail-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 320px;
    margin-top: 0;
    max-height: 80vh;
    overflow-y: auto;
  }

  .event-detail-popup::before {
    display: none;
  }

  .events-section {
    max-height: none;
  }
}

@media (max-width: 480px) {
  .hotels-grid {
    grid-template-columns: 1fr;
  }

  .hotel-cell-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
  }

  .hotel-label {
    margin-bottom: 0;
  }
}
