@charset "UTF-8";

/* 印刷ポップアップオーバーレイ */
.print-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
}

/* 印刷ポップアップコンテンツ */
.print-modal-clean {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 32px;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  color: #212529;
  min-width: 360px;
  max-width: 90vw;
  border: 1px solid #e9ecef;
}

/* タイトル */
.print-modal-clean h3 {
  margin: 0;
  margin-bottom: 8px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: #212529;
}

/* 説明文 */
.print-modal-clean p {
  margin: 0;
  margin-bottom: 28px;
  text-align: center;
  font-size: 14px;
  color: #6c757d;
}

/* ボタンコンテナ */
.print-modal-clean .button-container {
  margin: 24px 0;
}

.normal-print-btn,
.super-print-btn {
  /* transition を限定 */
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

/* 通常印刷ボタン */
.normal-print-btn {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 12px 0;
  padding: 16px 20px;
  background: #5B8BC1;
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(91, 139, 193, 0.2);
}

/* 超印刷ボタン */
.super-print-btn {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 12px 0;
  padding: 16px 20px;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(240, 147, 251, 0.2);
}

/* ボタンアイコン */
.btn-icon {
  font-size: 20px;
  margin-right: 16px;
}

/* ボタンテキスト */
.btn-text {
  text-align: left;
}

/* ボタンタイトル */
.btn-title {
  font-size: 16px;
  margin-bottom: 4px;
}

/* ボタン説明 */
.btn-desc {
  font-size: 13px;
  opacity: 0.9;
}

/* フッター */
.print-modal-footer {
  border-top: 1px solid #e9ecef;
  padding-top: 20px;
  margin-top: 8px;
}

/* キャンセルボタン */
.cancel-btn {
  background: #f8f9fa;
  color: #6c757d;
  padding: 12px 24px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  font-size: 14px;
  font-weight: 500;
}

/* ヒントテキスト */
.hint-text {
  text-align: center;
  font-size: 12px;
  color: #adb5bd;
  margin-top: 16px;
}

/* 以下、通常印刷のスタイル */
#print-settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  align-items: flex-start;
  justify-content: center;
  padding: 20px 0;
  overflow-y: auto;
}

#print-settings-modal.super-print-modal {
  /* 超印刷の場合は左より表示にする */
  justify-content: left;
  background: none;
  left: 15px;
  width: 340px;
  overflow: hidden;
  height: calc(100% - 160px);
  top: 80px;
}

#print-settings-modal .controls {
  background: #f9f9f9;
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 4px;
}

#print-settings-modal .control-group {
  margin-bottom: 15px;
}

#print-settings-modal .control-row {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

#print-settings-modal label {
  font-weight: 500;
  margin-right: 8px;
}

#print-settings-modal select,
#print-settings-modal button {
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 14px;
}

#print-settings-modal button {
  background: white;
  cursor: pointer;
}

#print-settings-modal button:hover {
  background: #f5f5f5;
}

#print-settings-modal .btn-primary {
  background: #007bff;
  color: white;
  border-color: #007bff;
}

#print-settings-modal .btn-primary:hover {
  background: #0056b3;
}

#print-settings-modal textarea {
  width: 100%;
  height: 60px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  resize: vertical;
  box-sizing: border-box;
}

#print-settings-modal .map-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px auto;
}

#print-settings-modal .mapion-logo img {
  height: 24px;
}

#print-settings-modal .qr-section {
  text-align: center;
  margin: 20px 0;
}

#print-settings-modal .print-memo {
  min-height: 20px;
  padding: 8px;
  background: #f8f9fa;
  border: 1px dashed #ccc;
  border-radius: 3px;
  margin-bottom: 20px;
}

#print-settings-modal .print-memo.empty {
  color: #999;
  font-style: italic;
}

#print-settings-modal .print-modal-content {
  height: auto;
  min-height: 1200px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-sizing: border-box;
  width: 100%;
  max-width: 848px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
}

#print-settings-modal .super-print-modal-content {
  height: auto;
  max-height: 100%;
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-sizing: border-box;
  width: 100%;
  max-width: 340px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
}

/* 印刷ボタン */
#print-settings-modal .print-button {
  background-color: #9fdfff;
  color: #003a66;
  border: 1px solid #66c1ff;
  padding: 6px 12px;
  border-radius: 3px;
  cursor: pointer;
}

#print-settings-modal .print-button:hover {
  background-color: #7fd0ff;
}

/* 印刷モーダルの地図コンテナ */
.print-map-container {
  width: 800px;
  height: 600px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

/* 著作権表示 */
.print-map-attribution {
  position: absolute;
  left: 0;
  bottom: 0;
  font-size: 10px;
  color: #000;
  background: none;
  padding: 2px 6px;
  pointer-events: none;
  text-shadow: 1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff;
}

/* --------------------------
印刷用スタイル
--------------------------*/
@media print {

  /* デフォルトページ設定（動的に変更される） */
  @page {
    size: landscape;
    margin: 0;
  }

  /* 通常印刷（既存の動作を維持） */
  html,
  body,
  .container,
  .map-container,
  #map {
    width: 297mm;
    /* A4横幅 */
    height: 210mm;
    /* A4縦幅 */
    margin: 0;
    padding: 0;
    overflow: hidden;
    position: absolute;
    top: 0;
    left: 0;
    transform: translate(0, 0);
  }

  .leaflet-container {
    width: 297mm;
    height: 210mm;
  }

  /* 超印刷用のスタイル（印刷ウィンドウ用） */
  .print-page {
    page-break-after: always;
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .print-page:last-child {
    page-break-after: auto;
  }

  .print-page img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
  }

  /* A4縦向き用 */
  .print-page.a4.portrait {
    width: 210mm;
    height: 297mm;
  }

  /* A4横向き用 */
  .print-page.a4.landscape {
    width: 297mm;
    height: 210mm;
  }

  /* A3縦向き用 */
  .print-page.a3.portrait {
    width: 297mm;
    height: 420mm;
  }

  /* A3横向き用 */
  .print-page.a3.landscape {
    width: 420mm;
    height: 297mm;
  }

  /* 印刷時に非表示にする要素 */
  .setting-menu,
  .search-container,
  .menu-toggle,
  .category-tags,
  .map-controls,
  #map-center-indicator,
  .elevation-info,
  .nearest-stations,
  .map-bottom-left-container,
  .bottom-left-controls,
  .bottom-left-control-row,
  .custom-popup,
  .maplibregl-popup,
  #print-settings-modal {
    display: none;
  }

}