:root {
  --primary: #22c55e;
  --primary-hover: #4ade80;
  --bg: #020617;
  --card-bg: rgba(15, 23, 42, 0.95);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: #1e293b;
  --accent: #4ade80;
}

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

body {
  font-family: 'Courier New', Courier, monospace;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

.app-wrapper {
  position: relative;
  min-height: 100vh;
  width: 100%;
  display: flex;
  justify-content: center;
}

.matrix-canvas {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: 0.4;
}

.app-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 650px;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

header {
  text-align: center;
  text-shadow: 0 0 15px rgba(34, 197, 94, 0.6);
}

header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 0.2rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--primary);
  border-radius: 4px;
  padding: 2rem;
  box-shadow: 0 0 40px rgba(34, 197, 94, 0.15);
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}

.drop-zone {
  border: 1px dashed var(--primary);
  border-radius: 4px;
  padding: 4rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.drop-zone:hover:not(.processing) {
  background: rgba(34, 197, 94, 0.05);
  box-shadow: inset 0 0 30px rgba(34, 197, 94, 0.1);
  border-style: solid;
}

.drop-zone.processing {
  opacity: 0.5;
  cursor: wait;
}

.upload-icon {
  font-size: 4rem;
  filter: drop-shadow(0 0 10px var(--primary));
}

.preview-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.image-preview {
  max-width: 100%;
  max-height: 400px;
  border-radius: 2px;
  object-fit: contain;
  background: #000;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.8);
  border: 1px solid var(--primary);
}

/* Matrix Progress Bar Styles */
.processing-overlay {
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--primary);
  border-radius: 2px;
}

.matrix-progress-container {
  width: 100%;
}

.matrix-progress-label {
  display: flex;
  justify-content: space-between;
  color: var(--primary);
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
}

.matrix-progress-track {
  height: 20px;
  background: #000;
  border: 1px solid var(--primary);
  position: relative;
  overflow: hidden;
}

.matrix-progress-fill {
  height: 100%;
  background: repeating-linear-gradient(
    90deg,
    var(--primary),
    var(--primary) 15px,
    var(--bg) 15px,
    var(--bg) 20px
  );
  transition: width 0.2s ease-out;
  box-shadow: 0 0 15px var(--primary);
  position: relative;
}

.matrix-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: sweep 2s infinite linear;
}

@keyframes sweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.controls {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(34, 197, 94, 0.2);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 700;
  color: var(--primary);
}

select, input[type="range"] {
  width: 100%;
  padding: 0.85rem;
  background: #000;
  border: 1px solid var(--primary);
  border-radius: 2px;
  color: var(--primary);
  font-size: 1rem;
  cursor: pointer;
  outline: none;
  font-family: inherit;
}

select option {
  background: #000;
}

.btn-primary {
  background: var(--primary);
  color: #000;
  border: none;
  padding: 1.25rem;
  border-radius: 2px;
  font-weight: 900;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent);
  box-shadow: 0 0 30px var(--primary);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-primary:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 0.6rem 1.2rem;
  border-radius: 2px;
  font-size: 0.8rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

footer {
  text-align: center;
  color: var(--primary);
  font-size: 0.75rem;
  margin-top: auto;
  padding: 3rem 0;
  opacity: 0.7;
}

.brand {
  margin-top: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.8rem;
  }
  .card {
    padding: 1rem;
  }
}