:root {
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-color: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --success-color: #22c55e;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #3b82f6;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  padding-bottom: 3rem;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-color);
}

.subtitle {
  color: var(--text-muted);
  margin-top: 0.5rem;
}

code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
}

.upload-section {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
  text-align: center;
}

.upload-area {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #fdfdfd;
}

.upload-area:hover {
  border-color: var(--primary-color);
  background: #f0f4ff;
}

.upload-area.drag-over {
  border-color: var(--primary-color);
  background: #e0e7ff;
}

.upload-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: block;
}

.upload-text {
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.upload-hint {
  font-size: 0.8rem;
  color: #999;
  margin-top: 0.5rem;
}

#fileInput {
  display: none;
}

.file-list {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.btn {
  background: var(--primary-color);
  color: white;
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 1rem;
  transition: all 0.2s ease;
  font-weight: 500;
}

.btn:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

#resultsContainer {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.result-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  border: 1px solid var(--border-color);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.result-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.language-pair {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-badge {
  background: #e0e7ff;
  color: #3730a3;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.8rem;
}

.arrow-separator {
  color: var(--text-muted);
  font-weight: 300;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-color);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  border: 1px solid var(--border-color);
}

.stat-value {
  font-weight: 700;
  font-size: 1.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value.success {
  color: var(--success-color);
}

.stat-value.error {
  color: var(--error-color);
}

.stat-value.warning {
  color: var(--warning-color);
}

.images-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .images-grid {
    grid-template-columns: 1fr;
  }
}

.image-container {
  text-align: center;
}

.image-label {
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.image-wrapper {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  background: #f1f5f9;
  cursor: zoom-in;
  transition: all 0.2s ease;
}

.image-wrapper:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.image-wrapper img {
  max-width: 100%;
  height: auto;
  display: block;
}

.issues-box {
  border-left: 4px solid;
  padding: 1rem;
  border-radius: 4px;
  margin-top: 1rem;
}

.issues-box.error {
  background: #fef2f2;
  border-left-color: var(--error-color);
}

.issues-box.warning {
  background: #fff7ed;
  border-left-color: var(--warning-color);
}

.issues-box.info {
  background: #f0f4ff;
  border-left-color: var(--info-color);
}

.issues-title {
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.issue-item {
  font-size: 0.9rem;
  margin: 0.5rem 0;
  padding: 0.5rem;
  background: white;
  border-radius: 6px;
  border-left: 3px solid;
}

.issue-text {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.issue-description {
  color: #374151;
  margin-left: 0.5rem;
}

.issue-type {
  color: #6b7280;
  font-size: 0.8rem;
  margin-left: 8px;
}

.lightbox-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox-modal.active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.lightbox-modal.active .lightbox-content {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.3);
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.lightbox-close:hover {
  background: rgba(0, 0, 0, 0.6);
}

.lightbox-caption {
  position: absolute;
  bottom: 20px;
  color: #ccc;
  font-size: 14px;
}

.loader {
  border: 4px solid #f3f3f3;
  border-radius: 50%;
  border-top: 4px solid var(--primary-color);
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loader-container {
  text-align: center;
  padding: 3rem;
}

.loader-text {
  margin-top: 1rem;
  color: #666;
}

.error-message {
  background: #fef2f2;
  border-left: 4px solid var(--error-color);
  padding: 1.5rem;
  border-radius: 8px;
  text-align: center;
}

.error-message h3 {
  color: var(--error-color);
  margin-bottom: 0.5rem;
}

.error-message p {
  color: var(--text-color);
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  .upload-section {
    padding: 1.5rem;
  }

  .result-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .lightbox-close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 30px;
  }
}
