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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
  color: #333;
}

.container {
  max-width: 100%;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px;
  text-align: center;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

header p {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 15px;
}

.stats-link,
.comparison-link {
  display: inline-block;
  margin: 5px;
  padding: 10px 20px;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s;
  vertical-align: middle;
  font-size: 0.95rem;
  line-height: 1.5;
}

.stats-link {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.stats-link:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.comparison-link {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  border: 2px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
  position: relative;
  overflow: hidden;
}

.comparison-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.comparison-link:hover::before {
  left: 100%;
}

.comparison-link:hover {
  background: linear-gradient(135deg, #20c997 0%, #17a589 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

.comparison-link:active,
.stats-link:active {
  transform: translateY(0);
}

.content {
  padding: 20px;
}

.control-panel {
  background: #f8f9fa;
  padding: 25px;
  border-radius: 8px;
  margin-bottom: 25px;
  border: 2px solid #e9ecef;
}

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

.control-group:last-child {
  margin-bottom: 0;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #495057;
}

input[type="file"] {
  display: block;
  width: 100%;
  padding: 12px;
  border: 2px dashed #667eea;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  transition: all 0.3s;
}

input[type="file"]:hover {
  border-color: #764ba2;
  background: #f8f9ff;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 15px 30px;
  font-size: 1.1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  font-weight: 600;
  width: 100%;
}

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

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.status {
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-weight: 500;
  display: none;
}

.status.show {
  display: block;
}

.status.info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.status.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.progress-container {
  margin-bottom: 20px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font-weight: 600;
  color: #495057;
}

.progress-bar {
  width: 100%;
  height: 30px;
  background: #e9ecef;
  border-radius: 15px;
  overflow: hidden;
  display: none;
}

.progress-bar.show {
  display: block;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  transition: width 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.metric-card {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

.metric-card h3 {
  color: #667eea;
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.metric-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #e9ecef;
  align-items: start;
}

.metric-item:last-child {
  border-bottom: none;
}

.metric-label {
  font-weight: 600;
  color: #495057;
  word-break: break-word;
}

.metric-value {
  color: #667eea;
  font-weight: 600;
  text-align: right;
  word-break: break-all;
  overflow-wrap: break-word;
}

video {
  width: 100%;
  max-width: 100%;
  border-radius: 8px;
  margin-top: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: none;
}

video.show {
  display: block;
}

.button-group {
  display: flex;
  gap: 15px;
  margin-top: 20px;
  flex-wrap: wrap;
}

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

.secondary-btn {
  background: #6c757d;
}

.secondary-btn:hover {
  box-shadow: 0 5px 15px rgba(108, 117, 125, 0.4);
}

.system-info {
  background: #fff3cd;
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 20px;
  border: 1px solid #ffeaa7;
}

.system-info h3 {
  color: #856404;
  margin-bottom: 10px;
}

.system-info pre {
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: #856404;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.batch-results {
  margin-top: 30px;
}

.batch-item {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 15px;
  border-left: 4px solid #28a745;
}

.batch-item.error {
  border-left-color: #dc3545;
}

.batch-item h4 {
  color: #495057;
  margin-bottom: 10px;
}

.file-counter {
  font-size: 0.9rem;
  color: #6c757d;
  margin-top: 5px;
}

.file-metadata {
  background: #e7f3ff;
  padding: 15px;
  border-radius: 6px;
  margin-top: 15px;
  border: 1px solid #b3d9ff;
  display: none;
}

.file-metadata.show {
  display: block;
}

.file-metadata h4 {
  color: #004085;
  margin-bottom: 10px;
}

.metadata-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}

.metadata-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 8px;
  background: white;
  border-radius: 4px;
  align-items: center;
}

.metadata-label {
  font-weight: 600;
  color: #004085;
  white-space: nowrap;
}

.metadata-value {
  color: #0056b3;
  font-weight: 600;
  text-align: right;
  word-break: break-all;
  overflow-wrap: break-word;
}

/* Mobile responsive */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  header h1 {
    font-size: 1.8rem;
  }

  header p {
    font-size: 0.9rem;
  }

  .stats-link,
  .comparison-link {
    display: block;
    margin: 10px auto;
    max-width: 300px;
    text-align: center;
  }

  .content {
    padding: 15px;
  }

  .control-panel {
    padding: 15px;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .button-group {
    flex-direction: column;
  }

  .button-group button {
    width: 100%;
    min-width: unset;
  }

  .metadata-grid {
    grid-template-columns: 1fr;
  }

  .metric-item {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .metric-value {
    text-align: left;
  }

  .metadata-item {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .metadata-value {
    text-align: left;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.5rem;
  }

  button {
    padding: 12px 20px;
    font-size: 1rem;
  }
}