/************************************************************
 * 全体2カラムレイアウト
 ************************************************************/
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  font-family: sans-serif;
  height: 100%;
}

.container {
  display: flex; /* 左右2カラム */
  height: 100vh; /* 画面全体の高さ */
  margin: 0 auto; /* 中央寄せ */
  overflow-x: auto; /* 画面幅が狭い場合に横スクロール */
}
.left,
.right {
  width: 50%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 20px 20px 20px;
}

/* 左カラム：フォーム */
.left {
  background-color: #fff;
  border-right: 1px solid #ccc;
  color: #2c3e50;
  position: relative;
  box-sizing: border-box;
}
.header-left {
  background-color: #fff;
  top: 0;
  margin-left: -20px;
  margin-right: -20px;
  margin-top: -20px;
  text-align: center;
  border-bottom: 1px solid #ccc;
  padding: 0;
  margin-bottom: 20px;
  z-index: 9999;
}
.header-left h1 {
  padding-top: 20px;
  padding-bottom: 0px;
}
.header-left .smart {
  color: #000;
  font-family: "Istok Web", sans-serif;
  font-size: 40px;
}
.header-left .dash {
  font-family: "Istok Web", sans-serif;
  font-size: 40px;
  margin: 0 5px;
}
.header-left .cv {
  color: #2cddb4;
  font-family: "Istok Web", sans-serif;
  font-size: 40px;
}
.header-left h2 {
  font-family: "Istok Web", sans-serif;
  font-size: 18px;
  color: #333;
  padding-top: 0%;
}
.header-left hr {
  margin: 10px auto;
  border: none;
  border-top: 1px solid #ccc;
  width: 90%;
}

.choice-box {
  border: 1px solid #000;
  margin: 0 auto;
  margin-top: 40px;
  text-align: left;
  font-size: 20px;
  color: #000;
  background-color: #f8f8f8;
}
.first-box {
  border: 1px solid #000;
  margin: 0 auto;
  height: 10%;
  margin-top: 40px;
  text-align: center;
  border-radius: 100px;
  font-size: 24px;
  color: #000;
  background-color: #d8fff9;
}
.upload-wrapper {
  margin-bottom: 20px;
  margin-left: 80px;
}
.upload-area {
  border: 2px dashed #ccc;
  border-radius: 6px;
  text-align: center;
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.3s, background-color 0.3s;
  height: 110px;
  width: 53%;
}
.upload-text {
  color: #888;
  font-size: 0.9rem;
}
.upload-area:hover {
  border-color: #aaa;
  background-color: #f8f8f8;
}
.form-group {
  margin-top: 30px;
  color: #000;
  font-size: 20px;
  border-radius: 10px;
  width: 75%;
  margin-left: 80px;
}
#bulk-generate-btn {
  margin-left: 80px;
}
.second-box {
  border: 1px solid #000;
  margin: 0 auto;
  height: 10%;
  margin-top: 60px;
  text-align: center;
  border-radius: 100px;
  font-size: 24px;
  color: #000;
  background-color: #d8fff9;
}
.name-group {
  width: 300px;
  margin-left: 80px;
  margin-top: 80px;
}
.furigana-group {
  width: 300px;
  margin-left: 140px;
  margin-top: 80px;
  margin-right: 30px;
}
.row-inline {
  display: flex;
  align-items: flex-start;
}
.birthday-box {
  margin-bottom: 20px;
  margin-left: 80px;
  margin-top: 70px;
}
.birthday-box label {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 16px;
}
.birthday-container {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 20px;
}
.year-month-select,
.day-age-select,
.gender-select {
  width: 100%;
  padding: 8px;
  font-size: 0.9rem;
  margin-bottom: 5px;
  border: 1px solid #c2bfbf;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.year-month-select {
  width: 60px;
  height: 36px;
}
.day-age-select {
  width: 60px;
  height: 36px;
}
.gender-select {
  width: 80px;
  height: 36px;
}
.gender-label {
  margin-left: 16px;
  margin-right: 4px;
}
.photo-upload-container {
  margin-top: 30px;
  width: 200px;
}
.photo-upload-container > label {
  font-weight: bold;
  display: block;
  margin-bottom: 8px;
}
.photo-placeholder {
  width: 120px;
  height: 180px;
  border: 2px dashed #ccc;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  font-size: 14px;
  color: #ccc;
  background-color: #fff;
}
label {
  display: block;
  font-weight: bold;
  margin-bottom: 6px;
  color: #2c3e50;
}
input[type="text"],
textarea,
input[type="file"] {
  width: 80%;
  padding: 8px;
  font-size: 0.9rem;
  margin-bottom: 5px;
  border: 1px solid #c2bfbf;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="text"]:focus,
textarea:focus,
input[type="file"]:focus {
  border-color: #3498db;
  box-shadow: 0 0 4px rgba(52, 152, 219, 0.5);
  outline: none;
}
textarea {
  min-height: 100px;
  resize: vertical;
}
.section-title {
  margin-top: 25px;
  font-size: 1.2rem;
  font-weight: bold;
  border-bottom: 2px solid #2c3e50;
  padding-bottom: 5px;
  margin-bottom: 10px;
  color: #2c3e50;
}
.post-code-group,
.address-furigana-group,
.address-group,
.tell-group,
.mail-group,
.t-post-code-group,
.t-address-furigana-group,
.t-address-group,
.t-tell-group,
.t-mail-group {
  font-size: 1.2rem;
  margin-left: 80px;
}
/* .post-code-group や .t-post-code-group の幅指定を削除する or オーバーライドする */
.post-code-group,
.t-post-code-group {
  /* width: 150px; ←これを削除 */
  /* 必要なら以下のように幅をautoにしておく */
  width: auto;
  margin-left: 80px; /* 既存のマージンはそのままでもOK */
}

/* 郵便番号入力欄とボタンを横並びで余裕を持たせる */
.postal-code-input-group {
  display: flex;
  align-items: center;
  gap: 8px; /* 入力欄とボタンの間に余白 */
  width: 100%; /* 親要素いっぱいに広げる(任意) */
}

/* 入力欄をある程度の幅にする（flex:1; で伸縮させてもOK） */
.postal-code-input-group input[type="text"] {
  flex: 1; /* 親幅に応じて伸縮 */
  min-width: 120px; /* これ以上は縮まらないようにする目安 */
}

/* ボタンは右側で固定長にしておく */
.auto-fill-btn {
  background: linear-gradient(135deg, #42e3f5, #60bde7);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.9rem;
  white-space: nowrap; /* ボタン内の文字が折り返されないようにする */
  transition: background-color 0.3s, opacity 0.3s;
}
.auto-fill-btn:hover {
  opacity: 0.9;
}

.address-furigana-group {
  width: 680px;
}
.address-group {
  width: 680px;
}
.tell-group {
  width: 340px;
}
.mail-group {
  width: 340px;
}
.t-post-code-group {
  width: 150px;
}

.post-code-group {
  width: 150px;
}

.t-address-furigana-group {
  width: 680px;
}
.t-address-group {
  width: 680px;
}
.t-tell-group {
  width: 340px;
}
.t-mail-group {
  width: 340px;
}

.form-inline {
  display: flex;
  gap: 8px;
}
.row-container {
  align-items: center;
  gap: 10px;
  border: 2px dashed #ccc;
  border-radius: 10px;
  padding: 12px;
  background: #fff;
  margin-bottom: 16px;
  align-items: flex-start;
}
.edu-year,
.edu-month,
.work-year,
.work-month,
.license-year,
.license-month {
  width: 60px;
  height: 30px;
  border-radius: 20px;
  text-align: center;
  border: 1px solid #c2bfbf;
}

.buttons-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}
.btn {
  display: inline-block;
  color: #fff;
  padding: 6px 12px;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  margin-right: 5px;
  transition: background 0.3s, opacity 0.3s;
}
.btn:hover {
  opacity: 0.9;
}
.btn-primary {
  background: #3498db;
}
.btn-danger {
  background: #e74c3c;
}
.btn-primary:hover {
  background: #2980b9;
}
.btn-danger:hover {
  background: #c0392b;
}
.pdf-btn-wrapper {
  text-align: center;
  margin-top: 40px;
}
.pdf-btn {
  margin-top: 20px;
  background: #2ecc71;
  font-size: 1rem;
  display: block;
  border-radius: 20px;
  margin: 0 auto;
}

/* 利用規約 */
.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: 15vh; /* 画面高の約1/2 */
  overflow-y: auto; /* 縦スクロール */
  overflow-x: hidden; /* 横にはみ出さない */
  word-break: break-word; /* 行折り返し */
}

/************************************************************
 * 右カラム：履歴書プレビュー (複数ページ) 
 ************************************************************/
.right {
  background-color: #d9d9d9;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  position: relative; /* 追加 */
}
.resume-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.resume-page {
  background-color: #fff;
  width: 210mm; /* A4幅 */
  height: 297mm; /* A4高さ */
  box-sizing: border-box;
  padding: 10mm;
  margin: 20px 0;
  position: relative;
  overflow: hidden;
  border: 2px solid #000;
}
.resume-content {
  margin: 0;
  padding: 0;
}
@media print {
  .resume-page {
    page-break-after: always;
  }
  .resume-page:last-child {
    page-break-after: auto;
  }
}
.resume-preview {
  color: #000;
}
.resume-content .title {
  font-size: 16pt;
  font-weight: bold;
  margin-bottom: 0;
}
.resume-content .date-right {
  text-align: right;
  font-size: 11pt;
  font-weight: normal;
  margin-right: 5mm;
}
.top-section {
  display: flex;
  align-items: end;
  gap: 10px;
}
.name-furigana-table {
  width: 80%;
  border: 2px solid #000;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  margin-bottom: 0;
}
tr.furigana-box td.furigana-label {
  width: 20px;
  height: 10px;
  padding: 5px;
  border-right: 1px solid #000;
  text-align: center;
  font-size: 10px;
  border-bottom: 1px dotted #000;
}
tr.furigana-box td.furigana-value {
  width: 60px;
  padding: 5px;
  text-align: center;
  font-size: 10px;
  border-bottom: 1px dotted #000;
}
tr.name-table td.name-label {
  width: 20px;
  height: 80px;
  padding: 5px;
  border-right: 1px solid #000;
  text-align: center;
}
tr.name-table td.name-value-left {
  width: 20px;
  height: 80px;
  padding: 5px;
  text-align: center;
  font-size: 20px;
}
.birthday-gender-table {
  width: 100%;
  border: 2px solid #000;
  border-collapse: separate;
  margin-top: 3%;
  table-layout: fixed;
  border-spacing: 0;
  border-spacing: 0;
}
td.birthday-label {
  width: 19.5%;
  height: 40px;
  border-right: 1px solid #000;
  text-align: center;
  font-size: 10px;
}
.birthday-value {
  width: 200px;
  border-right: 1px solid #000;
  text-align: center;
  font-size: 13px;
}
.gender-value {
  text-align: center;
  width: 10%;
}
.photo-box {
  width: 96px;
  height: 125px;
  overflow: hidden;
  text-align: center;
}
.photo-box img {
  width: 100%;
  height: auto;
  object-fit: cover;
}
.contact-info-table {
  width: 100%;
  border: 2px solid #000;
  margin-top: 3%;
  border-collapse: separate;
  border-spacing: 0;
}
.contact-info {
  height: 20px;
  text-align: center;
}
th.address-furigana-label {
  border-bottom: 1px dotted #000;
  border-right: 1px solid #000;
  width: 19.5%;
  font-size: 10px;
}
td.address-furigana-value {
  border-bottom: 1px dotted #000;
  border-right: 1px solid #000;
  width: 50%;
  font-size: 10px;
}
th.tel-label {
  width: 10%;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
  font-size: 10px;
}
td.tel-value {
  border-bottom: 1px solid #000;
  width: 120%;
  font-size: 10px;
}
th.address-label {
  border-right: 1px solid #000;
  height: 40px;
  font-size: 10px;
}
td.address-value {
  border-right: 1px solid #000;
  text-align: left;
  font-size: 15px;
}
th.email-label {
  border-right: 1px solid #000;
  font-size: 10px;
}
td.email-value {
  font-size: 10px;
  text-align: center;
}

.alt-contact-table {
  width: 100%;
  border: 2px solid #000;
  margin-top: 3%;
  border-spacing: 0;
}
.alt-contact-info {
  height: 20px;
  text-align: center;
}
th.alt-address-furigana-label {
  border-bottom: 1px dotted #000;
  border-right: 1px solid #000;
  width: 19.5%;
  font-size: 10px;
}
td.alt-address-furigana-value {
  border-bottom: 1px dotted #000;
  border-right: 1px solid #000;
  width: 50%;
  font-size: 10px;
}
th.alt-tel-label {
  width: 10%;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
  font-size: 10px;
}
td.alt-tel-value {
  border-bottom: 1px solid #000;
  width: 120%;
  font-size: 10px;
}
th.alt-address-label {
  border-right: 1px solid #000;
  height: 40px;
  font-size: 10px;
}
td.alt-address-value {
  border-right: 1px solid #000;
  text-align: left;
  font-size: 15px;
}
th.alt-email-label {
  border-right: 1px solid #000;
  font-size: 10px;
}

/* 学歴・職歴テーブル(右側) : 12行分 */
.education-table {
  width: 100%;
  border: 2px solid #000;
  margin-top: 3%;
  border-spacing: 0;
  text-align: center;
  height: 50%;
}
.education-info {
  height: 30px;
  text-align: center;
}
th.education-year {
  width: 15mm;
  height: 7mm;
  border-right: 1px dotted #000;
  font-size: 10px;
}
th.education-container-month {
  width: 15mm;
  height: 7mm;
  border-right: 1px dotted #000;
  font-size: 10px;
}
th.education-history {
  width: 80%;
  height: 7mm;
  font-size: 10px;
}
td.education-year-value {
  /* ここで dotted の点線・高さを統一 */
  border-right: 1px dotted #000;
  border-top: 1px dotted #000;
  height: 26.5px;
}
td.education-container-month-value {
  /* ここで dotted の点線・高さを統一 */
  border-right: 1px dotted #000;
  border-top: 1px dotted #000;
  height: 26.5px;
}
td.education-history-value {
  /* ここで dotted の点線・高さを統一 */
  border-top: 1px dotted #000;
  height: 26.5px;
}

/* 免許・資格テーブル(右側) : 6行分 */
.skill-table {
  width: 100%;
  border: 2px solid #000;
  margin-top: 3%;
  border-spacing: 0;
  text-align: center;
}
.skill-info {
  height: 30px;
  text-align: center;
}
th.skill-year {
  width: 15mm;
  height: 7mm;
  border-right: 1px dotted #000;
  font-size: 10px;
}
th.skill-container-month {
  width: 15mm;
  height: 7mm;
  border-right: 1px dotted #000;
  font-size: 10px;
}

td.skill-year-value {
  border-right: 1px dotted #000;
  border-top: 1px dotted #000;
  height: 40px;
}
td.skill-container-month-value {
  border-right: 1px dotted #000;
  border-top: 1px dotted #000;
  height: 40px;
}
td.skill-history-value {
  border-top: 1px dotted #000;
  height: 40px;
}

.motivation-table {
  width: 100%;
  border: 2px solid #000;
  margin-top: 3%;
}
th.motivation-label {
  height: 5mm;
  text-align: left;
  vertical-align: top;
  font-size: 10px;
}
td.motivation-value {
  height: 170px;
  text-align: left;
  vertical-align: top;
}
.pr-table {
  width: 100%;
  border: 2px solid #000;
  margin-top: 3%;
}
th.pr-label {
  height: 5mm;
  text-align: left;
  vertical-align: top;
  font-size: 10px;
}
td.pr-value {
  height: 170px;
  text-align: left;
  vertical-align: top;
}
.request-table {
  width: 100%;
  border: 2px solid #000;
  margin-top: 3%;
}
th.request-label {
  height: 5mm;
  text-align: left;
  vertical-align: top;
  font-size: 10px;
}
td.request-value {
  height: 170px;
  text-align: left;
  vertical-align: top;
}
table,
tr,
td,
th {
  page-break-inside: avoid;
}
/* ブロック（.block）単位で次ページへ移動 */
.block {
  margin-bottom: 20px;
}

/************************************************************
 * モーダル（共通）
 ************************************************************/
.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: 600px;
  width: 90%;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
  animation: fadeInUp 0.4s ease forwards;
}
@keyframes fadeInUp {
  0% {
    transform: translateY(30px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}
.modal-content h2 {
  margin-bottom: 16px;
  text-align: center;
}
.modal-buttons {
  text-align: center;
  margin-top: 12px;
}
.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;
}

/************************************************************
 * ボタンのUI（おしゃれなグラデーションなど）
 ************************************************************/
.open-modal-button {
  background: linear-gradient(135deg, #42e3f5, #60bde7);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  padding: 10px 18px;
  cursor: pointer;
  transition: background-color 0.3s, opacity 0.3s;
  margin-top: 8px;
  display: inline-block;
  margin-bottom: 2px;
}
.open-modal-button:hover {
  opacity: 0.9;
}
.generate-button {
  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-button:hover {
  opacity: 0.9;
}

/************************************************************
 * スピナー (生成中アニメーション)
 ************************************************************/
.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);
  }
}

/************************************************************
 * 追加：ズームコントロール
 ************************************************************/
/* ズーム操作ボタンを絶対配置し、上部中央に固定。z-indexを大きめに */
.zoom-controls {
  position: absolute;
  top: 0; /* 画面上部に固定（必要に応じて数値を調整） */
  left: 50%; /* 左右中央 */
  transform: translateX(-50%);
  z-index: 100; /* プレビューより前面に表示 */
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

/* プレビュー要素に上マージンを足して、ボタンと重ならないようにする */
.right .resume-pages {
  margin-top: 20px; /* ここで空ける高さを調整 */
}

.zoom-btn {
  background: linear-gradient(45deg, #42e3f5, #60bde7);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  width: 36px;
  height: 36px;
  cursor: pointer;
  transition: background-color 0.3s, opacity 0.3s;
}
.zoom-btn:hover {
  opacity: 0.9;
}
#zoom-level {
  font-size: 1rem;
  font-weight: bold;
}

.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);
  }
}
