/* ======================================================================
   event.css | イベントページ固有
   目的:
   - 画面上部の「表示（リスト/カレンダー）」と「対象（全体/フォロー/申込済）」の切替UI
   - リスト表示（カード）
   - カレンダー表示（日付グリッド＋日別のイベント一覧）
   - 申込ボタン（締切時は無効化表示）
   補足:
   - ここは event.php だけで使われる想定
   - 変数は 00-tokens.css に定義済み（色/余白/角丸など）
====================================================================== */

/* ページ内セクションのベース余白。レイアウト側で余白調整しているため最小限 */
.event-section {
  margin: 0;
  padding: 0;
}

/* ===== 表示切替（セレクト2つの横並び） =============================== */
/* 全体の入れ物。横並び＋折返しでモバイルも崩れない */
.view-filter-container {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  align-items: center;
  margin-top: 18px;
  margin-bottom: 10px;
}

/* セレクト2つをまとめるラッパー。中央寄せ＋折返し */
.controls {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* ラベル＋セレクトのセット */
.control {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ラベル（小さめ/薄め） */
.control label {
  font-size: var(--fz-13);
  color: #cfd8dc;
  white-space: nowrap;
}

/* セレクトの見た目調整（擬似「▼」を載せるための相対配置） */
.select-wrap {
  position: relative;
}

/* セレクト本体のスキン（OSネイティブ感は残しつつダーク化） */
.select-wrap select {
  appearance: none;
  padding: 10px 36px 10px 12px;
  font-size: var(--fz-14);
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid #3c4e60;
  background: #1b1e23;
  color: #cfd8dc;
  box-shadow: inset 0 0 0 1px #2a2f36;
  outline: none;
  cursor: pointer;
  min-width: 180px;
  transition: border-color .2s, background .2s, transform .1s;
}

/* ホバー/フォーカスで色味を少しだけ変える（操作感） */
.select-wrap select:hover {
  border-color: #355c9e;
}

.select-wrap select:focus {
  border-color: #2a82d0;
  background: #161a20;
}

/* 右側の「▼」アイコン（実体は文字。クリック無効） */
.select-wrap .select-caret {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-45%);
  font-size: 12px;
  color: #9aa5b1;
  pointer-events: none;
}

/* モバイルでの横幅確保（広めに） */
@media (max-width:600px) {
  .controls {
    gap: 12px;
  }

  .select-wrap select {
    width: 100%;
    min-width: 220px;
  }
}

/* ===== ビュー切替領域（リスト or カレンダー） ======================= */
.event-view {
  display: none;
  padding: var(--space-7) var(--space-9);
}

.event-view.active {
  display: block;
}

/* ===== リストビュー（一覧カード） =================================== */
.event-card {
  display: flex;
  align-items: center;
  gap: var(--space-7);
  padding: var(--space-7);
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  background: transparent;
  transition: background .2s, border-color .2s;
  border-radius: var(--radius-sm);
  color: inherit;
  position: relative;
}

.event-card:hover {
  background: #1a1a1a;
  cursor: pointer;
}

/* 左端の「日付バッジ」 */
.event-card-date {
  font-size: var(--fz-13);
  font-weight: 600;
  color: #aaa;
  background: #1a1a1a;
  border-radius: var(--radius-sm);

  width: 110px;
  min-height: 40px;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;      /* 横中央 */

  text-align: center;
  line-height: 1.2;
  padding: 4px 6px;
  flex-shrink: 0;
}

.date-start {
  font-size: var(--fz-13);
  align-self: flex-start; /* ← 2行目だけ左寄せ */
  margin-left: 4px;
  margin-right: 4px;
}
.date-end {
  font-size: var(--fz-13);
  align-self: flex-end; /* ← 2行目だけ右寄せ */
  margin-left: 4px;
  margin-right: 4px;
}

/* （オプション）日付バッジだけ縁取りしたいとき用 */
.event-card-date.is-applied-date {
  border: 2px solid #2a82d0;
  box-sizing: border-box;
}

/* タイトル/大学名の縦並び（真ん中のテキスト領域） */
.event-card-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.event-card-details .title {
  font-size: var(--fz-16);
  font-weight: 600;
  color: #fff;
}

.event-card-details .university {
  font-size: var(--fz-14);
  color: #888;
}

/* ===== 申込済みイベント（カード全体に淡い青枠） ===== */
.event-card.is-applied {
  border: 1px solid rgba(42, 130, 208, 0.6);
  background: rgba(42, 130, 208, 0.08);
}

.event-card.is-applied:hover {
  background: rgba(42, 130, 208, 0.16);
}

/* 申込済みバッジ（カード上部に丸いラベル） */
.event-card.is-applied .applied-label {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(42, 130, 208, 0.9);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}

@media (max-width:600px) {
  .event-card.is-applied .applied-label {
    top: -8px;
    font-size: 10px;
    padding: 3px 8px;
  }
}

/* ===== カレンダービュー ============================================== */
.calendar {
  background: #16181c;
  border-radius: var(--radius-lg);
  padding: var(--space-9);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-9);
  gap: 10px;
}

.calendar-header .month-year {
  font-size: var(--fz-18);
  font-weight: 600;
  flex: 1;
  text-align: center;
}

.nav-btn,
.today-btn {
  background: none;
  border: 1px solid #333;
  color: #ddd;
  font-size: var(--fz-14);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all .2s;
}

.nav-btn {
  padding: 8px 10px;
}

.nav-btn:hover,
.today-btn:hover {
  background: #222;
  color: #fff;
}

.nav-btn:disabled {
  color: #555;
  cursor: not-allowed;
  background: none;
}

.weekdays,
.days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
}

.weekdays div {
  font-size: var(--fz-12);
  color: #888;
  padding-bottom: 10px;
}

/* 各日セル */
.day-cell {
  font-size: var(--fz-14);
  padding: 8px 0;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .2s, color .2s;
  position: relative;
}

.day-cell:hover {
  background: #222;
}

.day-cell.other-month {
  color: #555;
}

/* 今日：青枠 */
.day-cell.today {
  border: 1px solid var(--color-primary);
}

/* 選択中：白背景＋黒文字 */
.day-cell.selected {
  background: #ffffff;
  color: #111827;
  font-weight: 700;
}

/* === イベントドット（共通形状） === */
.day-cell.has-event::after,
.day-cell.has-event-applied::after,
.day-cell.has-event-notapplied::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 9999px;
}

/* 申込済み日 → 青ドット */
.day-cell.has-event-applied::after {
  background: var(--color-primary);
}

/* 申し込んでいない日 → グレードット */
.day-cell.has-event-notapplied::after {
  background: #6b7280;
}

/* 選択されていてもドットは見えるように（白背景でもOKな色） */
.day-cell.selected.has-event-applied::after {
  background: var(--color-primary);
}

.day-cell.selected.has-event-notapplied::after {
  background: #4b5563;
}

/* カレンダーの下に出す「その日のイベント一覧」 */
#calendar-events-container {
  margin-top: var(--space-9);
  padding-top: var(--space-9);
  border-top: 1px solid var(--color-border);
}

/* 日別一覧の1行 */
.calendar-event-item {
  display: flex;
  align-items: center;
  gap: var(--space-7);
  padding: var(--space-7) 0;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  border-radius: var(--radius-sm);
  background: transparent;
  transition: background .2s;
}

.calendar-event-item:hover {
  background: #1a1a1a;
}

/* 左端「時間バッジ」 */
.calendar-event-item .time {
  font-size: var(--fz-15);
  font-weight: 600;
  color: #aaa;
  background: #1a1a1a;
  border-radius: var(--radius-sm);
  width: 65px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* タイトル/大学名（中央のテキスト） */
.calendar-event-item .details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.calendar-event-item .title {
  font-size: var(--fz-16);
  font-weight: 600;
  color: #fff;
}

.calendar-event-item .university {
  font-size: var(--fz-14);
  color: #888;
}

/* その日に予定が無い場合のメッセージ */
#no-events-msg {
  text-align: center;
  color: #888;
  padding: 20px;
}

/* ===== リスト右側にボタン領域を確保 ===================== */
.event-card-link {
  display: flex;
  align-items: center;
  gap: var(--space-7);
  text-decoration: none;
  color: inherit;
  flex: 1;
}

.event-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* ===== 申込ボタン ============================ */
.apply-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  font-size: var(--fz-15);
  font-weight: 700;
  color: #111;
  background: #fff;
  border: none;
  border-radius: 9999px;
  box-shadow: 0 3px 0 #e5e7eb;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.apply-btn:hover {
  background: #f3f4f6;
  transform: translateY(-1px);
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.1);
}

/* 準備中（受付前） */
.apply-btn.is-before,
.apply-btn.is-before:hover,
.apply-btn.is-before:focus {
  background: #b0b5bb !important;
  color: #111 !important;
  box-shadow: 0 2px 0 #9ca3af !important;
  cursor: default;
  pointer-events: none;
  transform: none;
}

/* 締切済（無効・濃いグレー） */
.apply-btn.is-closed,
.apply-btn.is-closed:hover,
.apply-btn.is-closed:focus,
.apply-btn[aria-disabled="true"] {
  background: #6b7280;
  color: #e5e7eb;
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
}

/* カレンダー日別一覧の右側アクション領域 */
.calendar-event-actions {
  margin-left: auto;
}

/* ===== スマホ時：日付を縦改行＆中央揃え、幅をさらに狭く ===== */
@media (max-width:600px) {
  .event-card-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 60px;
    height: auto;
    padding: 6px 0;
    text-align: center;
    line-height: 1.25;
    font-size: var(--fz-14);
  }

  .event-card-date .date-start,
  .event-card-date .date-tilde,
  .event-card-date .date-end {
    display: block;
  }
}

/* ===== 追加：イベント名の横に出す「【申込済み】」 ===== */
.applied-inline {
  display: inline-block;
  margin-left: 6px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(42, 130, 208, 1);
  vertical-align: middle;
}



/* ==========================================================
   LIGHT THEME OVERRIDES (event.css)
   data-theme="light" のとき、黒↔白を入れ替える（白は少し濃いめ）
========================================================== */
:root[data-theme="light"] body {
  background: #eef2f7;           /* ちょい濃い白（目に優しい） */
  color: #111827;
}

/* メイン領域が黒固定されてる場合に勝つ */
:root[data-theme="light"] .main {
  background: transparent !important;
}

/* セクション全体（必要なら） */
:root[data-theme="light"] .event-section {
  background: transparent;
}

/* 上部コントロール（既に変わってるならそのままでもOK） */
:root[data-theme="light"] .control label {
  color: #334155;
}

:root[data-theme="light"] .select-wrap select {
  background: #eef2f7;           /* 濃いめ白 */
  color: #111827;
  border: 1px solid #cbd5e1;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7);
}
:root[data-theme="light"] .select-wrap .select-caret {
  color: #64748b;
}

/* ===== リストカード ===== */
:root[data-theme="light"] .event-card {
  background: #f7f9fc;           /* 白寄りカード */
  border-bottom: 1px solid #e5e7eb;
}
:root[data-theme="light"] .event-card:hover {
  background: #eef2f7;
}

:root[data-theme="light"] .event-card-date {
  background: #eef2f7;
  color: #334155;
}

:root[data-theme="light"] .event-card-details .title {
  color: #111827;
}
:root[data-theme="light"] .event-card-details .university {
  color: #64748b;
}

/* ===== カレンダー ===== */
:root[data-theme="light"] .calendar {
  background: #f7f9fc;
}
:root[data-theme="light"] .weekdays div {
  color: #64748b;
}

:root[data-theme="light"] .day-cell:hover {
  background: #eef2f7;
}
:root[data-theme="light"] .day-cell.other-month {
  color: #94a3b8;
}

/* 日別イベント一覧 */
:root[data-theme="light"] .calendar-event-item:hover {
  background: #eef2f7;
}
:root[data-theme="light"] .calendar-event-item .time {
  background: #eef2f7;
  color: #334155;
}
:root[data-theme="light"] .calendar-event-item .title {
  color: #111827;
}
:root[data-theme="light"] .calendar-event-item .university,
:root[data-theme="light"] #no-events-msg {
  color: #64748b;
}

/* 申込ボタン系（白黒以外は基本そのまま、必要最低限だけ） */
:root[data-theme="light"] .apply-btn.is-closed,
:root[data-theme="light"] .apply-btn.is-closed:hover,
:root[data-theme="light"] .apply-btn.is-closed:focus,
:root[data-theme="light"] .apply-btn[aria-disabled="true"] {
  background: #9ca3af;
  color: #f8fafc;
}
:root[data-theme="light"] .apply-btn.is-before,
:root[data-theme="light"] .apply-btn.is-before:hover,
:root[data-theme="light"] .apply-btn.is-before:focus {
  background: #cbd5e1 !important;
  color: #111827 !important;
}



/* =========================
   上部フィルターUI（表示/対象/申込済み）
   ========================= */

.view-filter-container{
  display: flex;
  justify-content: center;
  margin-top: 18px;
  margin-bottom: 10px;
  padding: 0 12px;
}

/* ひとまとまりのバーにして整える */
.view-filter-container .controls{
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;

  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
}

/* ラベル＋セレクトを縦に（見た目が整う） */
.view-filter-container .control{
  display: grid;
  grid-template-rows: auto auto;
  gap: 6px;
}

.view-filter-container .control label{
  font-size: 12px;
  color: #9aa5b1;
  line-height: 1;
}

/* selectの幅と高さを統一（ここがキモ） */
.view-filter-container .select-wrap{
  position: relative;
}

.view-filter-container .select-wrap select{
  appearance: none;
  height: 38px;

  width: 150px;
  min-width: 150px;

  padding: 0 36px 0 12px;
  font-size: 14px;
  font-weight: 700;

  border-radius: 12px;
  border: 1px solid #3c4e60;
  background: #1b1e23;
  color: #cfd8dc;

  outline: none;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}

.view-filter-container .select-wrap select:hover{
  border-color: #355c9e;
}
.view-filter-container .select-wrap select:focus{
  border-color: #2a82d0;
  background: #161a20;
}

.view-filter-container .select-wrap .select-caret{
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #9aa5b1;
  pointer-events: none;
}

/* 申込済みボタン：同じ高さで揃える */
.view-filter-container .applied-page-btn{
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;

  border-radius: 12px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: .02em;

  border: 1px solid rgba(42,130,208,.35);
  background: rgba(42,130,208,.16);
  color: #cfe7ff;

  white-space: nowrap;
  margin-top: 18px; /* ← ラベル2段の分だけ下げて、selectと面を揃える */
}

.view-filter-container .applied-page-btn:hover{
  background: rgba(42,130,208,.22);
}

/* =========================
   モバイル：上部UIを完全縦並び
   ========================= */
@media (max-width:600px){

  /* 全体を縦方向に */
  .view-filter-container .controls{
    flex-direction: column;
    align-items: stretch;   /* 横幅を揃える */
    gap: 12px;
  }

  /* 各 control（表示 / 対象）も縦でOK */
  .view-filter-container .control{
    width: 100%;
  }

  /* select は横幅100% */
  .view-filter-container .select-wrap,
  .view-filter-container .select-wrap select{
    width: 100%;
    min-width: 100%;
  }

  /* 申込済みボタンも下に独立 */
  .view-filter-container .applied-page-btn{
    width: 100%;
    height: 42px;
    margin-top: 0;
    justify-content: center;
  }
}



/* ===== 申込済み：大学名 + 場所 をアイコン付き横並び ===== */
.event-meta{
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 6px;
  color: #9ca3af;         /* 薄グレー */
  font-size: var(--fz-14);
}

/* 1項目（🏫大学 / 📍場所） */
.event-meta .meta-item{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;           /* 省略を効かせる */
}

/* アイコン */
.event-meta .meta-item i{
  font-size: 14px;
  opacity: .9;
}

/* 長い文字は省略（必要なら） */
.event-meta .meta-item span{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

/* スマホは折り返してOK */
@media (max-width:600px){
  .event-meta{
    flex-wrap: wrap;
    gap: 10px 14px;
  }
  .event-meta .meta-item span{
    max-width: 100%;
  }
}








/* ==========================================================
   LIGHT THEME OVERRIDES (event.css) - extra for filter bar
========================================================== */
:root[data-theme="light"] .view-filter-container .controls{
  background: rgba(255,255,255,.85) !important;
  border-color: rgba(15,23,42,.10) !important;
  box-shadow: 0 10px 22px rgba(15,23,42,.06);
}

:root[data-theme="light"] .view-filter-container .control label{
  color: #64748b !important;
}

:root[data-theme="light"] .view-filter-container .select-wrap select{
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(15,23,42,.14) !important;
}

:root[data-theme="light"] .view-filter-container .select-wrap .select-caret{
  color: #64748b !important;
}

:root[data-theme="light"] .view-filter-container .applied-page-btn{
  border-color: rgba(37,99,235,.25) !important;
  background: rgba(37,99,235,.10) !important;
  color: #1d4ed8 !important;
}
:root[data-theme="light"] .view-filter-container .applied-page-btn:hover{
  background: rgba(37,99,235,.14) !important;
}






/* ===== event: 受付ボタン（受付中/締切済）を小さく 最終勝ち ===== */
.event-card-actions .apply-btn,
.event-card-actions .apply-inline{
  padding: 6px 10px !important;
  min-width: 84px !important;   /* もっと縮めたいなら 72〜80 */
  height: 32px !important;
  font-size: 12px !important;
  border-radius: 9999px !important;
  box-shadow: none !important;
}

/* スマホはさらに */
@media (max-width:600px){
  .event-card-actions .apply-btn,
  .event-card-actions .apply-inline{
    padding: 6px 9px !important;
    min-width: 76px !important;
    height: 30px !important;
    font-size: 12px !important;
  }
}

.event-card-actions .apply-btn,
.event-card-actions .apply-inline{
  min-width: auto !important;
}