/* リセット・共通スタイル */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  font-size: 11pt;
  height: 100%;
  color: #000;
  font-family: sans-serif;
  background-color: #f5f5f5;
}

/* 全体レイアウト */
.container {
  display: flex;
  height: 100vh;
  /* overflow: hidden;  ← これを外してスクロールが出るように */
}

/* 左カラム */
.left {
  background: #ffffff;
  border-right: 1px solid #ddd;
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden; /* 横スクロールを出さない */
  width: 50%;

  /* 文字が枠を超えないように強制折り返し */
  word-break: break-word;
  overflow-wrap: break-word; /* 古いブラウザ対応 */
}

/* 右カラム */
.right {
  background: #9e9999;
  overflow-x: auto;
  overflow-y: auto;
  width: 50%;
  padding: 20px;
}

.left input[type="text"],
.left textarea,
.left select {
  border-radius: 6px;
  border: 1px solid #ccc;
  padding: 8px;
  font-size: 0.95rem;
  width: 100%;
}
.left input[type="text"]:focus,
.left textarea:focus,
.left select:focus {
  outline: none;
  border-color: #80bdff;
  box-shadow: 0 0 4px rgba(0, 123, 255, 0.3);
}

/* ヘッダー */
.header-left {
  background-color: transparent;
  text-align: center;
  border-bottom: none;
  margin-bottom: 20px;
  padding-bottom: 20px;
}
.header-left h1 {
  font-size: 28px;
  line-height: 1.2;
  margin-bottom: 6px;
}
.header-left .smart {
  color: #000;
  font-family: "Istok Web", sans-serif;
  font-size: 28px;
  font-weight: bold;
}
.header-left .dash {
  font-family: "Istok Web", sans-serif;
  font-size: 28px;
  margin: 0 5px;
}
.header-left .cv {
  color: #2cddb4;
  font-family: "Istok Web", sans-serif;
  font-size: 28px;
  font-weight: bold;
}
.header-left h2 {
  font-family: "Istok Web", sans-serif;
  font-size: 16px;
  color: #333;
  margin-top: 8px;
}

/* セクション見出し */
.section-title {
  margin-top: 25px;
  font-size: 1.1rem;
  font-weight: bold;
  color: #2c3e50;
  padding-bottom: 4px;
  border-bottom: 2px solid #2c3e50;
  margin-bottom: 12px;
}

/* フォーム関連 */
.form-group {
  margin-bottom: 20px;
}
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}
.form-col {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
}
label {
  font-weight: bold;
  margin-bottom: 4px;
  font-size: 0.85rem;
}
.simple-textarea {
  min-height: 80px;
  font-size: 0.95rem;
  resize: vertical;
}

/* ボタン */
.btn-group {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.btn-group button,
#download-pdf,
#download-uploaded-file,
#bulk-generate-btn {
  padding: 8px 16px;
  border: 1px solid transparent;
  cursor: pointer;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: bold;
  transition: background-color 0.2s, border-color 0.2s;
}

/* PDFダウンロードボタン */
#download-pdf {
  background-color: #28a745;
  color: #fff;
  border-color: #28a745;
  margin: 0 auto;
  display: inline-block;
}
#download-pdf:hover:enabled {
  background-color: #218838;
  border-color: #1e7e34;
}
#download-pdf:disabled {
  background-color: #ccc;
  border-color: #ccc;
  cursor: not-allowed;
}

/* 利用規約 - 高さを短く(例:16vh) & 横溢れを防ぎつつスクロール */
.terms-box {
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  padding: 10px;
  margin-top: 16px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  max-height: 16vh; /* 画面高の約1/6～1/5程度 */
  overflow-y: auto; /* 縦スクロール */
  overflow-x: hidden; /* 横にはみ出さない */
  word-break: break-word; /* 強制折り返し */
}

/* ズーム操作ボタン */
.zoom-controls {
  text-align: center;
  margin-bottom: 1em;
}
.zoom-controls button {
  font-size: 0.9rem;
  padding: 6px 14px;
  margin: 0 5px;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  font-weight: bold;
  background: linear-gradient(135deg, #42a5f5, #478ed1);
  color: #fff;
  transition: transform 0.2s, opacity 0.2s;
}
.zoom-controls button:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

/* 右カラム プレビュー (A4固定) */
.resume-pages-wrap {
  transform-origin: top left;
}
.resume-page {
  width: 210mm;
  height: 297mm; /* A4縦 */
  margin: 0 auto 20px;
  padding: 10mm;
  box-sizing: border-box;
  background: #fff;
}
.preview-title {
  text-align: center;
  font-size: 16pt;
  font-weight: bold;
  margin-top: 0;
  margin-bottom: 10px;
}
.top-right {
  text-align: right;
  margin-bottom: 10px;
}
.preview-section-title {
  font-weight: bold;
  font-size: 12pt;
  margin: 10px 0 5px;
  text-decoration: underline;
}
.summary-block {
  width: 100%;
  white-space: pre-wrap;
  word-wrap: break-word;
  box-sizing: border-box;
}
#input-summary {
  overflow: hidden;
  resize: none;
}
.license-table,
.lang-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin-bottom: 8px;
}
.license-table th,
.license-table td,
.lang-table th,
.lang-table td {
  border: 1px solid #000;
  padding: 4px;
  text-align: center;
  vertical-align: middle;
  font-size: 0.9rem;
}
.career-format-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}
.career-format-table th,
.career-format-table td {
  border: 1px solid #000;
  padding: 8px;
  vertical-align: top;
  word-wrap: break-word;
}
.career-format-table thead th {
  background-color: #d9d9d9;
}
#career-container .sub-section,
#license-container .sub-section,
#lang-container .sub-section {
  border-top: 1px solid #000;
  margin-top: 10px;
  padding-top: 10px;
  margin-bottom: 10px;
}

/* 職務要約の文字数カウンター */
#char-counter {
  font-size: 0.85rem;
  color: #666;
  text-align: right;
  margin-top: -5px;
}

/* 生成中のスピナー */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-top-color: #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 8px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 自己PR自動生成ボタン */
#generate-pr {
  background: linear-gradient(135deg, #42a5f5, #478ed1);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  padding: 10px 18px;
  cursor: pointer;
  transition: background-color 0.3s, opacity 0.3s;
}
#generate-pr:hover {
  opacity: 0.9;
}

/* モーダル（共通） */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none; /* 初期は非表示 */
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.modal-content {
  background: #fff;
  padding: 20px 30px;
  border-radius: 10px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
  animation: fadeInUp 0.4s ease forwards;
  max-height: 80vh;
  overflow-y: auto;
}
@keyframes fadeInUp {
  0% {
    transform: translateY(30px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}
.modal-content h2 {
  margin-bottom: 16px;
  text-align: center;
}
.modal-close-btn {
  background: #ccc;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 0.85rem;
  margin-left: 8px;
}
.modal-close-btn:hover {
  background: #bbb;
}
/* モーダルのボタンの配置を調整 */
.modal-buttons {
  margin-top: 12px;
  text-align: center;
}

/* 職務経歴 例文モーダル */
.career-example-list {
  margin-top: 12px;
}
.example-block {
  background-color: #fafafa;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 6px;
}
.example-block p {
  font-size: 0.9rem;
  margin-bottom: 6px;
}

/* 例文使用ボタン */
.use-summary-btn,
.use-example-btn,
.use-skill-btn,
.use-pr-example-btn {
  background: linear-gradient(135deg, #fa8b0c, #f6c667);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 8px 12px;
  font-size: 0.85rem;
  transition: transform 0.3s, opacity 0.3s;
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.15);
}
.use-summary-btn:hover,
.use-example-btn:hover,
.use-skill-btn:hover,
.use-pr-example-btn:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

/* 自己PRの文字数カウンター */
#pr-char-counter {
  font-size: 0.85rem;
  color: #666;
  text-align: right;
  margin-top: -5px;
}

/* --- 職務経歴, 免許・資格, 語学の追加・削除ボタンをシンプルにする --- */

/* 追加ボタン */
#add-career-row,
#add-license-row,
#add-lang-row {
  /* サイズ（paddingなど）は .btn-group に既に指定されているので変更しない */
  background-color: #007bff; /* シンプルなブルー */
  border: 1px solid #007bff; /* ボーダーも同色 */
  color: #fff; /* 文字色を白に */
  border-radius: 20px; /* 既存radiusを活かす */
  transition: background-color 0.2s, opacity 0.2s;
}

#add-career-row:hover,
#add-license-row:hover,
#add-lang-row:hover {
  background-color: #0056b3; /* ホバー時は濃いめのブルー */
  opacity: 0.9; /* ほんの少し暗くなる */
}

/* 削除ボタン */
#remove-career-row,
#remove-license-row,
#remove-lang-row {
  background-color: #dc3545; /* シンプルなレッド */
  border: 1px solid #dc3545;
  color: #fff;
  border-radius: 20px;
  transition: background-color 0.2s, opacity 0.2s;
}

#remove-career-row:hover,
#remove-license-row:hover,
#remove-lang-row:hover {
  background-color: #c82333; /* ホバー時は濃いめのレッド */
  opacity: 0.9;
}
