/* BANETH Upscaler — Dark Premium Theme */

:root {
  --bg: #0a0a0f;
  --bg-card: #12121a;
  --bg-card-hover: #1a1a25;
  --bg-input: #0e0e16;
  --border: #1e1e2e;
  --border-hover: #2a2a3e;
  --text: #e8e8f0;
  --text-muted: #6b6b80;
  --text-dim: #4a4a5e;
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.15);
  --accent-hover: #818cf8;
  --success: #22c55e;
  --success-glow: rgba(34, 197, 94, 0.15);
  --error: #ef4444;
  --error-glow: rgba(239, 68, 68, 0.15);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.screen { display: none; }
.screen.active { display: flex; }
.hidden { display: none !important; }

.accent { color: var(--accent); }
.subtitle { color: var(--text-muted); font-size: 0.9rem; }
.error-text { color: var(--error); font-size: 0.85rem; margin-top: 8px; min-height: 20px; }

/* === LOGIN === */
#login-screen {
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 48px 40px;
  text-align: center;
}

.logo-area { margin-bottom: 40px; }

.logo-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  color: var(--accent);
}

.logo-area h1 {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.logo-area .subtitle {
  font-size: 0.9rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-form input {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-align: center;
  letter-spacing: 0.15em;
}

.login-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.login-form input::placeholder {
  letter-spacing: 0;
  color: var(--text-dim);
}

#login-btn {
  padding: 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

#login-btn:hover { background: var(--accent-hover); }
#login-btn:active { transform: scale(0.98); }

/* === HEADER === */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo { color: var(--accent); }

.header-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.header-right {
  display: flex;
  gap: 8px;
}

.badge {
  padding: 4px 12px;
  background: var(--accent-glow);
  color: var(--accent);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* === MAIN APP === */
#app-screen {
  min-height: 100vh;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(99, 102, 241, 0.04) 0%, transparent 50%),
    var(--bg);
}

main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.section {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === DROP ZONE === */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 80px 40px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s, transform 0.2s;
  background: var(--bg-card);
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.04);
  transform: scale(1.01);
}

.drop-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  color: var(--accent);
  opacity: 0.7;
}

.drop-zone:hover .drop-icon { opacity: 1; }

.drop-content h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.drop-content p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.hint {
  margin-top: 16px;
  font-size: 0.8rem !important;
  color: var(--text-dim) !important;
}

/* === SETTINGS === */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

.preview-card,
.controls-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.info-badge {
  padding: 3px 10px;
  background: var(--accent-glow);
  color: var(--accent);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.preview-wrapper {
  background: var(--bg);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  max-height: 300px;
}

.preview-wrapper img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
}

.filename {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-dim);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

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

.control-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.scale-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.scale-btn {
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
}

.scale-btn:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.scale-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 0 20px var(--accent-glow);
}

.result-info {
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius);
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.info-row + .info-row { border-top: 1px solid var(--border); }

.info-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.info-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.primary-btn {
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.2s, transform 0.1s;
}

.primary-btn:hover { background: var(--accent-hover); }
.primary-btn:active { transform: scale(0.98); }

.secondary-btn {
  width: 100%;
  padding: 12px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 10px;
}

.secondary-btn:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

/* === PROCESSING === */
.processing-card {
  text-align: center;
  padding: 60px 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.processing-animation {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 32px;
}

.processing-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  color: var(--accent);
}

.pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  animation: pulse 2s ease-out infinite;
  opacity: 0;
}

.delay-1 { animation-delay: 0.4s; }
.delay-2 { animation-delay: 0.8s; }

@keyframes pulse {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0.6; }
  100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0; }
}

.processing-card h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 3px;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 40px;
  text-align: right;
}

/* === RESULT === */
.result-card {
  text-align: center;
  padding: 48px 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.result-header {
  margin-bottom: 32px;
}

.success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  color: var(--success);
}

.result-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.result-details {
  max-width: 360px;
  margin: 0 auto 32px;
  padding: 20px;
  background: var(--bg);
  border-radius: var(--radius);
  text-align: left;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.9rem;
}

.detail-row + .detail-row { border-top: 1px solid var(--border); }
.detail-row span:first-child { color: var(--text-muted); }
.detail-row span:last-child { font-weight: 600; }

.download-btn {
  background: var(--success);
  max-width: 360px;
  margin: 0 auto;
}

.download-btn:hover { background: #16a34a; }

.result-card .secondary-btn {
  max-width: 360px;
  margin: 10px auto 0;
}

/* === ERROR === */
.error-card {
  text-align: center;
  padding: 60px 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.error-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  color: var(--error);
}

.error-card h2 {
  color: var(--error);
  margin-bottom: 12px;
}

.error-card p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* === FOOTER === */
footer {
  padding: 20px 32px;
  text-align: center;
  border-top: 1px solid var(--border);
}

footer p {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* === MOBILE === */
@media (max-width: 600px) {
  header { padding: 12px 16px; }
  main { padding: 24px 16px; }
  .drop-zone { padding: 48px 24px; }
  .login-card { padding: 32px 24px; }
  .processing-card, .result-card, .error-card { padding: 40px 24px; }
}
