/* テンプレートパターン共通スタイル */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.main {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  min-height: 100vh;
  padding: 2rem 24px !important;
  margin: 0 auto !important;
  max-width: 1024px !important;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body.drag-active::before {
  content: "📁 ここに画像をドロップしてください";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(102, 126, 234, 0.95);
  color: white;
  font-size: 2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(10px);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.tool-header {
  text-align: center;
  margin-bottom: 3rem;
}

.tool-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(45deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

.tool-header p {
  color: #666;
  font-size: 1.1rem;
}

.sub-desc {
  color: #888;
  font-size: 1rem;
  margin: 0.5rem 0;
}

.privacy-note {
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: 10px;
  padding: 1rem;
  margin: 1rem auto;
  max-width: 600px;
  color: #667eea;
  font-size: 0.9rem;
}

/* ========== 統計情報バー ========== */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 20px;
  padding: 15px 25px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  border-radius: 15px;
  font-size: 0.95rem;
  color: #667eea;
  font-weight: 600;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ========== プログレスバー ========== */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(102, 126, 234, 0.3);
  z-index: 1000;
  display: none;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  width: 0%;
  transition: width 0.3s ease;
}

.upload-area {
  border: 3px dashed #667eea;
  border-radius: 15px;
  padding: 60px 20px;
  text-align: center;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
}

.upload-area:hover {
  border-color: #764ba2;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  transform: translateY(-2px);
}

.upload-area.dragover {
  border-color: #764ba2;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
  transform: scale(1.02);
}

.upload-icon {
  font-size: 4rem;
  color: #667eea;
  margin-bottom: 20px;
}

.upload-text {
  font-size: 1.3rem;
  color: #666;
  margin-bottom: 20px;
  font-weight: 500;
}

.upload-button {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 50px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.upload-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4);
}

/* 🔧 デバッグボタン専用スタイルを追加 */
.debug-button {
  background: linear-gradient(135deg, #ff6b6b, #ee5a52);
  box-shadow: 0 5px 15px rgba(255, 107, 107, 0.2);
  font-size: 0.8rem;
  padding: 8px 16px;
}

.debug-button:hover {
  background: linear-gradient(135deg, #ee5a52, #ff6b6b);
  box-shadow: 0 8px 20px rgba(255, 107, 107, 0.3);
}

#fileInput {
  display: none;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.view-toggle,
.delete-button,
.select-all-button,
.deselect-all-button,
.edit-button,
.export-button,
.debug-button {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.view-toggle:hover,
.delete-button:hover:not(:disabled),
.select-all-button:hover,
.deselect-all-button:hover,
.edit-button:hover:not(:disabled),
.export-button:hover:not(:disabled),
.debug-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.view-toggle.active {
  background: linear-gradient(135deg, #764ba2, #667eea);
  box-shadow: 0 5px 15px rgba(118, 75, 162, 0.3);
}

.delete-button {
  background: linear-gradient(135deg, #e53e3e, #c53030);
  box-shadow: 0 5px 15px rgba(229, 62, 62, 0.2);
}

.delete-button:disabled {
  background: #ddd;
  cursor: not-allowed;
  box-shadow: none;
  color: #999;
}

.select-all-button,
.deselect-all-button {
  background: linear-gradient(135deg, #48bb78, #38a169);
  box-shadow: 0 5px 15px rgba(72, 187, 120, 0.2);
}

.select-all-button:hover,
.deselect-all-button:hover {
  box-shadow: 0 8px 20px rgba(72, 187, 120, 0.3);
}

.edit-button {
  background: linear-gradient(135deg, #ed8936, #dd6b20);
  box-shadow: 0 5px 15px rgba(237, 137, 54, 0.2);
}

.edit-button:disabled {
  background: #ddd;
  cursor: not-allowed;
  box-shadow: none;
  color: #999;
}

.export-button {
  background: linear-gradient(135deg, #9f7aea, #805ad5);
  box-shadow: 0 5px 15px rgba(159, 122, 234, 0.2);
}

.export-button:disabled {
  background: #ddd;
  cursor: not-allowed;
  box-shadow: none;
  color: #999;
}

.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.photos-grid.compact {
  grid-template-columns: 1fr;
}

.photo-card {
  position: relative;
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 1px solid rgba(102, 126, 234, 0.1);
  cursor: pointer;
}

.photo-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.photo-card:hover .quick-actions {
  opacity: 1;
  transform: translateY(0);
}

.photo-card.selected {
  border: 3px solid #e53e3e;
  background-color: rgba(229, 62, 62, 0.05);
}

.checkmark {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background-color: rgba(229, 62, 62, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
  z-index: 2;
}

/* ========== クイックアクション ========== */
.quick-actions {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 8px;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 3;
}

.quick-action-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.quick-action-btn:hover {
  background: white;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.photo-thumbnail {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.photo-card:hover .photo-thumbnail {
  transform: scale(1.05);
}

.photo-info {
  padding: 20px;
}

.photo-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: #333;
  margin-bottom: 15px;
  word-break: break-word;
}

.exif-info {
  display: grid;
  gap: 8px;
}

.exif-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(102, 126, 234, 0.05);
  border-radius: 8px;
  font-size: 0.9rem;
  position: relative;
}

.exif-label {
  font-weight: 600;
  color: #667eea;
  display: flex;
  align-items: center;
  gap: 8px;
}

.exif-value {
  color: #555;
  text-align: right;
  max-width: 60%;
  word-break: break-word;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ========== コピーボタン ========== */
.copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
  opacity: 0.7;
}

.copy-btn:hover {
  background: rgba(102, 126, 234, 0.1);
  opacity: 1;
}

.copy-feedback {
  position: absolute;
  right: 10px;
  top: -30px;
  background: #48bb78;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.copy-feedback.show {
  opacity: 1;
}

.loading {
  text-align: center;
  padding: 20px;
  color: #667eea;
  font-style: italic;
}

.description {
  text-align: center;
  margin-bottom: 30px;
  padding: 0 20px;
}

.main-desc {
  font-size: 1.3rem;
  color: #333;
  margin-bottom: 10px;
  font-weight: 600;
}

.sub-desc {
  font-size: 1rem;
  color: #666;
  margin-bottom: 20px;
  line-height: 1.6;
}

.privacy-note {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(139, 195, 74, 0.1));
  border: 1px solid rgba(76, 175, 80, 0.3);
  border-radius: 10px;
  padding: 15px 20px;
  font-size: 0.95rem;
  color: #2e7d32;
  display: inline-block;
  max-width: 600px;
  margin: 0 auto;
}

/* ========== エラーメッセージ ========== */
.error-message {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #e53e3e, #c53030);
  color: white;
  padding: 15px 20px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(229, 62, 62, 0.3);
  z-index: 1000;
  transform: translateX(400px);
  transition: transform 0.3s ease;
}

.error-message.show {
  transform: translateX(0);
}

/* ========== 詳細情報の展開表示 ========== */
.photo-card.expanded {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
}

.expanded-content {
  display: flex;
  gap: 30px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 0 0 15px 15px;
}

.expanded-image {
  flex: 1;
  text-align: center;
}

.expanded-image img {
  max-width: 100%;
  max-height: 400px;
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.expanded-details {
  flex: 0 0 300px;
  background: white;
  padding: 20px;
  border-radius: 15px;
}

.expanded-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: #333;
}

.detail-grid {
  display: grid;
  gap: 15px;
}

.detail-item {
  padding: 12px 15px;
  background: rgba(102, 126, 234, 0.05);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.detail-label {
  font-weight: 600;
  color: #667eea;
}

.detail-value {
  color: #555;
  text-align: right;
  display: flex;
  align-items: center;
  gap: 8px;
}

.collapse-btn {
  position: absolute;
  top: 10px;
  right: 50px;
  background: rgba(102, 126, 234, 0.9);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  z-index: 3;
  transition: all 0.3s ease;
}

.collapse-btn:hover {
  background: rgba(102, 126, 234, 1);
  transform: scale(1.05);
}

/* ========== リスト表示時のスタイル調整 ========== */
.photo-card.compact {
  display: flex;
  align-items: center;
  padding: 10px;
}

.photo-thumbnail.compact {
  width: 100px;
  height: 75px;
  object-fit: cover;
  flex-shrink: 0;
  margin-right: 15px;
  border-radius: 8px;
}

.photo-info.compact {
  padding: 10px 0;
  flex: 1;
}

.photo-name.compact {
  font-size: 1rem;
  margin-bottom: 8px;
}

.exif-info.compact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.exif-item.compact {
  flex: 1 1 calc(50% - 8px);
  font-size: 0.85rem;
  padding: 6px 10px;
}

/* ========== モーダル共通 ========== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  display: none;
  backdrop-filter: blur(5px);
}

.modal-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.edit-modal {
  background: white;
  border-radius: 20px;
  width: 90%;
  max-width: 1000px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  border-bottom: 1px solid #eee;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  padding: 5px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.close-btn:hover {
  background: #f5f5f5;
  color: #333;
}

.modal-body {
  display: flex;
  padding: 30px;
  gap: 30px;
}

.edit-preview {
  flex: 1;
  min-width: 400px;
}

.preview-container {
  position: relative;
  background: #f8f9fa;
  border-radius: 15px;
  padding: 20px;
  text-align: center;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: contents;
}

.preview-image {
  max-width: 100%;
  max-height: 400px;
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, image-rendering auto;
}

.preview-image.rotating {
  transform: rotate(360deg);
}

.edit-panels {
  flex: 0 0 350px;
  overflow-y: auto;
  max-height: 500px;
}

.edit-panel {
  margin-bottom: 25px;
  background: #f8f9fa;
  border-radius: 15px;
  overflow: hidden;
}

.panel-header {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 15px 20px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.panel-header:hover {
  background: linear-gradient(135deg, #764ba2, #667eea);
}

.panel-content {
  padding: 20px;
  display: none;
}

.panel-content.active {
  display: block;
}

.control-group {
  margin-bottom: 20px;
}

.control-label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.control-input {
  width: 100%;
  padding: 10px 15px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.control-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slider {
  flex: 1;
  appearance: none;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  outline: none;
}

.slider::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.slider:active {
  transform: scale(1.02);
  transition: transform 0.1s ease;
}

.slider-value {
  min-width: 40px;
  font-weight: 600;
  color: #667eea;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.slider-value.updating {
  background: rgba(102, 126, 234, 0.2);
  transform: scale(1.05);
}

.button-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.control-button {
  flex: 1;
  min-width: 80px;
  padding: 8px 15px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.85rem;
  font-weight: 500;
}

.control-button.primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.control-button.secondary {
  background: #e2e8f0;
  color: #4a5568;
}

.control-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.control-button.active {
  background: linear-gradient(135deg, #48bb78, #38a169) !important;
  color: white;
  box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  border-top: 1px solid #eee;
  background: #f8f9fa;
}

.footer-left {
  display: flex;
  gap: 10px;
  align-items: center;
}

.footer-right {
  display: flex;
  gap: 15px;
}

.modal-button {
  padding: 10px 25px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.cancel-btn {
  background: #e2e8f0;
  color: #4a5568;
}

.apply-btn {
  background: linear-gradient(135deg, #48bb78, #38a169);
  color: white;
}

.reset-btn {
  background: linear-gradient(135deg, #ed8936, #dd6b20) !important;
  color: white !important;
  border: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.reset-btn:hover {
  background: linear-gradient(135deg, #dd6b20, #c05621) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(237, 137, 54, 0.3);
}

.button-group .reset-btn {
  min-width: auto;
}

.reset-btn::before {
  content: "";
  display: inline-block;
  margin-right: 4px;
}

.button-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.button-group .control-button {
  flex: 1;
  min-width: 80px;
}

.reset-btn[data-action="resetBasic"] {
  background: linear-gradient(135deg, #48bb78, #38a169) !important;
}

.reset-btn[data-action="resetFilters"] {
  background: linear-gradient(135deg, #9f7aea, #805ad5) !important;
}

.reset-btn[data-action="resetPrivacy"] {
  background: linear-gradient(135deg, #e53e3e, #c53030) !important;
}

/* ========== エクスポートモーダル ========== */
.export-modal {
  background: white;
  border-radius: 20px;
  width: 95%;
  max-width: 1200px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.export-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  padding: 0;
}

.export-column {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.export-section {
  margin-bottom: 25px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
}

.export-section.compact {
  margin-bottom: 15px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 12px;
}

.export-section.collapsible .section-title.collapsible-header {
  cursor: pointer;
  user-select: none;
  transition: all 0.3s ease;
}

.export-section.collapsible .section-title.collapsible-header:hover {
  color: #667eea;
}

.toggle-icon {
  margin-left: auto;
  transition: transform 0.3s ease;
}

.toggle-icon.expanded {
  transform: rotate(180deg);
}

.collapsible-content {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.section-title {
  font-weight: 600;
  color: #333;
  margin-bottom: 15px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  background: white;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
  transition: all 0.3s ease;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}

.checkbox-item:hover {
  border-color: #667eea;
}

.checkbox-item input[type="checkbox"] {
  margin: 0;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.checkbox-item label {
  cursor: pointer;
  font-size: 0.95rem;
  color: #333;
  flex: 1;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  background: white;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  box-sizing: border-box;
}

.radio-item:hover {
  border-color: #667eea;
}

.radio-item input[type="radio"] {
  margin: 0;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.radio-item label {
  cursor: pointer;
  font-size: 0.95rem;
  color: #333;
  flex: 1;
}

.radio-item input[type="radio"]:checked+label,
.checkbox-item input[type="checkbox"]:checked+label {
  font-weight: 600;
  color: #667eea;
}

/* 編集済み画像のスタイル */
.photo-card.edited {
  border-left: 4px solid #ed8936;
}

.photo-card.edited .photo-name::before {
  content: "✏️ ";
  color: #ed8936;
}

/* 編集処理中の表示 */
.edit-processing {
  position: relative;
  pointer-events: none;
}

.edit-processing::after {
  content: "処理中...";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .photos-grid {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 20px;
  }

  h1 {
    font-size: 2rem;
  }

  .modal-body {
    flex-direction: column;
    padding: 20px;
  }

  .edit-panels {
    flex: none;
  }

  .controls {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 10px;
  }

  .stats-bar {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .lightbox-nav {
    font-size: 1.5rem;
    padding: 10px 15px;
  }

  .lightbox-prev {
    left: -60px;
  }

  .lightbox-next {
    right: -60px;
  }

  .lightbox-info {
    position: relative;
    bottom: 0;
    margin-top: 20px;
  }
}

/* index_orgV3.php から持ってくる前
@media (max-width: 768px) {
  .edit-panels {
    flex: none;
  }

  .controls {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 10px;
  }

  .stats-bar {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .expanded-content {
    flex-direction: column;
    gap: 20px;
  }

  .expanded-details {
    flex: none;
  }
}
  */

/* フィルター関連のスタイル */
.filter-preview {
  margin-top: 10px;
  padding: 10px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 8px;
  font-size: 0.9rem;
  color: #667eea;
}

.filter-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.filter-value-item {
  font-size: 0.8rem;
  opacity: 0.8;
}

/* フィルタースライダーの色分け */
#brightness {
  background: linear-gradient(to right, #333 0%, #667eea 50%, #fff 100%);
}

#contrast {
  background: linear-gradient(to right, #888 0%, #667eea 50%, #000 100%);
}

#saturation {
  background: linear-gradient(to right, #ccc 0%, #667eea 50%, #ff6b6b 100%);
}

#hue {
  background: linear-gradient(to right, #ff0000 0%, #ffff00 16.66%, #00ff00 33.33%, #00ffff 50%, #0000ff 66.66%, #ff00ff 83.33%, #ff0000 100%);
}

/* フィルター適用時の表示 */
.preview-image.filtered {
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
  transition: box-shadow 0.3s ease;
}

/* フィルターリセットボタン */
.control-button[data-action="resetFilters"] {
  background: linear-gradient(135deg, #9f7aea, #805ad5);
  color: white;
}

.control-button[data-action="resetFilters"]:hover {
  background: linear-gradient(135deg, #805ad5, #6b46c1);
  transform: translateY(-1px);
}

/* クイック編集ボタンのスタイル */
.quick-action-btn.edit-btn {
  background: linear-gradient(135deg, #ed8936, #dd6b20);
  color: white;
  transition: all 0.2s ease;
}

.quick-action-btn.edit-btn:hover {
  background: linear-gradient(135deg, #dd6b20, #c05621);
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(237, 137, 54, 0.4);
}

/* 編集済み画像のクイック編集ボタンは異なる色 */
.photo-card.edited .quick-action-btn.edit-btn {
  background: linear-gradient(135deg, #48bb78, #38a169);
}

.photo-card.edited .quick-action-btn.edit-btn:hover {
  background: linear-gradient(135deg, #38a169, #2f855a);
  box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

/* 🆕 原画像リセットボタンのスタイル追加 */
.original-reset-btn {
  background: linear-gradient(135deg, #2196F3, #1976D2) !important;
  color: white !important;
  border: none;
  font-weight: 500;
  transition: all 0.3s ease;
  margin-left: 10px;
}

.original-reset-btn:hover {
  background: linear-gradient(135deg, #1976D2, #1565C0) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

/* footer-leftの調整 */
.footer-left {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* 🆕 ソートコントロールのスタイル追加 */
.sort-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.sort-select {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 15px;
  padding: 6px 12px;
  font-size: 0.85rem;
  color: #333;
  cursor: pointer;
  transition: all 0.3s ease;
}

.sort-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.sort-button {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sort-button:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* プライバシー強化説明 */
.privacy-enhanced-note {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(139, 195, 74, 0.1));
  border: 1px solid rgba(76, 175, 80, 0.3);
  border-radius: 8px;
  padding: 15px 18px;
  font-size: 0.9rem;
  color: #2e7d32;
  margin-bottom: 15px;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .sort-controls {
    flex-direction: column;
    gap: 5px;
  }

  .sort-select {
    font-size: 0.8rem;
    padding: 4px 8px;
  }

  .sort-button {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }
}

/* ZIP設定の注意書きスタイル */
.zip-name-note {
  background: rgba(33, 150, 243, 0.1);
  border: 1px solid rgba(33, 150, 243, 0.3);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.85rem;
  color: #1565C0;
  margin-top: 8px;
  line-height: 1.4;
}

/* コンパクトセクション */
.export-section.compact .section-title {
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* インラインコントロール */
.inline-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* コンパクトラジオボタン（横並び） */
.radio-group-inline {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.radio-item-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.radio-item-inline input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.radio-item-inline label {
  cursor: pointer;
  font-size: 0.9rem;
  color: #333;
  margin: 0;
}

/* コンパクトラジオボタン（縦並び） */
.radio-group-compact {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-item-compact {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: white;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.radio-item-compact:hover {
  border-color: #667eea;
}

.radio-item-compact input[type="radio"] {
  width: 14px;
  height: 14px;
  margin: 0;
}

.radio-item-compact label {
  cursor: pointer;
  font-size: 0.85rem;
  color: #333;
  margin: 0;
  flex: 1;
}

/* 品質コントロール */
.quality-control {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.control-label-inline {
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
  margin: 0;
  min-width: 40px;
}

.slider-compact {
  flex: 1;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  outline: none;
  appearance: none;
}

.slider-compact::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 50%;
  cursor: pointer;
}

.slider-value-inline {
  min-width: 30px;
  font-weight: 600;
  color: #667eea;
  font-size: 0.85rem;
}

/* コンパクト入力フィールド */
.control-input-compact {
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.85rem;
  flex: 1;
}

.control-group-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

/* コンパクトチェックボックス */
.checkbox-item-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.checkbox-item-compact {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  background: white;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.checkbox-item-compact:hover {
  border-color: #667eea;
}

.checkbox-item-inline input[type="checkbox"],
.checkbox-item-compact input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
}

.checkbox-item-inline label,
.checkbox-item-compact label {
  cursor: pointer;
  font-size: 0.85rem;
  color: #333;
  margin: 0;
}

/* チェックボックスグリッド */
.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

/* ZIP設定 */
.zip-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.zip-preview {
  font-size: 0.75rem;
  color: #666;
  font-style: italic;
  padding: 4px 8px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 4px;
}

/* リサイズコントロール */
.resize-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.resize-inputs {
  background: white;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.size-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.size-input {
  width: 80px;
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.85rem;
  text-align: center;
}

.resize-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fit-mode-compact {
  display: flex;
  gap: 12px;
}

.fit-mode-compact input[type="radio"] {
  width: 14px;
  height: 14px;
  margin: 0 4px 0 0;
}

.fit-mode-compact label {
  font-size: 0.8rem;
  cursor: pointer;
}

/* 折りたたみ式セクション */
.export-section.collapsible .section-title.collapsible-header {
  cursor: pointer;
  user-select: none;
  transition: all 0.3s ease;
}

.export-section.collapsible .section-title.collapsible-header:hover {
  color: #667eea;
}

.toggle-icon {
  margin-left: auto;
  transition: transform 0.3s ease;
}

.toggle-icon.expanded {
  transform: rotate(180deg);
}

.collapsible-content {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

/* コンパクトボタン */
.btn-compact {
  padding: 4px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s ease;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.btn-compact:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-compact.secondary {
  background: #e2e8f0;
  color: #4a5568;
}

.btn-compact.secondary:hover {
  background: #cbd5e0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.preset-select-compact {
  padding: 4px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.8rem;
  background: white;
  flex: 1;
}

/* レスポンシブ対応 */
@media (max-width: 900px) {
  .export-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .export-modal {
    width: 95%;
    max-width: 600px;
  }

  .radio-group-inline {
    flex-direction: column;
    gap: 8px;
  }

  .quality-control {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .size-inputs {
    justify-content: center;
  }
}

.other-settings {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* バッチフィット説明のスタイル修正 */
.batch-fit-description {
  font-size: 0.75rem;
  color: #666;
  padding: 6px 8px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 4px;
  margin-top: 6px;
  line-height: 1.3;
}

/* エクスポート専用プログレスバー */
.export-progress-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.export-progress-modal {
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: progressSlideIn 0.3s ease-out;
}

@keyframes progressSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.export-progress-header {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 20px 25px;
  text-align: center;
}

.export-progress-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0;
}

.export-progress-body {
  padding: 25px;
}

.export-progress-info {
  margin-bottom: 20px;
  text-align: center;
}

.export-progress-status {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.export-progress-details {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.4;
}

.export-progress-bar {
  position: relative;
  background: #e2e8f0;
  border-radius: 12px;
  height: 24px;
  overflow: hidden;
  margin-bottom: 15px;
}

.export-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 12px;
  width: 0%;
  transition: width 0.3s ease;
  position: relative;
}

.export-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.3),
      transparent);
  animation: progressShimmer 2s infinite;
}

@keyframes progressShimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.export-progress-percentage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 600;
  color: #333;
  font-size: 0.9rem;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.export-progress-stats {
  text-align: center;
  font-size: 0.9rem;
  color: #667eea;
  font-weight: 500;
}

.export-progress-footer {
  padding: 15px 25px;
  background: #f8f9fa;
  text-align: center;
  border-top: 1px solid #e2e8f0;
}

/* プログレス中のボタンスタイル */
.export-progress-overlay .btn-compact {
  padding: 8px 20px;
  font-size: 0.9rem;
}

/* エクスポート完了時のアニメーション */
.export-progress-modal.completed .export-progress-fill {
  background: linear-gradient(90deg, #48bb78, #38a169);
}

.export-progress-modal.completed .export-progress-header {
  background: linear-gradient(135deg, #48bb78, #38a169);
}

/* エラー時のスタイル */
.export-progress-modal.error .export-progress-fill {
  background: linear-gradient(90deg, #e53e3e, #c53030);
}

.export-progress-modal.error .export-progress-header {
  background: linear-gradient(135deg, #e53e3e, #c53030);
}

@media (max-width: 600px) {
  .control-group-inline {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .fit-mode-compact {
    justify-content: center;
  }

  .zip-controls {
    align-items: stretch;
  }
}

/* 顔検出初期化ステータス表示 */
.face-detection-status {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.face-detection-status.initializing {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 152, 0, 0.1));
  border-color: rgba(255, 193, 7, 0.3);
}

.face-detection-status.ready {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(139, 195, 74, 0.1));
  border-color: rgba(76, 175, 80, 0.3);
}

.face-detection-status.error {
  background: linear-gradient(135deg, rgba(244, 67, 54, 0.1), rgba(229, 62, 62, 0.1));
  border-color: rgba(244, 67, 54, 0.3);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.status-icon {
  font-size: 1.2rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
}

.status-icon.loading {
  animation: statusPulse 2s infinite;
}

.status-icon.spinning {
  animation: statusSpin 1s linear infinite;
}

@keyframes statusPulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

@keyframes statusSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.status-text {
  font-weight: 600;
  color: #333;
  font-size: 0.95rem;
}

.face-detection-status.ready .status-text {
  color: #2e7d32;
}

.face-detection-status.error .status-text {
  color: #c62828;
}

.face-detection-status.initializing .status-text {
  color: #f57c00;
}

.status-details {
  font-size: 0.8rem;
  color: #666;
  margin-left: 36px;
  line-height: 1.4;
}

.face-detection-status.ready .status-details {
  color: #388e3c;
}

.face-detection-status.error .status-details {
  color: #d32f2f;
}

.face-detection-status.initializing .status-details {
  color: #ef6c00;
}

/* ボタンの無効化状態 */
.control-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #e0e0e0 !important;
  color: #9e9e9e !important;
}

.control-button:disabled:hover {
  transform: none !important;
  box-shadow: none !important;
}
