/* MASV Upload System CSS
 * モダンでレスポンシブなデザイン
 */

:root {
  --primary-color: #3498db;
  --primary-dark: #2980b9;
  --secondary-color: #2ecc71;
  --text-color: #333;
  --light-gray: #f5f5f5;
  --border-color: #ddd;
  --error-color: #e74c3c;
  --success-color: #27ae60;
  --font-main: 'Helvetica Neue', Arial, sans-serif;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --border-radius: 4px;
  --button-small: #95a5a6;
  --button-small-hover: #7f8c8d;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--light-gray);
  padding: 0;
  margin: 0;
}

.container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 2rem;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

header {
  background-color: var(--primary-color);
  color: white;
  padding: 1rem 0;
  text-align: center;
  box-shadow: var(--shadow);
}

h1 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 0.5rem;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.file-input-container {
  border: 2px dashed var(--border-color);
  padding: 2rem;
  text-align: center;
  border-radius: var(--border-radius);
  background-color: var(--light-gray);
  transition: all 0.3s ease;
  position: relative;
}

.file-input-container:hover {
  border-color: var(--primary-color);
}

.file-input-container.highlight {
  border-color: var(--primary-color);
  background-color: rgba(52, 152, 219, 0.1);
  box-shadow: 0 0 10px rgba(52, 152, 219, 0.2);
}

.file-input-container::after {
  display: none;
  content: "ここにファイルをドロップ";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--primary-color);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.file-input-container.highlight::after {
  opacity: 1;
}

.file-input-container label {
  display: block;
  margin-bottom: 1rem;
  font-weight: bold;
  color: var(--text-color);
}

#fileInput {
  display: none;
}

.file-select-btn {
  display: inline-block;
  padding: 12px 24px;
  border: 2px solid var(--primary-color);
  border-radius: var(--border-radius);
  background-color: white;
  color: var(--primary-color);
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 1rem 0;
  text-align: center;
  width: auto;
}

.file-select-btn:hover {
  background-color: var(--primary-color);
  color: white;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-primary:disabled {
  background-color: var(--border-color);
  cursor: not-allowed;
}

#progress {
  margin-top: 1rem;
  height: 20px;
  width: 100%;
  background-color: var(--light-gray);
  border-radius: var(--border-radius);
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  background-color: var(--secondary-color);
  width: 0;
  transition: width 0.3s ease;
}

.progress-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  text-align: center;
  color: white;
  font-weight: 900;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.7);
  line-height: 20px;
}

/* 経過時間 / 残り時間 表示 */
.progress-time {
  position: absolute;
  bottom: 2px;
  right: 6px;
  font-size: 0.8rem;
  color: white;
  font-weight: 900;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

#message {
  padding: 1rem;
  margin-top: 1rem;
  border-radius: var(--border-radius);
  font-weight: bold;
}

.message-error {
  background-color: rgba(231, 76, 60, 0.1);
  color: var(--error-color);
  border-left: 4px solid var(--error-color);
}

.message-success {
  background-color: rgba(46, 204, 113, 0.1);
  color: var(--success-color);
  border-left: 4px solid var(--success-color);
}

.message-info {
  background-color: rgba(52, 152, 219, 0.1);
  color: var(--primary-color);
  border-left: 4px solid var(--primary-color);
}

.message-accordion-btn {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--primary-color);
  background-color: #fff;
  color: var(--primary-color);
  border-radius: var(--border-radius);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.message-accordion-btn:hover {
  background-color: rgba(52, 152, 219, 0.08);
}

.message-accordion-btn::after {
  content: "\25BC"; /* ▼ */
  font-size: 0.9rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

/* 矢印回転 */
.message-accordion-btn:has(+ .message-info-content[style*="display: block"])::after {
  transform: rotate(180deg);
}

/* コンテンツ領域の見た目を少しだけ整える */
.message-info-content {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(52, 152, 219, 0.3);
}

/* Loading animation for message boxes */
.message-error.loading,
.message-success.loading,
.message-info.loading {
  display: flex;
  align-items: center;
  gap: 0.5rem; /* space between spinner and text */
}

.message-error.loading::before,
.message-success.loading::before,
.message-info.loading::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 3px solid currentColor; /* uses the text color of each message type */
  border-top-color: transparent; /* create the spinner gap */
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

footer {
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  color: #777;
  font-size: 0.9rem;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  .container {
    margin: 1rem;
    padding: 1rem;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  .file-input-container {
    padding: 1rem;
  }
}

/* ファイルリスト表示のスタイル */
.file-list {
  list-style: none;
  padding: 0.5rem 1rem;
  margin-top: 0.5rem;
  margin-bottom: 0;
  max-height: 200px;
  overflow-y: auto;
  background-color: rgba(52, 152, 219, 0.05);
  border-radius: var(--border-radius);
}

.file-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.9rem;
}

.file-list li:last-child {
  border-bottom: none;
}

.file-format-container {
  display: inline-block;
  text-align: left;
  margin-top: 0.5rem;
  margin-left: auto;
  margin-right: auto;
}

.file-format-note {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #555;
}

.file-note {
  font-size: 0.8rem;
  color: #777;
  font-style: italic;
}

/* Loader Spinner */
#works-loader {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
  margin: 1rem auto;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Works info fields */
.works_info .works-field {
  margin-bottom: 1rem;
}
.works_info .works-field label {
  display: block;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

/* 必須マーカー */
.required-marker {
  color: var(--error-color);
  font-size: 0.8em;
}

/* Worksフォームのテキストエリア拡張 */
.works_info .works-field textarea {
  width: 100%;
  min-height: 6rem;
  padding: 0.5rem;
}

/* Worksフォームのテキスト入力拡張 */
.works_info .works-field input[type="text"] {
  padding: 0.5rem;
  width: 100%;
}

/* ファイル削除ボタンのスタイル */
.remove-file-btn {
  background-color: #f8f9fa;
  color: #3498db;
  border: 1px solid #3498db;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.remove-file-btn:hover {
  background-color: #3498db;
  color: white;
  transform: scale(1.05);
}

.remove-file-btn:active {
  transform: scale(0.95);
}

/* 全てクリアボタンのスタイル */
.clear-all-btn {
  background-color: #f8f9fa;
  color: #3498db;
  border: 1px solid #3498db;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.clear-all-btn:hover {
  background-color: #3498db;
  color: white;
  transform: translateY(-1px);
}

.clear-all-btn:active {
  transform: translateY(0);
}

/* イエローレッド情報の未選択ボタン */
.yellow-red-clear-btn {
  background-color: #ffffff;
  color: #000000;
  border: 1px solid #000000;
  border-radius: 4px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  vertical-align: middle;
}

.yellow-red-clear-btn:hover {
  background-color: #f8f9fa;
  color: #495057;
  border-color: #adb5bd;
}

.yellow-red-clear-btn:active {
  background-color: #e9ecef;
  border-color: #6c757d;
  transform: translateY(1px);
}

/* ファイルリストのレイアウト調整 */
.file-list li {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  border-radius: var(--border-radius);
  margin-bottom: 2px;
  transition: background-color 0.2s ease;
}

.file-list li:hover {
  background-color: rgba(52, 152, 219, 0.05);
}

.file-list li:last-child {
  border-bottom: none;
}

.file-list li span {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 12px;
  font-weight: 500;
}

/* ファイル情報セクションのヘッダー部分 */
.message-info strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1rem;
  color: var(--text-color);
}

/* ファイルリスト全体のコンテナ */
.file-list {
  border: 1px solid rgba(52, 152, 219, 0.2);
  border-radius: var(--border-radius);
  padding: 0;
  margin-top: 8px;
}

/* ファイル選択エラーメッセージ */
.file-selection-error {
  display: none;
  margin-top: 12px;
  margin-bottom: 16px;
  padding: 10px 12px;
  background-color: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.3);
  border-left: 4px solid var(--error-color);
  border-radius: var(--border-radius);
  color: var(--error-color);
  font-size: 0.9rem;
  font-weight: 500;
}

/* 必須項目エラーメッセージ */
.required-field-error {
  display: none;
  margin-top: 12px;
  margin-bottom: 16px;
  padding: 10px 12px;
  background-color: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.3);
  border-left: 4px solid var(--error-color);
  border-radius: var(--border-radius);
  color: var(--error-color);
  font-size: 0.9rem;
  font-weight: 500;
} 
#qrcode {
  margin-top: 20px;
}
#qrcode img {
  width: 270px;
  height: 270px;
}