 :root {
  --primary: #6a5acd;
  --primary-dark: #483d8b;
  --primary-light: #9370db;
  --secondary: #10B981;
  --secondary-dark: #059669;
  --danger: #EF4444;
  --warning: #F59E0B;
  --info: #3B82F6;
  --light: #F3F4F6;
  --dark: #1F2937;
  --gray: #6B7280;
  --gray-light: #E5E7EB;
  --white: #FFFFFF;
  --black: #111827;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  background-color: #f5f5f7;
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
   cursor: default;
   color: black;
}

.crosshair-cursor {
            cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" viewBox="0 0 24 24"><path fill="black" d="M12 2L12 10L12 2M12 22L12 14L12 22M2 12L10 12L2 12M22 12L14 12L22 12"/></svg>') 12 12, crosshair;
        }

/* Tipografía */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 0.75rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
  color: var(--gray);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-dark);
}

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

header {
  background-color: var(--primary);
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Tabs */
.tabs-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
  background-color: var(--white);
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  margin-bottom: 1rem;
}

.tab {
  padding: 0.75rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
  font-size: 0.875rem;
  color: var(--gray);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.tab:hover {
  background-color: rgba(106, 90, 205, 0.05);
  color: var(--primary);
}

.tab.active {
  background-color: rgba(106, 90, 205, 0.1);
  border-bottom-color: var(--primary);
  color: var(--primary);
  font-weight: 500;
}

.tab i {
  font-size: 1rem;
}

.tab-badge {
  background-color: var(--danger);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.25rem;
}

/* Contenido de las pestañas */
.tab-content {
  display: none;
  background-color: var(--white);
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  margin-bottom: 1.5rem;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* Áreas de carga */
.upload-area {
  border: 2px dashed var(--gray-light);
  border-radius: 0.5rem;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 1.5rem;
  background-color: var(--light);
}

.upload-area:hover {
  border-color: var(--primary);
  background-color: rgba(106, 90, 205, 0.05);
}

.upload-area i {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.upload-area h3 {
  margin-bottom: 0.5rem;
  color: var(--primary);
  font-size: 1.25rem;
}

.upload-area p {
  color: var(--gray);
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

/* Formularios */
.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--dark);
}

input[type="file"] {
  display: none;
}

select, 
input[type="text"], 
input[type="number"], 
input[type="range"], 
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-light);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: border-color 0.2s;
  background-color: var(--white);
}

select:focus, 
input:focus, 
textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(106, 90, 205, 0.1);
}

input[type="range"] {
  -webkit-appearance: none;
  height: 6px;
  background: var(--gray-light);
  border-radius: 3px;
  padding: 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.range-value {
  display: inline-block;
  width: 40px;
  text-align: center;
  margin-left: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray);
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  gap: 0.5rem;
}

.btn i {
  font-size: 0.875rem;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-secondary {
  background-color: var(--gray-light);
  color: var(--dark);
}

.btn-secondary:hover {
  background-color: #D1D5DB;
}

.btn-success {
  background-color: var(--secondary);
  color: white;
}

.btn-success:hover {
  background-color: var(--secondary-dark);
}

.btn-danger {
  background-color: var(--danger);
  color: white;
}

.btn-warning {
  background-color: var(--warning);
  color: white;
}

.btn-info {
  background-color: var(--info);
  color: white;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
}

.action-buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* Previews y resultados */
.preview-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.preview-item {
  border: 1px solid var(--gray-light);
  border-radius: 0.5rem;
  overflow: hidden;
  transition: all 0.2s;
  background: var(--white);
}

.preview-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.preview-item img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.preview-actions {
  display: flex;
  justify-content: space-around;
  padding: 0.5rem;
  background-color: var(--light);
  border-top: 1px solid var(--gray-light);
}

.preview-actions button {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  transition: color 0.2s;
}

.preview-actions button:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Video preview */
.video-preview-wrapper {
  margin-bottom: 1.5rem;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  background-color: #000;
  border-radius: 0.5rem;
}

.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-info {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--gray);
  display: flex;
  justify-content: space-between;
}

.video-filename {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}

/* Audio tracks */
.audio-tracks-container {
  margin: 1.5rem 0;
}

.audio-track {
  border: 1px solid var(--gray-light);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
  background-color: var(--light);
}

.audio-track-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.audio-track-header h4 {
  font-size: 0.9375rem;
}

.audio-track-controls button {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  margin-left: 0.5rem;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.audio-track-controls button:hover {
  color: var(--primary-dark);
}

.audio-info {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  color: var(--gray);
}

.audio-timeline-container {
  margin: 1rem 0;
}

.audio-timeline {
  height: 1rem;
  background-color: var(--gray-light);
  border-radius: 0.5rem;
  position: relative;
  cursor: pointer;
}

.audio-timeline-progress {
  position: absolute;
  height: 100%;
  background-color: var(--primary);
  border-radius: 0.5rem;
  left: 0;
  width: 0%;
}

.audio-timeline-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background-color: var(--white);
  border: 2px solid var(--primary);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  cursor: ew-resize;
  left: 0%;
}

.time-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--gray);
  margin-top: 0.25rem;
}

/* Modales */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background-color: var(--white);
  border-radius: 0.5rem;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  animation: slideUp 0.3s ease;
}

.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  color: var(--primary);
  font-size: 1.125rem;
  margin-bottom: 0;
}

.modal-body {
  padding: 1.25rem;
}

.modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--gray-light);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray);
  transition: color 0.2s;
}

.close-modal:hover {
  color: var(--dark);
}

/* Progress bars */
.progress-container {
  width: 100%;
  background-color: var(--gray-light);
  border-radius: 0.375rem;
  height: 1rem;
  margin: 1rem 0;
  position: relative;
  overflow: hidden;
}

.progress-bar {
  background-color: var(--primary);
  height: 100%;
  border-radius: 0.375rem;
  width: 0;
  transition: width 0.3s ease;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 0.6875rem;
  font-weight: bold;
}

/* Tooltips */
.tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 200px;
  background-color: var(--dark);
  color: var(--white);
  text-align: center;
  border-radius: 0.375rem;
  padding: 0.5rem;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.8125rem;
  font-weight: normal;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* Animaciones */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
  .tabs-container {
    grid-template-columns: 1fr;
  }
  
  .tab {
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-light);
    border-left: 3px solid transparent;
    justify-content: flex-start;
  }
  
  .tab.active {
    border-left-color: var(--primary);
    border-bottom: 1px solid var(--gray-light);
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
  
  .preview-container {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

/* Estilos específicos para el editor de dibujo */
.canvas-container {
  position: relative;
  border: 1px solid var(--gray-light);
  border-radius: 0.5rem;
  overflow: hidden;
  background-color: var(--white);
}

#main-canvas {
  display: block;
  background-color: var(--white);
  cursor: crosshair;
}

.tool-group {
  margin-bottom: 1rem;
  border: 1px solid var(--gray-light);
  border-radius: 0.5rem;
  overflow: hidden;
}

.tool-group-title {
  padding: 0.75rem;
  background-color: var(--light);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tool-group-content {
  padding: 0.75rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.tool-btn:hover {
  background-color: var(--light);
  border-color: var(--gray-light);
}

.tool-btn.active {
  background-color: var(--primary-light);
  color: var(--white);
  border-color: var(--primary);
}

.color-preview {
  width: 24px;
  height: 24px;
  border-radius: 0.25rem;
  border: 1px solid var(--gray-light);
}

/* Estilos para el editor de audio */
.waveform {
  background-color: var(--light);
  border-radius: 0.375rem;
  height: 3rem;
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* Efectos de hover y focus */
button, input, select, textarea {
  transition: all 0.2s ease;
}

button:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(106, 90, 205, 0.3);
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-light);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* Clases utilitarias */
.hidden {
  display: none !important;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--gray);
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.5rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.5rem; }

.rounded {
  border-radius: 0.375rem;
}

.shadow-sm {
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.shadow {
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Estilos para la sección de voces */
.voice-preset {
  transition: all 0.2s;
  border-radius: 0.5rem;
  padding: 0.75rem;
  text-align: center;
  border: 1px solid var(--gray-light);
}

.voice-preset:hover {
  border-color: var(--primary);
  background-color: rgba(106, 90, 205, 0.05);
}

.voice-preset i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

/* Efectos de transición para suavizar interacciones */
.tab-content, .modal-content, .preview-item, .tool-btn {
  transition: all 0.3s ease;
}

/* Estilos para el editor de video */
.timeline {
  background-color: var(--white);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-top: 1rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.timeline-track {
  height: 3rem;
  background-color: var(--light);
  border-radius: 0.25rem;
  margin-bottom: 0.5rem;
  position: relative;
}

.timeline-clip {
  position: absolute;
  height: 2rem;
  top: 0.5rem;
  background-color: var(--primary);
  border-radius: 0.25rem;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  padding: 0 0.5rem;
  min-width: 2rem;
}

.timeline-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--danger);
  z-index: 10;
  pointer-events: none;
}

/* Estilos para los banners publicitarios */
.ad-banner {
  background-color: var(--light);
  border: 1px dashed var(--gray);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin: 1.5rem 0;
  text-align: center;
  color: var(--gray);
}

.ad-banner.horizontal {
  width: 100%;
  min-height: 90px;
}

.ad-banner.vertical {
  width: 300px;
  min-height: 250px;
  float: right;
  margin-left: 1.5rem;
}

.ad-banner.leaderboard {
  width: 100%;
  height: 90px;
}

#selection-box {
    border: 1px dashed black;
    position: absolute;
    pointer-events: none;
    display: none; /* hidden por defecto */
}

/* También puedes estilizar los handles de redimensionamiento */
#selection-box .resize-handle {
    background-color: black;
    border: 1px solid white;
    width: 8px;
    height: 8px;
    position: absolute;
    z-index: 10;
}

.audio-track {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.audio-track-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.audio-track-header h4 {
    margin: 0;
    font-size: 1.1em;
    color: #333;
}

.audio-track-controls button {
    background: none;
    border: none;
    color: #6a5acd;
    cursor: pointer;
    margin-left: 8px;
    font-size: 1em;
}

.audio-info {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
    font-size: 0.9em;
    color: #555;
}

.time-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 5px;
}

.time-range-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.time-range-inputs input {
    flex: 1;
}

.time-range-inputs span {
    color: #666;
}

.hint {
    display: block;
    color: #666;
    font-size: 0.8em;
    margin-top: 4px;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.volume-control input[type="range"] {
    flex: 1;
}

.range-value {
    width: 40px;
    text-align: right;
    font-size: 0.9em;
}


/* Media queries para responsive design */
@media (max-width: 1024px) {
  .tool-group-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .tool-group-content {
    grid-template-columns: 1fr;
  }
  
  .ad-banner.vertical {
    width: 100%;
    float: none;
    margin-left: 0;
  }
}