:root {
  --primary: #0056b3;
  --secondary: #ff6600;
  --accent: #00a859;
  --bg-dark: #0f172a;
  --card-bg: rgba(30, 41, 59, 0.7);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --glass-border: rgba(255, 255, 255, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  background: radial-gradient(circle at top left, #1e293b, #0f172a);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
}

.container {
  max-width: 1200px;
  width: 100%;
}

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

header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(to right, #60a5fa, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

header p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.stats-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #60a5fa;
  margin-top: 0.5rem;
}

.stats-badge i {
  font-size: 0.75rem;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

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

.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.upload-section h2 {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.upload-group {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.file-input-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.file-input-wrapper label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.drop-zone {
  height: 120px;
  border: 2px dashed var(--glass-border);
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.02);
}

.drop-zone:hover {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.05);
}

.drop-zone.active {
  border-color: var(--accent);
  background: rgba(16, 185, 129, 0.05);
}

.drop-zone i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.drop-zone span {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.preview-thumb {
  position: absolute;
  right: 10px;
  top: 35px;
  width: 80px;
  height: 80px;
  border-radius: 0.5rem;
  object-fit: cover;
  display: none;
  border: 2px solid var(--primary);
}

input[type="file"] {
  display: none;
}

.action-bar {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  width: 100%;
  justify-content: center;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.result-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.result-preview {
  width: 100%;
  aspect-ratio: 4/5;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

#output-canvas {
  max-width: 100%;
  max-height: 100%;
  display: none;
}

.placeholder-text {
  color: var(--text-muted);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.placeholder-text i {
  font-size: 3rem;
  opacity: 0.3;
}

.download-btn {
  background: var(--accent);
  color: white;
  display: none;
}

.loader {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s linear infinite;
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

footer {
  margin-top: 4rem;
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid var(--glass-border);
  width: 100%;
}

footer p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

footer a:hover {
  color: #60a5fa;
}
