/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: #2d3748;
  background: linear-gradient(135deg, #e6f3ff 0%, #cce7ff 100%);
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 40px;
  color: #2b6cb0;
}

.header h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 10px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header h1 i {
  margin-right: 15px;
  color: #3182ce;
}

.header p {
  font-size: 1.2rem;
  opacity: 0.8;
  font-weight: 400;
  color: #4a5568;
}

.description {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 20px 24px;
  margin-top: 25px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.description p {
  color: #4a5568;
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
  text-align: center;
}

/* Main content */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* Upload section */
.upload-section {
  width: 100%;
}

.drop-zone {
  background: white;
  border: 3px dashed #90cdf4;
  border-radius: 20px;
  padding: 60px 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.drop-zone:hover {
  border-color: #3182ce;
  background: #f7fafc;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(49, 130, 206, 0.15);
}

.drop-zone.dragover {
  border-color: #3182ce;
  background: linear-gradient(135deg, rgba(49, 130, 206, 0.1), rgba(144, 205, 244, 0.1));
  transform: scale(1.02);
}

.drop-content i {
  font-size: 4rem;
  color: #3182ce;
  margin-bottom: 20px;
  display: block;
}

.drop-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: #2d3748;
}

.drop-content p {
  color: #718096;
  margin-bottom: 20px;
}

.supported-formats {
  margin-top: 15px;
}

.supported-formats small {
  color: #a0aec0;
  font-size: 0.875rem;
}

/* Buttons */
.btn {
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  outline: none;
}

.btn:focus {
  outline: 2px solid rgba(49, 130, 206, 0.5);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, #3182ce, #2b6cb0);
  color: white;
  box-shadow: 0 4px 15px rgba(49, 130, 206, 0.4);
  min-width: 200px;
}

.btn-primary i {
  color: white;
  font-weight: 900;
  font-size: 1.1rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(49, 130, 206, 0.6);
}

.btn-success {
  background: linear-gradient(135deg, #38a169, #2f855a);
  color: white;
  box-shadow: 0 4px 15px rgba(56, 161, 105, 0.4);
  width: 100%;
  justify-content: center;
  font-size: 1.1rem;
  padding: 16px 24px;
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 161, 105, 0.6);
}

.btn-secondary {
  background: #e2e8f0;
  color: #4a5568;
  border: 1px solid #cbd5e0;
}

.btn-secondary:hover {
  background: #cbd5e0;
  transform: translateY(-1px);
}

/* Info section */
.info-section {
  width: 100%;
}

.info-card {
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.file-count {
  background: linear-gradient(135deg, #3182ce, #2b6cb0);
  color: white;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 25px;
  display: inline-block;
}

.compression-info {
  margin-bottom: 30px;
}

.compression-info p {
  color: #4a5568;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.compression-info i {
  color: #3182ce;
}

/* Progress section */
.progress-section {
  width: 100%;
}

.progress-card {
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.progress-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: #2d3748;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.current-file {
  background: #ebf8ff;
  color: #2b6cb0;
  padding: 10px 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-weight: 500;
  border-left: 4px solid #3182ce;
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 15px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #38a169, #2f855a);
  border-radius: 6px;
  transition: width 0.3s ease;
  width: 0%;
}

/* Results section */
.results-section {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.results-section h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: #2b6cb0;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.results-info {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 25px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.results-info p {
  color: #4a5568;
  font-weight: 500;
  margin: 0;
  line-height: 1.6;
}

.results-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 30px;
  background: #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.results-header {
  background: linear-gradient(135deg, #4299e1, #3182ce);
  color: white;
  padding: 16px 24px;
  font-weight: 600;
  font-size: 0.9rem;
  display: grid;
  grid-template-columns: 2fr 1fr auto auto;
  gap: 24px;
  align-items: center;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.results-header span {
  text-align: center;
}

.results-header span:first-child {
  text-align: left;
}

.result-card {
  background: white;
  border-radius: 0;
  padding: 18px 24px;
  transition: all 0.2s ease;
  border: none;
  position: relative;
}

.result-card:first-child {
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.result-card:last-child {
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.result-card:hover {
  background: #f8fafc;
  transform: translateX(4px);
  box-shadow: 4px 0 12px rgba(49, 130, 206, 0.15);
}

.result-content {
  display: grid;
  grid-template-columns: 2fr 1fr auto auto;
  align-items: center;
  gap: 24px;
}

.result-filename {
  font-size: 0.95rem;
  font-weight: 600;
  color: #2d3748;
  word-break: break-all;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-filename::before {
  content: "📄";
  font-size: 1rem;
}

.result-size {
  font-size: 0.88rem;
  color: #4a5568;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
}

.size-arrow {
  color: #3182ce;
  font-weight: 700;
}

.result-compression {
  font-size: 0.9rem;
  font-weight: 700;
  color: #38a169;
  text-align: center;
  background: linear-gradient(135deg, #f0fff4, #c6f6d5);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid #9ae6b4;
  justify-self: center;
}

.result-actions {
  justify-self: end;
  display: flex;
  gap: 8px;
}

.download-btn {
  padding: 8px 16px;
  font-size: 0.85rem;
  border-radius: 20px;
  min-width: 90px;
  background: linear-gradient(135deg, #3182ce, #2b6cb0);
  color: white;
  border: none;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(49, 130, 206, 0.3);
}

.download-btn:hover {
  background: linear-gradient(135deg, #2b6cb0, #2c5282);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(49, 130, 206, 0.4);
}

.webp-btn {
  background: linear-gradient(135deg, #38a169, #2f855a);
  box-shadow: 0 2px 6px rgba(56, 161, 105, 0.3);
}

.webp-btn:hover {
  background: linear-gradient(135deg, #2f855a, #276749);
  box-shadow: 0 4px 12px rgba(56, 161, 105, 0.4);
}

.bulk-download-card {
  background: linear-gradient(135deg, #ebf8ff, #bee3f8);
  border: 2px solid #3182ce;
}

.bulk-download-card .result-filename {
  color: #2b6cb0;
}

.action-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
}

/* Footer */
.footer {
  text-align: center;
  margin-top: 40px;
  padding: 20px;
  color: #4a5568;
  opacity: 0.8;
}

.footer p {
  margin: 0.5rem 0;
}

.footer a {
  color: #3182ce;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.footer a:hover {
  color: #2563eb;
  text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  .header h1 {
    font-size: 2.5rem;
  }

  .drop-zone {
    padding: 40px 20px;
  }

  .drop-content i {
    font-size: 3rem;
  }

  .info-card,
  .progress-card,
  .result-card {
    padding: 20px;
  }

  .file-progress-header,
  .file-progress-item {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .file-progress-header span:nth-child(2),
  .file-progress-header span:nth-child(3),
  .file-progress-item .file-size,
  .file-progress-item .process-time {
    display: none;
  }

  .file-progress-bar {
    width: 60px;
  }

  .progress-info {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .results-header {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 12px 16px;
  }

  .results-header span:not(:first-child) {
    display: none;
  }

  .results-header span:first-child::after {
    content: " / サイズ / 圧縮率 / ダウンロード";
    font-size: 0.8rem;
    opacity: 0.9;
  }

  .result-content {
    grid-template-columns: 1fr;
    gap: 12px;
    text-align: center;
  }

  .result-filename {
    justify-content: center;
  }

  .result-size {
    justify-self: center;
  }

  .result-compression {
    justify-self: center;
  }

  .result-actions {
    justify-self: center;
    flex-direction: column;
    gap: 8px;
  }

  .download-btn {
    width: 100%;
    max-width: 200px;
  }

  .action-buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn-primary {
    min-width: auto;
    width: 100%;
    max-width: 250px;
  }
}

/* Progress section enhancements */
.overall-progress {
  margin-bottom: 30px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 600;
  color: #2d3748;
}

.overall-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.file-progress-container {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.file-progress-header {
  background: linear-gradient(135deg, #4299e1, #3182ce);
  color: white;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 16px;
  align-items: center;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.file-progress-item {
  background: white;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 16px;
  align-items: center;
  transition: background-color 0.2s ease;
}

.file-progress-item:last-child {
  border-bottom: none;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.file-progress-item.processing {
  background: #ebf8ff;
  border-left: 4px solid #3182ce;
}

.file-progress-item.completed {
  background: #f0fff4;
  border-left: 4px solid #38a169;
}

.file-progress-item.error {
  background: #fef5e7;
  border-left: 4px solid #ed8936;
}

.file-name {
  font-weight: 500;
  color: #2d3748;
  word-break: break-all;
}

.file-size {
  font-size: 0.9rem;
  color: #4a5568;
}

.process-time {
  font-size: 0.9rem;
  color: #4a5568;
  font-weight: 500;
}

.file-progress-bar {
  width: 80px;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.file-progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #3182ce, #2b6cb0);
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

.file-progress-fill.completed {
  background: linear-gradient(135deg, #38a169, #2f855a);
}

.file-progress-fill.error {
  background: linear-gradient(135deg, #ed8936, #dd6b20);
}

.status-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.status-icon.processing {
  color: #3182ce;
}

.status-icon.completed {
  color: #38a169;
}

.status-icon.error {
  color: #ed8936;
}
