:root {
  --bg-color: #0f172a;
  --card-bg: #1e293b;
  --accent: #8b5cf6;
  --text: #f8fafc;
}

body {
  background-color: var(--bg-color);
  color: var(--text);
  font-family: "Poppins", sans-serif;
  margin: 0;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.container {
  background-color: var(--card-bg);
  width: 100%;
  max-width: 500px;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  text-align: center;
}

h1 {
  margin: 0;
  color: var(--accent);
}
p {
  color: #94a3b8;
  margin-top: 5px;
}

/* File Input */
input[type="file"] {
  display: none;
}
.btn-primary {
  background-color: var(--accent);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: inline-block;
  transition: 0.2s;
  font-size: 1rem;
}
.btn-primary:hover {
  opacity: 0.9;
}
.btn-primary:disabled {
  background-color: #475569;
  cursor: not-allowed;
}

/* Canvas */
.canvas-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  background-color: #334155;
  margin: 20px 0;
  border-radius: 12px;
  overflow: hidden;
  cursor: grab; /* Indica que se puede arrastrar */
  touch-action: none; /* Previene scroll en móbiles al tocar canvas */
}

.canvas-wrapper:active {
  cursor: grabbing;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

#placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #94a3b8;
  pointer-events: none;
}

/* Editor Panel */
.editor-panel {
  background: rgba(0, 0, 0, 0.2);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: left;
}

.control-group {
  margin-bottom: 12px;
}
.control-group label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 5px;
  color: #cbd5e1;
}
.control-group small {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 4px;
}

/* Sliders Grid */
.sliders-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* 2 columnas */
  gap: 15px;
}
.sliders-grid .control-group:last-child {
  grid-column: span 2; /* El radius ocupa todo el ancho */
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

/* Toggle Radio Buttons */
.toggle-options {
  display: flex;
  gap: 10px;
  background: #0f172a;
  padding: 5px;
  border-radius: 6px;
  display: inline-flex;
}
.toggle-options input {
  display: none;
}
.toggle-options label {
  padding: 6px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 4px;
  color: #94a3b8;
}
.toggle-options input:checked + label {
  background-color: var(--accent);
  color: white;
}

/* Thumbnails */
.frames-grid {
  display: flex;
  justify-content: start; /* Align to start for scrolling */
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: nowrap; /* Prevent wrapping */
  overflow-x: auto; /* Enable horizontal scroll */
  padding-bottom: 10px; /* Space for scrollbar */
}
/* Optional: Custom Scrollbar for better look */
.frames-grid::-webkit-scrollbar {
  height: 8px;
}
.frames-grid::-webkit-scrollbar-track {
  background: #334155;
  border-radius: 4px;
}
.frames-grid::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}
.frame-thumb {
  width: 60px;
  height: 60px;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  background: #fff;
  object-fit: contain;
}
.frame-thumb.selected {
  border-color: var(--accent);
  transform: scale(1.1);
}

/* --- Hero Section --- */
.hero {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-color);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10%;
  overflow: hidden;
}

.hero-content {
  flex: 1;
  max-width: 600px;
  z-index: 2;
}

.hero-content h1 {
  font-size: 3.5rem;
  line-height: 1.1;
  margin-bottom: 2rem;
  font-weight: 700;
  color: white;
  background: none;
  -webkit-text-fill-color: white;
  text-shadow: none;
}

.hero-content h1 .highlight {
  color: #34cab1;
  -webkit-text-fill-color: #34cab1;
}

/* Global highlight for tool title */
h1 .highlight {
  color: #34cab1;
  -webkit-text-fill-color: #34cab1;
}

.btn-large {
  padding: 16px 40px;
  font-size: 1.2rem;
  border-radius: 50px;
  background-color: #facc15;
  color: #000;
}
.btn-large:hover {
  background-color: #eab308;
  opacity: 1;
}

/* Hero Visuals (Tilted Grid) */
.hero-visuals {
  flex: 1;
  display: flex;
  gap: 20px;
  transform: rotate(-15deg) translateY(-50px) translateX(50px);
  opacity: 0.8;
  pointer-events: none;
}

.visual-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.col-2 {
  margin-top: 50px;
}

.hero-visuals img {
  width: 250px;
  height: 250px;
  object-fit: contain;
  background: #1e293b;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding: 20px;
  }
  .hero-content h1 {
    font-size: 2.5rem;
  }
  .hero-visuals {
    position: absolute;
    opacity: 0.15;
    z-index: 1;
    transform: rotate(-10deg) scale(0.8);
  }
}
