/* ------------------- ESTILO GLOBAL ------------------- */
:root {
  --color-primary: #0d6efd;
  --color-success: #198754;
  --radius-lg: 0.75rem;
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --transition-fast: all 0.25s ease;
  --font-family: 'Inter', sans-serif;
}

html {
  overflow-y: scroll;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: clamp(1rem, 1vw + 0.2rem, 1.1rem);
  line-height: 1.7;
  background-color: #f9fafb;
  color: #212529;
  margin: 0;
  padding: 0;
}

/* ------------------- NAVBAR ------------------- */
.navbar {
  min-height: 72px;
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
}

.navbar .nav-link {
  font-weight: 500;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.navbar .nav-link:hover {
  opacity: 0.85;
}

.navbar * {
  box-sizing: border-box;
}

/* ------------------- TARJETAS ------------------- */
.card {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  background-color: white;
  overflow: visible;
}

/* ------------------- FORMULARIOS ------------------- */
.form-control,
.form-select {
  border-radius: var(--radius-lg);
  border: 1px solid #ced4da;
  transition: var(--transition-fast);
  font-size: 1rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* ------------------- BOTONES ------------------- */
button,
.btn {
  border-radius: var(--radius-lg);
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition-fast);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-primary,
.btn-success,
.btn-outline-primary,
.btn-outline-secondary {
  border-width: 2px;
}

.btn-primary {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.btn-primary:hover {
  background-color: #084298;
  border-color: #084298;
}

.btn-success {
  background-color: var(--color-success);
  border-color: var(--color-success);
  color: white;
}
.btn-success:hover {
  background-color: #145c32;
  border-color: #145c32;
}

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

.btn-outline-secondary {
  color: #6c757d;
  border-color: #6c757d;
  background-color: white;
}
.btn-outline-secondary:hover {
  background-color: #6c757d;
  color: white;
}

button:disabled,
.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* ------------------- PISCINA ------------------- */
#piscinaContainer {
  background-color: #e6f7ff;
  border: 2px dashed #007bff;
  padding: 1rem;
  border-radius: var(--radius-lg);
  width: fit-content;
  height: fit-content;
  min-width: 300px;
  min-height: 200px;
  max-width: 100%;
  box-sizing: border-box;
}

#piscina {
  display: block;
  width: 100% !important;
  height: 100% !important;
  background-image:
    linear-gradient(to right, rgba(0,0,0,0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,0,0,0.05) 1px, transparent 1px);
  background-size: 45px 45px;
  background-position: top left;
  overflow: hidden;
}

/* ------------------- TIMELINE ------------------- */
.timeline-placeholder {
  display: flex;
  overflow-x: auto;
  gap: 10px;
  padding: 1rem;
  border: 1px solid #ddd;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.timeline-placeholder .step {
  min-width: 100px;
  padding: 0.5rem;
  border: 1px solid #ccc;
  background: white;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  box-shadow: 1px 1px 3px rgba(0,0,0,0.05);
}
.timeline-placeholder .step:hover {
  background-color: #dbeafe;
  font-weight: bold;
  transform: scale(1.03);
}
.step.active {
  background-color: #0d6efd !important;
  color: white !important;
  font-weight: bold;
}

/* ------------------- AUTOCOMPLETADO ------------------- */
#sugerenciasFigura {
  margin-top: 4px;
  padding: 6px 0;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  max-height: 160px;
  overflow-y: auto;
  position: absolute;
  width: 100%;
  z-index: 10;
}
#sugerenciasFigura button {
  display: block;
  width: 100%;
  padding: 6px 12px;
  font-size: 0.9rem;
  border: none;
  background: none;
  text-align: left;
  color: #333;
  cursor: pointer;
  transition: background 0.2s ease;
}
#sugerenciasFigura button:hover {
  background-color: #edf6ff;
  color: #007bff;
  font-weight: 500;
}

/* ------------------- VISTA PREVIA FIGURA ------------------- */
#previewFigura img {
  margin-top: 8px;
  max-width: 100%;
  border: 1px solid #ddd;
  border-radius: 6px;
  height: auto;
}
#previewFigura p {
  font-size: 0.85rem;
  color: #555;
  margin-top: 4px;
}

/* ------------------- MULTIMEDIA ------------------- */
#waveform {
  width: 100%;
  height: 100px;
  margin-bottom: 10px;
}
#audioPlayer {
  display: none;
}

/* ------------------- RESPONSIVO ------------------- */
@media (max-width: 768px) {
  #piscina {
    min-height: 280px;
  }

  .timeline-placeholder .step {
    min-width: 80px;
    font-size: 0.75rem;
  }
}
