/* ==============================================
   Analizador de Arco Narrativo - Custom Styles
   ============================================== */

/* Configuración de fuentes globales */
body {
  font-family: 'Inter', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Crimson Text', serif;
}

/* Animaciones personalizadas */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes slideDown {
  from {
    max-height: 0;
    opacity: 0;
  }
  to {
    max-height: 1000px;
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

.pulse-animation {
  animation: pulse 2s ease-in-out infinite;
}

/* Upload Zone Styles */
#upload-zone {
  position: relative;
  overflow: hidden;
}

#upload-zone::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
  transition: left 0.5s;
}

#upload-zone:hover::before {
  left: 100%;
}

#upload-zone.dragover {
  border-color: #3b82f6 !important;
  background-color: rgba(59, 130, 246, 0.1) !important;
  transform: scale(1.02);
}

/* Chapter Card Styles */
.chapter-card {
  transition: all 0.3s ease;
  cursor: pointer;
}

.chapter-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.chapter-card.expanded {
  border-left: 4px solid #3b82f6;
}

/* Score Badge Styles */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-weight: bold;
  font-size: 1.25rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.score-excellent {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.score-good {
  background: linear-gradient(135deg, #10b981, #14b8a6);
  color: white;
}

.score-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}

.score-critical {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

/* Position Badge */
.position-correct {
  color: #10b981;
  font-size: 1.5rem;
}

.position-review {
  color: #f59e0b;
  font-size: 1.5rem;
}

/* Recommendations List */
.recommendations-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
}

.recommendations-list.active {
  max-height: 1000px;
}

.recommendation-item {
  position: relative;
  padding-left: 1.5rem;
}

.recommendation-item::before {
  content: '→';
  position: absolute;
  left: 0;
  color: #3b82f6;
  font-weight: bold;
}

/* Tooltip Styles */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 200px;
  background-color: #1e293b;
  color: #fff;
  text-align: center;
  border-radius: 8px;
  padding: 8px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -100px;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.75rem;
}

.tooltip .tooltiptext::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #1e293b transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* Modal Styles */
#info-modal {
  backdrop-filter: blur(4px);
}

/* Progress Bar Animation */
.step-bar {
  transition: width 1s ease-in-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .score-badge {
    width: 50px;
    height: 50px;
    font-size: 1rem;
  }
  
  h2 {
    font-size: 2rem !important;
  }
  
  .chapter-card {
    padding: 1rem !important;
  }
}

/* Loading spinner */
.spinner {
  border: 3px solid #f3f4f6;
  border-top: 3px solid #3b82f6;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Chart container adjustments */
canvas {
  max-height: 300px;
}

/* Button hover effects */
button {
  position: relative;
  overflow: hidden;
}

button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

button:hover::after {
  width: 300px;
  height: 300px;
}

button > * {
  position: relative;
  z-index: 1;
}

/* Smooth transitions for all interactive elements */
* {
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

button, a, .chapter-card {
  transition: all 0.3s ease;
}
