/* ===================================
品質プリセットセクション
=================================== */
.quality-section {
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 30px;
  display: none;
}

.quality-title {
  font-size: 18px;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.quality-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}

.preset-card {
  background: white;
  border: 2px solid var(--gray-300);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.preset-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(243, 156, 18, 0.2);
}

.preset-card.active {
  border-color: var(--accent);
  background: linear-gradient(to bottom, rgba(243, 156, 18, 0.1) 0%, rgba(243, 156, 18, 0.05) 100%);
}

.preset-card.active::after {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preset-card.active::before {
  content: '\f00c'; /* Font Awesome check icon */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  top: 10px;
  right: 10px;
  color: white;
  z-index: 1;
  font-size: 12px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preset-icon {
  font-size: 32px;
  color: var(--info);
  margin-bottom: 10px;
}

.preset-name {
  font-weight: bold;
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.preset-freq {
  font-size: 14px;
  color: var(--text-secondary);
  font-family: monospace;
}

.preset-bit {
  font-size: 12px;
  color: var(--info);
  font-weight: bold;
}

.preset-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 5px;
}

/* ===================================
ファイルリスト改良版
=================================== */
.file-list {
  margin-bottom: 30px;
}

.file-item {
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 12px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.file-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--gray-300);
  transition: all 0.3s;
}

.file-item.status-waiting::before {
  background: var(--warning);
}

.file-item.status-processing::before {
  background: var(--info);
  animation: pulse 1.5s infinite;
}

.file-item.status-complete::before {
  background: var(--success);
}

.file-item.status-error::before {
  background: var(--danger);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.file-item:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(243, 156, 18, 0.1);
}

.file-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
  min-width: 0;
}

.file-icon {
  font-size: 24px;
  color: var(--info);
  flex-shrink: 0;
}

.file-details {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px 20px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.file-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.file-meta-item i {
  font-size: 11px;
  width: 14px;
  text-align: center;
}

.file-meta-label {
  color: var(--text-secondary);
  opacity: 0.8;
}

.file-meta-value {
  font-weight: 500;
  color: var(--text-primary);
}

/* 予測サイズのハイライト */
.file-meta-item.size-prediction {
  color: var(--info);
}

.file-meta-item.size-prediction i {
  color: var(--info);
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.file-status {
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.status-waiting {
  background: #fff3cd;
  color: #856404;
}

.status-processing {
  background: #d1ecf1;
  color: #0c5460;
}

.status-complete {
  background: #d4edda;
  color: #155724;
}

.status-error {
  background: #f8d7da;
  color: #721c24;
}

/* ===================================
アクションバー改良版
=================================== */
.action-bar {
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
  display: none;
}

.action-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.action-stats {
  display: flex;
  gap: 30px;
}

.action-stat {
  text-align: center;
}

.action-stat-value {
  font-size: 28px;
  font-weight: bold;
  color: var(--primary);
  display: block;
}

.action-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-top: 2px;
}

.action-buttons {
  display: flex;
  gap: 10px;
}

.action-btn {
  padding: 12px 24px;
  border-radius: 6px;
  border: none;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.convert-btn {
  background: var(--success);
  color: white;
}

.convert-btn:hover:not(:disabled) {
  background: var(--success-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.download-zip-btn {
  background: var(--accent);
  color: var(--primary);
}

.download-zip-btn:hover:not(:disabled) {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--gray-500);
}

.clear-btn {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  padding: 10px 20px;
  font-size: 14px;
}

.clear-btn:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

/* ===================================
個別ダウンロードボタン
=================================== */
.download-btn {
  background: var(--info);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.download-btn:hover {
  background: var(--info-hover);
  transform: translateY(-1px);
}

.remove-btn {
  background: transparent;
  color: var(--danger);
  border: none;
  padding: 6px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s;
  opacity: 0.6;
}

.remove-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* ===================================
プログレスセクション
=================================== */
.progress-section {
  background: var(--gray-100);
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 30px;
  display: none;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.progress-title {
  font-weight: bold;
  color: var(--text-primary);
}

.progress-text {
  font-size: 14px;
  color: var(--text-secondary);
}

.progress-bar {
  width: 100%;
  height: 30px;
  background: var(--gray-300);
  border-radius: 15px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%);
  transition: width 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 14px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* ===================================
レスポンシブ対応
=================================== */
@media (max-width: 768px) {
  .quality-presets {
    grid-template-columns: 1fr;
  }
  
  .file-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .file-meta {
    grid-template-columns: 1fr;
  }
  
  .file-actions {
    width: 100%;
    justify-content: flex-end;
  }
  
  .action-bar-content {
    flex-direction: column;
    text-align: center;
  }
  
  .action-stats {
    width: 100%;
    justify-content: space-around;
  }
  
  .action-buttons {
    width: 100%;
    flex-direction: column;
  }
  
  .action-btn {
    width: 100%;
  }
}

/* ===================================
カスタム設定コンテナ
=================================== */
.custom-settings-container {
  margin-top: 20px;
  padding: 20px;
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
}

.custom-setting-group {
  margin-bottom: 25px;
}

.custom-setting-group:last-child {
  margin-bottom: 0;
}

.custom-setting-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 500;
}

.custom-setting-label span:first-child {
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-setting-label i {
  color: var(--info);
}

.custom-setting-value {
  font-family: monospace;
  font-weight: bold;
  color: var(--accent);
  font-size: 14px;
}

/* スライダー */
.setting-slider {
  width: 100%;
  height: 6px;
  background: var(--gray-300);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  margin-bottom: 10px;
}

.setting-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
}

.setting-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 2px 8px rgba(243, 156, 18, 0.4);
}

.setting-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.setting-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 2px 8px rgba(243, 156, 18, 0.4);
}

.setting-marks {
  position: relative;
  height: 20px;
  margin-top: -5px;
}

.setting-marks span {
  position: absolute;
  font-size: 11px;
  color: var(--text-secondary);
  transform: translateX(-50%);
  white-space: nowrap;
}

.setting-marks span:first-child {
  transform: translateX(0);
}

.setting-marks span:last-child {
  transform: translateX(-100%);
}

/* ビット深度オプション */
.bit-depth-options {
  display: flex;
  gap: 15px;
}

.radio-option {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 8px 16px;
  border: 2px solid var(--gray-300);
  border-radius: 6px;
  transition: all 0.3s;
  flex: 1;
  justify-content: center;
}

.radio-option:hover {
  border-color: var(--accent);
  background: rgba(243, 156, 18, 0.05);
}

.radio-option input[type="radio"] {
  display: none;
}

.radio-option input[type="radio"]:checked + .radio-label {
  color: var(--accent);
  font-weight: bold;
}

.radio-option input[type="radio"]:checked ~ .radio-label {
  color: var(--accent);
}

.radio-option:has(input[type="radio"]:checked) {
  border-color: var(--accent);
  background: rgba(243, 156, 18, 0.1);
}

.radio-label {
  font-size: 14px;
  color: var(--text-primary);
  transition: all 0.3s;
}

/* プリセットカードのカスタム表示調整 */
#preset-custom .preset-freq,
#preset-custom .preset-bit {
  color: var(--accent);
  font-weight: bold;
}

/* レスポンシブ：カスタム設定 */
@media (max-width: 768px) {
  .custom-settings-container {
    padding: 15px;
  }
  
  .bit-depth-options {
    flex-direction: column;
  }
  
  .radio-option {
    width: 100%;
  }
}

/* ===================================
処理中オーバーレイ
=================================== */
.processing-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.processing-modal {
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 40px;
  text-align: center;
  max-width: 400px;
}

.processing-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid var(--gray-100);
  border-top: 5px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.processing-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.processing-message {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.processing-progress {
  width: 100%;
  height: 6px;
  background: var(--gray-300);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}

.processing-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s;
}