/* チェックイン機能のスタイル */

/* ==============================================================================
   チェックイン入力画面
   ============================================================================== */
.check-in-new-container {
  max-width: 400px;
  margin: 0 auto;
  padding: 20px;
}

/* ヘッダー部分 */
.check-in-header {
  text-align: center;
  margin-bottom: 24px;
}

.check-in-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #1877f2 0%, #0056b3 100%);
  border-radius: 50%;
  margin-bottom: 12px;
}

.check-in-icon svg {
  color: #fff;
}

.check-in-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1c1e21;
  margin: 0 0 8px 0;
}

.check-in-description {
  color: #606770;
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.5;
}

/* メインアクション（チェックインボタン） */
.check-in-main-action {
  margin-top: 24px;
}

/* オプションセクション */
.check-in-optional-section {
  background: #f7f7f7;
  border-radius: 12px;
  padding: 16px;
}

.optional-section-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1c1e21;
  text-align: center;
  margin: 0 0 8px 0;
}

.check-in-comment-hint {
  font-size: 0.8rem;
  color: #606770;
  text-align: center;
  margin: 0 0 16px 0;
  line-height: 1.5;
}

.check-in-optional-fields {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

/* 写真フィールド */
.check-in-photo-field {
  flex-shrink: 0;
}

.check-in-photo-preview {
  width: 80px;
  height: 80px;
  background: #fff;
  border: 2px dashed #ddd;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s;
}

.check-in-photo-preview:hover {
  border-color: #1877f2;
}

.check-in-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.check-in-photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #999;
}

.check-in-photo-placeholder svg {
  color: #ccc;
}

.check-in-photo-placeholder span {
  font-size: 0.7rem;
}

/* コメントフィールド */
.check-in-comment-field {
  flex: 1;
}

.check-in-comment-input {
  width: 100%;
  height: 80px;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.9rem;
  resize: none;
  font-family: inherit;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.check-in-comment-input:focus {
  outline: none;
  border-color: #1877f2;
}

.check-in-comment-input::placeholder {
  color: #999;
}

/* 注意文 */
.check-in-caution {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.75rem;
  color: #e74c3c;
  margin: 16px 0 0 0;
  line-height: 1.4;
  background: #fef5f5;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #fce4e4;
}

.check-in-caution svg {
  flex-shrink: 0;
  margin-top: 1px;
}

/* ==============================================================================
   コンテナ共通
   ============================================================================== */

/* コンテナ共通 */
.check-in-container,
.check-ins-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

/* ==============================================================================
   チェックイン詳細ページ（釣果詳細と同じレイアウト）
   ============================================================================== */

/* PC版: 上寄せに統一 */
body.with-header.form-page:has(.check-in-show-container) .main-content {
  align-items: flex-start;
}

/* 詳細ページコンテナ */
.check-in-show-container {
  width: 100%;
  max-width: min(90%, 600px);
  margin: 20px auto;
  padding-bottom: 40px;
}

/* 詳細ページメインコンテンツ */
.check-in-details {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* スマホ対応 */
@media (max-width: 768px) {
  body.with-header.form-page:has(.check-in-show-container) .main-content {
    align-items: flex-start;
  }

  .check-in-show-container {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
  }

  .check-in-details {
    border-radius: 0;
    box-shadow: none;
  }
}

/* チェックイン詳細ページ（旧スタイル互換） */
.check-in-detail {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.check-in-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.check-in-detail-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #1877f2 0%, #0056b3 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.check-in-detail-icon svg {
  color: #fff;
}

.check-in-detail-title {
  flex: 1;
}

.check-in-detail-title h1 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1c1e21;
  margin: 0 0 2px 0;
}

.check-in-detail-time {
  font-size: 0.8rem;
  color: #999;
}

.check-in-delete-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  color: #999;
  transition: all 0.2s ease;
}

.check-in-delete-btn:hover {
  background: #fee;
  border-color: #e74c3c;
  color: #e74c3c;
}

.check-in-map {
  margin-bottom: 12px;
  border-radius: 8px;
  overflow: hidden;
}

/* ===========================================
   日の出・潮・日の入り・グラフ統合ブロック
   =========================================== */

.tide-info-block {
  background: linear-gradient(135deg, #e8f4fd 0%, #fef9e7 50%, #e8f4fd 100%);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

/* ブロック内の潮位グラフは背景を透明に */
.tide-info-block .tide-graph-section {
  background: transparent;
  padding: 0;
  margin-bottom: 0;
  border-radius: 0;
}

.tide-info-block .tide-graph-container {
  position: relative;
  height: 50px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  margin-bottom: 12px;
}

.tide-info-block .tide-graph-svg {
  width: 100%;
  height: 100%;
}

/* 日の出・潮・日の入り統合表示 */
.sun-tide-compact {
  padding: 0 0 8px 0;
  border-top: none;
  margin-top: 0;
}

.sun-tide-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.sun-item,
.tide-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

/* クリック可能な日の出・日の入り */
button.sun-item.sun-item-clickable {
  background: none;
  border: none;
  padding: 6px;
  margin: 0;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s;
  font-family: inherit;
}

button.sun-item.sun-item-clickable:hover {
  background: rgba(0, 0, 0, 0.05);
}

button.sun-item.sun-item-clickable:active {
  background: rgba(0, 0, 0, 0.1);
}

.sun-item svg,
.tide-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sun-tide-label {
  font-size: 0.65em;
  color: #6b7280;
  font-weight: 500;
}

.sun-tide-value {
  font-size: 0.85em;
  font-weight: 600;
  color: #1f2937;
}

/* モバイル対応 */
@media (max-width: 640px) {
  .tide-info-block {
    padding: 10px;
    border-radius: 10px;
  }

  .tide-info-block .tide-graph-section {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
  }

  .sun-tide-compact {
    padding: 0 0 6px 0;
  }

  .sun-item svg,
  .tide-item svg {
    width: 18px;
    height: 18px;
  }

  .sun-tide-label {
    font-size: 0.6em;
  }

  .sun-tide-value {
    font-size: 0.75em;
  }
}

/* スマホ表示時はラベル非表示 */
@media (max-width: 480px) {
  .sun-tide-label {
    display: none;
  }
}

/* 潮位グラフ */
.tide-graph-section {
  background: linear-gradient(180deg, #fff8e1 0%, #e3f2fd 100%);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.tide-graph-container {
  position: relative;
  height: 50px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  margin-bottom: 20px;
}

.tide-graph-svg {
  width: 100%;
  height: 100%;
}

.tide-current-indicator {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: #f44336;
  font-weight: 600;
  white-space: nowrap;
}

.tide-times-row {
  display: flex;
  justify-content: space-around;
  font-size: 11px;
  color: #666;
  flex-wrap: wrap;
  gap: 8px;
}

/* クリック可能な潮位表示 */
button.tide-times-row.tide-times-clickable {
  width: 100%;
  background: none;
  border: none;
  padding: 8px;
  margin: 0;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s;
  font-family: inherit;
}

button.tide-times-row.tide-times-clickable:hover {
  background: rgba(0, 0, 0, 0.05);
}

button.tide-times-row.tide-times-clickable:active {
  background: rgba(0, 0, 0, 0.1);
}

.tide-time-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}

.tide-time-label {
  font-weight: 600;
  font-size: 10px;
}

/* 満潮ラベル（青系） */
.tide-time-item.high-tide .tide-time-label {
  color: #1976D2;
}

/* 干潮ラベル（オレンジ系） */
.tide-time-item.low-tide .tide-time-label {
  color: #e65100;
}

.tide-time-value {
  font-size: 12px;
  color: #333;
  font-weight: 600;
}

.tide-level-value {
  font-size: 10px;
  color: #666;
}

/* 潮位データ取得失敗時のメッセージ */
.tide-graph-unavailable {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 12px;
  text-align: center;
}

.tide-graph-unavailable p {
  margin: 0;
  font-size: 0.85rem;
  color: #666;
}

.check-in-content,
.check-in-detail-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

.check-in-image {
  flex-shrink: 0;
}

.check-in-image > img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
}

.check-in-comment {
  flex: 1;
  padding: 10px 12px;
  background: #f5f5f5;
  border-radius: 8px;
}

.check-in-comment p {
  margin: 0;
  font-size: 0.9rem;
  color: #444;
  line-height: 1.5;
}

/* 付近のチェックイン */
.nearby-check-ins {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.nearby-check-ins h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: #1c1e21;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f0f0;
}

.nearby-check-ins h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 2px;
}

.nearby-check-ins.empty {
  text-align: center;
  padding: 40px 20px;
}

.nearby-check-ins.empty h2 {
  justify-content: center;
}

.nearby-check-ins.empty h2::before {
  display: none;
}

.no-nearby {
  color: #8e8e8e;
  font-size: 0.9rem;
  margin-top: 8px;
}

.nearby-check-ins-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 付近のチェックインカード */
.nearby-check-in-card {
  border: 1px solid #e8e8e8;
  border-radius: 16px;
  padding: 0;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.nearby-check-in-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* カードヘッダー（ユーザー情報） */
.nearby-card-header {
  padding: 12px 16px;
}

.nearby-user-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.nearby-user-link:hover .nearby-user-name {
  color: #1877f2;
}

.nearby-user-avatar {
  width: 36px;
  height: 36px;
  background: #f0f0f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nearby-user-avatar svg {
  color: #666;
}

.nearby-user-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nearby-user-name {
  font-size: 1rem;
  font-weight: 600;
  color: #1c1e21;
  transition: color 0.2s ease;
}

.nearby-check-in-time {
  font-size: 0.75rem;
  color: #999;
}

/* ユーザー統計（釣果数・図鑑） */
.nearby-user-stats {
  display: flex;
  padding: 10px 16px;
  gap: 16px;
  background: #fafafa;
  border-top: 1px solid #f0f0f0;
}

.nearby-stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
}

.nearby-stat-icon-svg {
  color: #888;
  flex-shrink: 0;
}

.nearby-stat-label {
  font-size: 0.8rem;
  color: #666;
}

.nearby-stat-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1c1e21;
}

/* クリック可能な統計（図鑑リンク） */
a.nearby-stat-link {
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

a.nearby-stat-link:hover {
  opacity: 0.7;
}

a.nearby-stat-link:hover .nearby-stat-value {
  color: #1877f2;
}

/* チェックインコンテンツ（画像・コメント） */
.nearby-check-in-content {
  padding: 12px 16px;
}

.nearby-check-in-image {
  margin-bottom: 10px;
}

.nearby-check-in-image > img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
}

.nearby-check-in-comment {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 10px 12px;
}

.nearby-check-in-comment p {
  margin: 0;
  font-size: 0.85rem;
  color: #555;
  line-height: 1.5;
}

/* チェックイン履歴一覧 */
.check-ins-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.check-ins-header-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #1877f2 0%, #0056b3 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.check-ins-header-icon svg {
  color: #fff;
}

.check-ins-header-content {
  flex: 1;
}

.check-ins-header-content h1 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1c1e21;
  margin: 0 0 2px 0;
}

.check-ins-count {
  font-size: 0.8rem;
  color: #999;
}

/* 履歴地図 */
.check-ins-map {
  margin-bottom: 20px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.history-map-marker {
  width: 28px;
  height: 28px;
  background: #1877f2;
  border: 2px solid #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.history-map-marker:hover {
  transform: scale(1.1);
}

.history-map-marker span {
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.check-ins-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.check-in-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.check-in-card-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  padding: 12px;
}

.check-in-card-link:hover {
  background: #f8f9fa;
}

.check-in-card-image {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  margin-right: 12px;
}

.check-in-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.check-in-card-image.placeholder {
  background: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
}

.check-in-card-image.placeholder .material-symbols-outlined {
  font-size: 24px;
  color: #999;
}

.check-in-card-content {
  flex: 1;
  min-width: 0;
}

.check-in-card-comment {
  margin: 0 0 4px 0;
  font-size: 0.875rem;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-in-card-comment.no-comment {
  color: #999;
  font-style: italic;
}

.check-in-card-time {
  font-size: 0.75rem;
  color: #999;
}

/* 空状態 */
.check-ins-empty {
  text-align: center;
  padding: 40px 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.check-ins-empty p {
  color: #666;
  margin-bottom: 16px;
}

/* ナビゲーション */
.check-in-navigation,
.check-ins-navigation {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

/* ボタン */
.button {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.875rem;
  cursor: pointer;
  border: none;
  text-align: center;
  background: #e9ecef;
  color: #333;
}

.button:hover {
  background: #dee2e6;
}

.button.is-primary {
  background: #007bff;
  color: #fff;
}

.button.is-primary:hover {
  background: #0056b3;
}

.button.is-danger {
  background: #dc3545;
  color: #fff;
}

.button.is-danger:hover {
  background: #c82333;
}

/* チェックインボタン */
.check-in-submit-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.check-in-submit-button:hover {
  background: linear-gradient(135deg, #0056b3 0%, #004094 100%);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
  transform: translateY(-1px);
}

.check-in-submit-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.check-in-submit-button:disabled {
  background: #ccc;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.check-in-submit-button svg {
  flex-shrink: 0;
}

/* ライトボックス（画像拡大表示） */
.check-in-image .lightbox-overlay,
.nearby-check-in-image .lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  cursor: pointer;
}

.check-in-image .lightbox-overlay.hidden,
.nearby-check-in-image .lightbox-overlay.hidden {
  display: none;
}

.check-in-image .lightbox-image,
.nearby-check-in-image .lightbox-image {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
}

/* チェックインフォームのフッターリンク */
.check-in-footer-link {
  text-align: center;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #e9ecef;
}

.check-in-history-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #666;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.check-in-history-link:hover {
  color: #1877f2;
  background: #f0f2f5;
}

.check-in-history-link svg {
  flex-shrink: 0;
}

/* アップグレード案内 */
.check-ins-upgrade-prompt {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
  border: 1px solid #ffc107;
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
}

.upgrade-prompt-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.upgrade-prompt-icon svg {
  color: #fff;
}

.upgrade-prompt-content {
  flex: 1;
  min-width: 0;
}

.upgrade-prompt-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: #856404;
  margin: 0 0 4px 0;
  line-height: 1.4;
}

.upgrade-prompt-plans {
  font-size: 0.8rem;
  color: #997a00;
  margin: 0;
}

.upgrade-prompt-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}

.upgrade-prompt-button:hover {
  background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
  box-shadow: 0 4px 8px rgba(255, 152, 0, 0.4);
  transform: translateY(-1px);
}

.upgrade-prompt-button svg {
  flex-shrink: 0;
}
