/* ========================================
   イベント機能 追加CSS更新
   週表示カレンダー、UIの修正
======================================== */

/* イベントモーダルの修正 */
.event-modal {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.8) 80%, transparent 100%) !important;
  padding-bottom: 0 !important;
}

.event-modal-close {
  position: absolute !important;
  top: 60px !important;
  right: 24px !important;
  background: white !important;
  border: 2px solid #ddd !important;
  z-index: 10 !important;
}

.event-modal-content {
  margin-top: 80px !important;
  margin-bottom: 20px !important;
}

/* ブックマーク済みボタンのホバー修正 */
.event-action-btn.bookmarked:hover {
  background: #222 !important;
}

/* 個別イベント詳細ページスタイル */
.event-detail-page {
  background: white;
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 40px 20px 100px 20px; /* 上部パディングを20pxから40pxに拡大 */
  border-radius: 0;
  min-height: 100vh;
}

.event-detail-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #000;
}

.event-back-btn {
  background: none;
  border: 1px solid #333;
  color: #333;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.event-back-btn:hover {
  background: #000;
  color: white;
}

.event-detail-title {
  font-size: 24px;
  font-weight: bold;
  margin: 0;
  color: #000;
}

.event-detail-content {
  padding: 0;
}

/* モーダルの背景を調整 */
.event-modal.active {
  background: white;
  display: block;
  overflow-y: auto;
}

/* 週表示カレンダー */
.week-calendar-container {
  margin-bottom: 24px;
}

.week-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #000;
  color: white;
  border-radius: 8px 8px 0 0;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: white;
  border: 2px solid #000;
  border-top: none;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

.calendar-weekday {
  height: 30px;
  line-height: 30px;
  padding: 0;
  background: #f5f5f5;
  border-right: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #333;
}

.calendar-weekday:nth-child(7n) {
  border-right: none;
}

.week-day {
  min-height: 120px;
  height: auto;
  padding: 8px;
  border-right: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.week-day:nth-child(14n) {
  border-right: none;
}

.week-day:hover {
  background: #f8f8f8;
}

.week-day.selected {
  background: #eee;
  border-color: #000;
}

.week-day.today {
  background: #111;
  color: white;
}

.week-day-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e0e0e0;
}

.week-day.today .week-day-header {
  border-bottom-color: #444;
}

.week-day-number {
  font-size: 16px;
  font-weight: 600;
}

.week-events {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  overflow-y: auto;
  max-height: 300px;
}

.week-event {
  padding: 1px 3px;
  background: #000;
  color: white;
  border-radius: 2px;
  font-size: 9px;
  line-height: 1.3;
  white-space: normal;
  word-wrap: break-word;
  word-break: break-all;
  cursor: pointer;
}

.week-event:hover {
  background: #333;
}

.week-event-location {
  font-weight: 600;
  margin-right: 3px;
}

/* 選択日のイベント一覧 */
.selected-day-events {
  background: white;
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  margin-top: 24px;
}

.selected-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #eee;
}

.selected-day-title {
  font-size: 18px;
  font-weight: 600;
  color: #111;
}

.selected-day-date {
  font-size: 14px;
  color: #666;
}

.selected-day-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.selected-event-item {
  padding: 16px;
  background: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.selected-event-item:hover {
  background: #eee;
  border-color: #999;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.selected-event-location {
  display: inline-block;
  padding: 3px 10px;
  background: #000;
  color: white;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}

.selected-event-location.web {
  background: #666;
}

.selected-event-name {
  font-size: 16px;
  font-weight: 600;
  color: #111;
  margin-bottom: 8px;
}

.selected-event-period {
  font-size: 13px;
  color: #666;
  margin-bottom: 4px;
}

.selected-event-creator {
  font-size: 13px;
  color: #666;
}

.no-selected-events {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 14px;
}

/* 投稿者名リンクスタイル */
.creator-link,
.comment-user-link {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.creator-link:hover,
.comment-user-link:hover {
  color: #000;
  text-decoration: underline;
}

/* フォーム都道府県セレクト */
.prefecture-select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 15px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.prefecture-select:focus {
  outline: none;
  border-color: #000;
  background: #f8f8f8;
}

.web-event-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.web-event-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.web-event-checkbox label {
  font-size: 15px;
  cursor: pointer;
  user-select: none;
}

.location-fields {
  transition: all 0.3s ease;
}

.location-fields.hidden {
  display: none;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .week-day {
    min-height: 80px;
    padding: 4px;
  }
  
  .week-day-number {
    font-size: 12px;
  }
  
  .week-event {
    font-size: 9px;
    padding: 1px 2px;
  }
  
  .selected-event-item {
    padding: 12px;
  }
}