/* =========================================================
   Common CSS
   全ツールで共通して利用するUI部品のスタイル
   - TitleBlock
   - UploadBlock
   - FileListBlock
   - ActionBlock
   - ProgressBlock
   - ResultBlock
   - DescriptionBlock
   ========================================================= */

/* タイトル帯 */
.tnm-header {
  background: linear-gradient(135deg, #e33, #ff4d4d);
  color: #fff;
  padding: 2rem;
  text-align: center;
  font-size: 1.8rem;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
}

/* コンテナ */
.tnm-container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 2rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* アップロードエリア */
.upload-area {
  border: 2px dashed #e33;
  border-radius: 12px;
  padding: 3rem 1rem;
  text-align: center;
  background: #fffafa;
  cursor: pointer;
  transition: all 0.3s ease;
}
.upload-area:hover {
  background: #ffecec;
  transform: scale(1.02);
}
.upload-icon { margin-bottom: 1rem; }
.upload-icon svg { width: 48px; height: 48px; }
.upload-label {
  display: block;
  font-size: 1.1rem;
  color: #333;
  margin-bottom: 0.8rem;
}
.custom-file-btn {
  display: inline-block;
  background: #f5f5f5;
  color: #333;
  padding: 0.8rem 1.2rem;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  border: 1px solid #ccc;
  transition: all 0.3s ease;
}
.custom-file-btn:hover {
  background: #e0e0e0;
  border-color: #999;
}
#tnmPdfFiles { display: none; }

/* ファイルリスト */
.file-list {
  margin-top: 1.5rem;
  background: #fff;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.sort-hint {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.8rem;
  text-align: left;
}
.file-item {
  display: grid;
  grid-template-columns: 1fr 120px 100px;
  align-items: center;
  padding: 0.8rem;
  border-bottom: 1px solid #eee;
  transition: background 0.2s;
  cursor: grab;
}
.file-item:hover { background: #f9f9f9; }
.file-info {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.icon { width: 24px; height: 24px; flex-shrink: 0; }
.file-size {
  font-size: 0.85rem;
  color: #666;
  text-align: right;
  padding-right: 1rem;
}
.delete-btn {
  background: #ff4d4d;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.3s ease;
}
.delete-btn:hover { background: #d93636; }
.total-size {
  text-align: right;
  margin-top: 1rem;
  font-size: 0.95rem;
  font-weight: bold;
  color: #666;
}

/* 実行ボタン */
.btn {
  display: block;
  width: 100%;
  margin-top: 2rem;
  background: #e33;
  color: #fff;
  padding: 1rem;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: bold;
}
.btn:hover { background: #c62828; transform: translateY(-2px); }

/* プログレスバー */
.progress-wrap { margin-top: 1rem; }
.progress-bar {
  width: 100%;
  height: 10px;
  background: #eee;
  border-radius: 6px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: #e33;
  transition: width 0.2s ease;
}
.status-line { margin-top: 0.6rem; font-size: 0.9rem; color: #666; }

/* スピナー */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #eee;
  border-top-color: #e33;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-top: 0.6rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===============================
   完了UI
   =============================== */
.complete-wrap { margin-top: 2rem; text-align: center; }
.complete-msg { font-size: 1rem; color: #333; margin-bottom: 0.8rem; }

.complete-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #4caf50;
  display: inline-block;
  position: relative;
  margin-bottom: 0.6rem;
}
.complete-icon::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 4px;
  border-left: 3px solid #fff;
  border-bottom: 3px solid #fff;
  transform: translate(-50%, -50%) rotate(-45deg);
}



/* ===============================
   警告UI
   =============================== */


.warning-icon {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 36px;           /* 三角の高さに合わせる */
  box-sizing: border-box;
  overflow: visible;
  font-family: Arial, sans-serif; /* フォント差を減らす */
}

.warning-icon::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0; margin: auto;
  width: 0; height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-bottom: 36px solid #f1c40f;
}

.warning-icon::after {
  content: '!';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) translateY(4px); /* 下に4px移動 */
  color: #333;
  font-weight: bold;
  font-size: 18px;
  line-height: 18px;
  white-space: nowrap;
}

/* 使わない */
/*
.warning-wrap { 
  margin-top: 1rem; 
  text-align: center; 
}

.warning-msg { 
  font-size: 1rem; 
  color: #333; 
  margin-bottom: 0.8rem; 
}
*/

/* ===============================
  失敗UI
   =============================== */
.error-icon {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ff6b6b, #e33);
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  box-sizing: border-box;
}

/* × を構成する2本の線（中央基準で回転） */
.error-icon::before,
.error-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56%;        /* × の横幅（必要なら調整） */
  height: 2.6px;     /* 線の太さ（必要なら調整） */
  background: #fff;
  border-radius: 2px;
  transform-origin: center;
}

/* 斜めに回転させて × にする */
.error-icon::before { transform: translate(-50%, -50%) rotate(45deg); }
.error-icon::after  { transform: translate(-50%, -50%) rotate(-45deg); }


/* ===============================
   
   =============================== */


/* 説明エリア */
.tnm-pdf-description {
  max-width: 880px;
  margin: 2rem auto;
  padding: 1rem;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1.6;
}
.tnm-pdf-description .desc-title {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 0.6rem;
  color: #333;
}
.tnm-pdf-description .desc-subtitle {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.4rem;
  color: #444;
}
.tnm-pdf-description .desc-list {
  margin: 0;
  padding-left: 1.2rem;
}
.tnm-pdf-description .desc-list li {
  margin-bottom: 0.4rem;
}

/* スマホ調整 */
@media (max-width: 600px) {
  .file-size,
  .delete-btn {
    font-size: 90%;
  }
  .delete-btn {
    padding: 4px 8px;
  }
}



/* ===============================
   ZIPで一括ダウンロードボタンのcss
   =============================== */
/* ZIPモードチェックボックス全体のラップ */
.zip-mode-wrap {
  margin: 1em 0;
  padding: 0.5em 0.8em;
  background: #f9f9f9;       /* 薄いグレーで背景を区切る */
  border: 1px solid #ddd;    /* 枠線で囲む */
  border-radius: 4px;        /* 角を少し丸める */
  display: inline-block;     /* コンテンツ幅に合わせる */
}

/* チェックボックスとラベルの並び */
.zip-mode-wrap label {
  cursor: pointer;
  font-size: 0.95rem;
  color: #333;
  display: flex;
  align-items: center;
  gap: 0.4em;                /* チェックボックスと文字の間隔 */
}

/* チェックボックス自体を少し大きめに */
.zip-mode-wrap input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #28a745;     /* 緑系で「完了感」を出す */
}

/* ===============================
   ファイルダウンロードボタンのcss
   =============================== */

#downloadBtn {
  display: inline-block;
  background: #4caf50;
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  margin-bottom: 1.5em;
}
#downloadBtn:hover { background: #3e8e41; }


/* ===============================
   個別ダウンロードリストのcss
   =============================== */
.download-row {
  display: flex;
  justify-content: space-between; /* 左右に分ける */
  align-items: center;
  padding: 0.4em 0;
  border-bottom: 1px solid #eee;
}

.download-link,
.download-success,
.download-skip,
.download-fail {
  min-width: 7em;
  padding: 0.4em 1em;
  font-size: 0.9rem;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
}

.download-link {
  background: #28a745;
}
.download-link:hover {
  background: #218838;
}

.download-success {
  background: #28a745;
}
.download-fail {
  background: #e33;   /* 赤バージョン */
}
.download-skip {
  background: #007bff;   /* 青 */
}

.download-filename {
  flex: 1;
  text-align: left; /* ← 左寄せに変更 */
  font-size: 1.0rem;
  letter-spacing: 0.2em
  color: #333;
  margin-left: 1.1em;
  margin-bottom: 0.2em;
  font-weight: 400; /* 少し太めで読みやすく */
  /*font-style: italic;*/ /* 斜めにする */
}



.error-description {
  font-size: 0.8rem;
  color: #333;
  margin-left: 0.5em;
}


/* ===============================
   ダウンロードボタンの上部表示するメッセージ
   =============================== */
/* デフォルトは非表示 */
.hint {
  display: none;
  font-size: 0.8rem;
}

/* スマホ (600px以下) */
@media screen and (max-width: 600px) {
  .hint.sp { display: block; }
}

/* PC (601px以上) */
@media screen and (min-width: 601px) {
  .hint.pc { display: block; }
}

/* ===============================
   ファイルリストのcss
   =============================== */
.upload-icons {
  display: flex;
  gap: 8px;
  justify-content: center; /* 横方向中央寄せ */
}

.upload-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;      /* 縦方向中央寄せ */
  justify-content: center;  /* 横方向中央寄せ */
  border-radius: 4px;
  color: #fff;
  font-weight: bold;
  font-size: 12px;
}

/* 色分け */
.icon-pdf { background: #e33; }
.icon-doc,
.icon-docx { background: #2a5bd7; }
.icon-xls,
.icon-xlsx { background: #1d9f4d; }
.icon-ppt,
.icon-pptx { background: #d24726; }
.icon-jpg,
.icon-jpeg,
.icon-png,
.icon-webp { background: #333; }
