@import "./css/common.css";

#title {
  text-align: center;
}



.photo {
  width: 100vw;
  height: auto;
  display: block;
}



/* index 画像を並べるコンテナ */
.index-container {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  justify-items: center;
}

/* 画像サイズは可変に */
.index-container img {
  width: 100%;
  height: auto;
  max-width: 300px;
}

/* スマホ表示時（幅768px以下） */
@media (max-width: 768px) {
  .index-container {
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    width: 95%;
    margin: 0 auto;
  }

  .index-container img {
    max-width: 100%;
  }
}

/* 通知バッジ（赤丸＋数字） */
.badge {
  position: absolute;
  top: -4px;
  right: 3px;
  background: #ff3b3b;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 50%;
  padding: 0 4px;
  box-sizing: border-box;
  pointer-events: none;
}

/* 通知リストのアイテム */
.notification-item {
  padding: 0.6em;
  border-bottom: 1px solid #ddd;
  cursor: pointer;
}

.notification-item:hover {
  background: #f5f5f5;
}

/* 未読お知らせ */
.notification-item.unread span {
  font-weight: bold;
  color: #1a1a1a;
}

/* 既読お知らせ */
.notification-item.read span {
  font-weight: normal;
  color: #aaa;
}

/* 未読お知らせバナー */
.unread-notif-banner {
  position: fixed;
  top: 100px;
  left: 0;
  right: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 0.5em;
  background: #fff3cd;
  color: #7a5000;
  border-left: 4px solid #f4c430;
  padding: 0.65em 1.1em;
  font-size: 0.95em;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
  user-select: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  font-family: "Noto Sans JP", "BIZ UDPGothic", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "sans-serif";
}

.unread-notif-banner:hover {
  background: #ffe89a;
}

.unread-notif-banner .banner-bell {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .unread-notif-banner {
    top: 60px;
    font-size: 0.88em;
    padding: 0.55em 0.9em;
  }
}

/* 詳細モーダル */
#notificationDetailModal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  padding: 1.2em;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  max-width: 400px;
  width: 90%;
}

#notificationDetailModal.show {
  display: block;
}

#notificationDetailModal .meta {
  font-size: 0.8em;
  color: #666;
  margin-top: 0.8em;
}



/* 通知リストのマーカーを消す */
#notificationList {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

#notificationList li {
  padding: 0.5em;
  border-bottom: 1px solid #ddd;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9em;
}

#notificationList li:hover {
  background: #f5f5f5;
}

/* 通知サムネイル */
.notification-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  flex: 0 0 44px;
}


/* メッセージ表示 */
#admin #n-msg {
  margin-top: 0.8em;
  font-size: 0.9em;
  color: #d00;
  text-align: center;
}

/* モーダル共通 */
.modal {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  height: 100%;
  background: linear-gradient(180deg, #f7fbff 0%, #ffffff 40%, #f4f7fb 100%);
  border-left: none;
  box-shadow: -10px 0 24px rgba(18, 38, 63, 0.15);
  color: #24344d;
  transform: translateX(100%);
  /* 初期状態は画面外 */
  transition: transform 0.3s ease-in-out, opacity 0.2s ease-out;
  z-index: 1000;
  padding: 15px;
  overflow-y: auto;
  opacity: 0;
}

.modal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, #2a9df4, #1f5aa5);
}

.modal h3 {
  margin: 6px 0 12px;
  font-size: 1.1em;
  letter-spacing: 0.03em;
  font-family: "Noto Sans JP", "BIZ UDPGothic", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
}

.modal p {
  line-height: 1.6;
}

.modal a {
  color: inherit;
  text-decoration: none;
}

.modal a:hover {
  text-decoration: underline;
}

/* モーダル内のボタンを縦一列に */
.modal button {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 10px;
  font-size: 14px;
  border: 1px solid #c6d6ea;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(20, 60, 110, 0.08);
  cursor: pointer;
  border-radius: 8px;
  text-align: center;
}

.modal button:hover {
  background: #eef5ff;
  border-color: #a9c4e6;
}

/* settingsModal: close button stays neutral, other buttons are highlighted */
#settingsModal .logoutBtn {
  background: linear-gradient(180deg, #ffffff 0%, #eaf3ff 100%);
  border-color: #9fbbe0;
  box-shadow: 0 6px 14px rgba(25, 70, 130, 0.18);
  font-weight: 600;
}

#settingsModal .logoutBtn:hover {
  background: linear-gradient(180deg, #f5faff 0%, #dfeeff 100%);
  border-color: #7fa3d8;
}

#settingsModal #closeSettings {
  background: #f6f6f6;
  border-color: #d7d7d7;
  box-shadow: none;
  font-weight: 500;
}

#settingsModal #closeSettings:hover {
  background: #ededed;
  border-color: #c9c9c9;
}


/* 表示状態 */
.modal.show {
  transform: translateX(0);
  opacity: 1;
}

/* 通知ボタン（右上配置） */
#header-menu {
  position: fixed;
  top: 20px;
  /* 上からの距離 */
  right: 20px;
  /* 右からの距離 */
  z-index: 1100;
  /* ヘッダーより前に出す */
}

#notificationBtn {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  position: relative;
  color: white;
}

.bell-icon {
  width: 36px;
  height: 36px;
}

#settingsBtn {
  background: none;
  border: none;
  font-size: 28px;
  /* アイコンを大きく */
  cursor: pointer;
  position: relative;
  color: #ffffff;

}

#settingsBtn:hover {
  color: #6d6d6d;
}

@media (max-width:768px) {
  #header-menu {
    top: 10px;
    right: 10px;
    font-size: 15px;
  }

  #notificationBtn,
  #settingsBtn {
    font-size: 23px;
    padding: 1px;
  }

  .bell-icon {
    width: 28px;
    height: 28px;
    margin-right: 9px;
  }
}


.live-section {
  margin: 15px auto;
  width: 90%;
  max-width: 600px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  font-family: sans-serif;
}

.team-formation-section {
  margin: 20px auto;
  width: 95%;
  max-width: 960px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  padding: 18px 0 18px;
}

.team-formation-header {
  padding: 0 20px 12px;
}

.team-formation-header h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  border-bottom: 2px solid #e5e5e5;
  padding-bottom: 8px;
}

.team-formation-table-wrapper {
  overflow-x: auto;
  padding: 0 16px;
}

.team-formation-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  text-align: center;
  font-family: "Yuji Syuku", sans-serif;
}

.team-formation-table thead th {
  padding: 14px 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1f1f1f;
  border-bottom: 3px solid #dcdcdc;
}

.team-formation-table tbody th {
  padding: 14px 10px;
  background: #f5f3ef;
  color: #111;
  font-weight: 700;
  border-right: 1px solid #e5e5e5;
}

.team-formation-table td {
  padding: 14px 10px;
  border: 1px solid #e5e5e5;
  background: #ffffff;
  font-size: 0.95rem;
  color: #222;
}

.team-formation-table tbody tr:nth-child(odd) td {
  background: #fcfcfc;
}

.team-formation-table tbody tr:last-child td {
  border-bottom: 1px solid #e5e5e5;
}

@media (max-width: 768px) {
  .team-formation-section {
    margin: 16px auto;
  }

  .team-formation-header h2 {
    font-size: 1rem;
  }

  .team-formation-table {
    min-width: 640px;
  }

  .team-formation-table thead th,
  .team-formation-table tbody th,
  .team-formation-table td {
    padding: 10px 8px;
    font-size: 0.88rem;
  }
}

.live-header {
  background: #333;
  color: #fff;
  padding: 6px 12px;
  font-size: 0.85em;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: #ff4d4d;
  border-radius: 50%;
  animation: blink 1s infinite;
}

@keyframes blink {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }

  100% {
    opacity: 1;
  }
}

.match-card {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.match-card:last-child {
  border-bottom: none;
}

.match-info .status-label {
  font-size: 0.65em;
  padding: 2px 5px;
  border-radius: 4px;
  margin-right: 4px;
}

.status-now {
  background: #ffeded;
  color: #ff4d4d;
  border: 1px solid #ff4d4d;
}

.status-soon {
  background: #eef9ff;
  color: #007bff;
  border: 1px solid #007bff;
}

.match-title {
  font-weight: bold;
  display: block;
  margin-top: 4px;
  font-size: 0.9em;
}

.match-time {
  font-size: 0.75em;
  color: #666;
}

@media (max-width: 768px) {
  .live-section {
    margin: 10px auto;
    width: 95%;
  }

  .live-header {
    padding: 5px 10px;
    font-size: 0.8em;
  }

  .match-card {
    padding: 8px 10px;
  }

  .match-title {
    font-size: 0.85em;
  }

  .match-time {
    font-size: 0.65em;
  }
}

#statusBannerContainer {
  width: 90%;
  max-width: 600px;
  margin: 8px auto;
  font-family: sans-serif;
}

.status-banner {
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status-banner.green {
  background-color: #f6ffed;
  border: 1px solid #b7eb8f;
  color: #389e0d;
}

.status-banner.red {
  background-color: #fff1f0;
  border: 1px solid #ffa39e;
  color: #cf1322;
}

.status-banner .category-name {
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 8px;
  font-size: 0.9em;
}

@media (max-width: 768px) {
  #statusBannerContainer {
    width: 95%;
    margin: 6px auto;
  }

  .status-banner {
    padding: 6px 10px;
    margin-bottom: 5px;
    font-size: 0.8rem;
  }

  .status-banner .category-name {
    padding: 1px 5px;
    margin-right: 6px;
    font-size: 0.85em;
  }
}
/* 画像拡大モーダル用スタイル */
    #imgModal {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.9);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 2000;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.3s ease;
      transform: none;
    }
    #imgModal.show {
      opacity: 1;
      pointer-events: auto;
      transform: none;
    }
    #imgModal .close {
      position: absolute;
      top: 20px;
      right: 40px;
      color: #fff;
      font-size: 40px;
      font-weight: bold;
      cursor: pointer;
      z-index: 2001;
      transition: color 0.2s;
    }
    #imgModal .close:hover,
    #imgModal .close:focus {
      color: #bbb;
    }
    #modalImg {
      max-width: 90%;
      max-height: 90vh;
      object-fit: contain;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    }

/* ===== 固定タスクバー ===== */
.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  border-top: 1px solid #e0e0e0;
}

/* モード切替トグル */
.taskbar-mode-toggle {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 5px 16px 4px;
  background: #f8f9fa;
  border-bottom: 1px solid #e8e8e8;
}

.mode-btn {
  flex: 1;
  max-width: 150px;
  padding: 3px 12px;
  border: 1.5px solid #ccc;
  border-radius: 20px;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  font-family: "Noto Sans JP", "BIZ UDPGothic", "Yu Gothic", sans-serif;
}

.mode-btn.active {
  background: #4cafef;
  color: #ffffff;
  border-color: #4cafef;
}

.mode-btn:not(.active):hover {
  background: #f0f0f0;
  border-color: #aaa;
}

/* タブアイテム行（横スクロール対応） */
.taskbar-items {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  height: 60px;
  align-items: stretch;
}

.taskbar-items::-webkit-scrollbar {
  display: none;
}

.taskbar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #999;
  font-size: 11px;
  flex: 1;
  min-width: 64px;
  height: 100%;
  transition: color 0.2s, background 0.2s;
  position: relative;
  gap: 3px;
  padding: 0 4px;
}

.taskbar-item svg {
  width: 24px;
  height: 24px;
  fill: #999;
  transition: fill 0.2s;
}

.taskbar-item span {
  font-family: "Noto Sans JP", "BIZ UDPGothic", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.taskbar-item.active {
  color: #4cafef;
}

.taskbar-item.active svg {
  fill: #4cafef;
}

.taskbar-item.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20%;
  width: 60%;
  height: 3px;
  background: #4cafef;
  border-radius: 0 0 3px 3px;
}

.taskbar-item:not(.active):hover {
  color: #666;
  background: #f5f5f5;
}

.taskbar-item:not(.active):hover svg {
  fill: #666;
}

.match-card {
  cursor: pointer;
}

.match-card:focus-visible {
  outline: 2px solid #4cafef;
  outline-offset: -2px;
}

.event-row {
  cursor: pointer;
}

.event-row:hover {
  background: #f7fbff;
}

.event-row:active {
  background: #eaf5ff;
}

.event-row:focus-visible {
  outline: 2px solid #4cafef;
  outline-offset: -2px;
}

.event-detail-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(14, 24, 38, 0.6);
  z-index: 2100;
  padding: 16px;
}

.event-detail-modal.show {
  display: flex;
}

.event-detail-dialog {
  width: min(560px, 100%);
  max-height: 85vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.2);
  padding: 16px 16px 14px;
  position: relative;
}

.event-detail-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #4d4d4d;
}

.event-detail-title {
  margin: 0 32px 12px 0;
  font-size: 1.2rem;
  font-family: sans-serif;
}

.event-detail-body {
  display: grid;
  gap: 8px;
  font-family: sans-serif;
}

.event-detail-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px;
  font-size: 0.95rem;
  line-height: 1.5;
  font-family: sans-serif;
}

.event-detail-item dt {
  font-weight: 700;
  color: #46627f;
  font-family: sans-serif;
}

.event-detail-item dd {
  margin: 0;
  color: #24344d;
  word-break: break-word;
  font-family: sans-serif;
}

@media (max-width: 768px) {
  .event-detail-modal {
    align-items: flex-end;
    padding: 8px;
  }

  .event-detail-dialog {
    width: 100%;
    max-height: 90dvh;
    border-radius: 14px 14px 0 0;
    padding: 14px 12px calc(12px + env(safe-area-inset-bottom));
  }

  .event-detail-close {
    top: 6px;
    right: 8px;
    font-size: 32px;
  }

  .event-detail-item {
    grid-template-columns: 1fr;
    gap: 2px;
    font-size: 0.9rem;
  }

  .event-detail-item dt {
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    color: #5d7894;
  }
}

/* タスクバー分のボディ下余白 */
body {
  padding-bottom: 96px;
}

@media (max-width: 768px) {
  .taskbar-item {
    font-size: 10px;
    min-width: 58px;
  }

  .taskbar-item svg {
    width: 22px;
    height: 22px;
  }

  .mode-btn {
    font-size: 11px;
  }
}

/* =====================================
   Google Drive Modal Styles
   ===================================== */

.google-drive-modal {
  display: none;
  position: fixed;
  z-index: 3000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease-in-out;
}

.google-drive-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.google-drive-modal-content {
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 900px;
  height: 85vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease-in-out;
}

.google-drive-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e0e0e0;
  background-color: #f8f9fa;
  border-radius: 12px 12px 0 0;
}

.google-drive-modal-header h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
}

.google-drive-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #666;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: color 0.2s ease;
}

.google-drive-modal-close:hover {
  color: #000;
}

.google-drive-modal-body {
  flex: 1;
  overflow: hidden;
  padding: 0;
}

.google-drive-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .google-drive-modal-content {
    width: 95%;
    max-width: 100%;
    height: 90vh;
    border-radius: 16px;
  }

  .google-drive-modal-header {
    padding: 12px 16px;
  }

  .google-drive-modal-header h2 {
    font-size: 1.1rem;
  }

  .google-drive-modal-close {
    font-size: 24px;
  }
}