:root {
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
}

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

.app-header {
  text-align: center;
  margin-bottom: 2rem;
}

.app-header h1 {
  font-size: 2rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.app-header p {
  color: var(--text-muted);
}

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

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

/* Drop Zone UI */
.drop-zone {
  border: 2px dashed var(--border-color);
  background-color: var(--card-bg);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  position: relative;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary-color);
  background-color: #eeefef;
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-icon {
  width: 48px;
  height: 48px;
  fill: var(--primary-color);
  margin-bottom: 1rem;
}

.drop-zone-prompt p {
  margin-bottom: 0.25rem;
}

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

/* Control Panel */
.controls-panel {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
  border: 1px solid var(--border-color);
}

.control-group {
  margin-bottom: 1.25rem;
}

.control-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.dual-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

input[type="number"], input[type="range"] {
  width: 100%;
}

input[type="number"] {
  padding: 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  outline: none;
}

.btn {
  width: 100%;
  padding: 0.8rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-hover);
}

.btn-primary:disabled {
  background-color: #a5b4fc;
  cursor: not-allowed;
}

/* Preview Section */
.canvas-wrapper {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 350px;
  position: relative;
  overflow: hidden;
}

#canvas {
  max-width: 100%;
  max-height: 400px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.info-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  margin-top: 1.5rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 0.75rem;
  text-align: center;
}

.info-grid span {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.info-grid strong {
  font-size: 1rem;
}

.highlight {
  color: #10b981;
}

.hidden {
  display: none !important;
}