/**
 * AudioPlayerComponent Styles
 * 
 * Minimalista, inspirado en el reproductor de Chrome
 * Diseño limpio y profesional
 * Responsive para desktop y mobile
 */

.audio-player-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #dadce0;
  font-family: 'Raleway', sans-serif;
  max-width: 100%;
  box-sizing: border-box;
  box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
}

.audio-player-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Play button - estilo Chrome */
.audio-player-play-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #1a73e8;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3);
}

.audio-player-play-btn:hover:not(:disabled) {
  background: #1765cc;
  box-shadow: 0 1px 3px 0 rgba(60,64,67,0.4);
}

.audio-player-play-btn:active:not(:disabled) {
  background: #1557b0;
}

.audio-player-play-btn:disabled {
  background: #dadce0;
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.audio-player-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.audio-player-title {
  font-size: 13px;
  font-weight: 500;
  color: #202124;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.audio-player-time {
  font-size: 11px;
  color: #5f6368;
  display: flex;
  align-items: center;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

.audio-player-current-time,
.audio-player-duration {
  font-variant-numeric: tabular-nums;
}

.audio-player-separator {
  color: #dadce0;
}

/* Progress bar - estilo Chrome */
.audio-player-progress-container {
  width: 100%;
}

.audio-player-progress-bar {
  width: 100%;
  height: 4px;
  background: #e8eaed;
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: height 0.2s ease;
}

.audio-player-progress-bar:hover {
  height: 6px;
}

.audio-player-progress-fill {
  height: 100%;
  background: #1a73e8;
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
  position: relative;
}

.audio-player-progress-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: #1a73e8;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.audio-player-progress-bar:hover .audio-player-progress-fill::after {
  opacity: 1;
}

/* Volume controls - estilo Chrome */
.audio-player-volume-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}

.audio-player-volume-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #5f6368;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background 0.2s ease, color 0.2s ease;
}

.audio-player-volume-btn:hover {
  background: #f1f3f4;
  color: #202124;
}

.audio-player-volume-slider {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #e8eaed;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.audio-player-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #1a73e8;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.audio-player-volume-slider::-webkit-slider-thumb:hover {
  background: #1765cc;
  transform: scale(1.1);
}

.audio-player-volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #1a73e8;
  cursor: pointer;
  border: none;
  transition: background 0.2s ease, transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.audio-player-volume-slider::-moz-range-thumb:hover {
  background: #1765cc;
  transform: scale(1.1);
}

/* Error state */
.audio-player-controls.audio-player-error {
  background: #fef7e0;
  border-color: #f9ab00;
}

.audio-player-controls.audio-player-error .audio-player-play-btn {
  background: #ea8600;
}

.audio-player-controls.audio-player-error .audio-player-title {
  color: #ea8600;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .audio-player-controls {
    padding: 12px;
    gap: 8px;
  }
  
  .audio-player-main {
    gap: 10px;
  }
  
  .audio-player-play-btn {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
  
  .audio-player-title {
    font-size: 12px;
  }
  
  .audio-player-time {
    font-size: 10px;
  }
  
  .audio-player-volume-container {
    gap: 6px;
  }
  
  .audio-player-volume-btn {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
  
  .audio-player-progress-bar:hover {
    height: 4px; /* No aumentar en mobile */
  }
  
  .audio-player-progress-fill::after {
    width: 10px;
    height: 10px;
  }
}

/* Compact mode for accordions */
.audio-player-compact {
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  max-width: 340px; /* Reducido de 450px (25% menos) */
  width: auto;
  display: inline-flex;
}

.audio-player-compact .audio-player-play-btn {
  width: 28px; /* Reducido de 32px (12.5% menos) */
  height: 28px;
  font-size: 11px;
}

.audio-player-compact .audio-player-time {
  font-size: 10px;
  color: #5f6368;
  white-space: nowrap;
  min-width: 75px; /* Reducido de 85px */
  flex-shrink: 0;
}

.audio-player-compact .audio-player-progress-container {
  flex: 1;
  min-width: 80px; /* Reducido de 100px */
}

.audio-player-compact .audio-player-progress-bar {
  height: 3px; /* Reducido de 4px */
}

.audio-player-compact .audio-player-progress-bar:hover {
  height: 5px; /* Reducido de 6px */
}

.audio-player-compact .audio-player-volume-btn {
  width: 24px; /* Reducido de 28px */
  height: 24px;
  font-size: 12px;
  flex-shrink: 0;
}

/* Ajustes para vista compacta en mobile */
@media (max-width: 768px) {
  .audio-player-compact {
    gap: 8px;
    padding: 6px 10px;
    max-width: 100%;
  }
  
  .audio-player-compact .audio-player-play-btn {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }
  
  .audio-player-compact .audio-player-time {
    font-size: 10px;
    min-width: 70px;
  }
  
  .audio-player-compact .audio-player-volume-btn {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
  
  .audio-player-compact .audio-player-progress-bar:hover {
    height: 3px; /* No aumentar en mobile */
  }
  
  /* Layout vertical en mobile para acordeones */
  .informacion-pdf-accordion > div:has(.audio-player-placeholder) {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px;
    padding: 10px 15px !important;
  }
  
  .informacion-pdf-accordion > div:has(.audio-player-placeholder) p {
    width: 100% !important;
    max-width: 100% !important;
    line-height: 1.4 !important;
  }
  
  .informacion-pdf-accordion .audio-player-placeholder {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
  }
  
  .informacion-pdf-accordion .audio-player-controls {
    width: 100% !important;
    max-width: 100% !important;
  }
}

.financial-panel .audio-player-controls {
  margin: 8px 0;
}

/* Ajustes específicos para acordeones de información financiera */
.informacion-pdf-accordion .audio-player-placeholder {
  width: auto !important;
  max-width: 340px; /* Ajustado para el tamaño reducido */
  height: auto !important;
  margin: 0 !important;
  margin-left: auto !important;
  flex-shrink: 0;
  align-self: center;
}

.informacion-pdf-accordion .audio-player-controls {
  margin: 0 !important;
  padding: 6px 10px !important;
  width: auto;
  max-width: 340px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
}

/* Ajustar el layout del div contenedor cuando tiene audio player */
.informacion-pdf-accordion > div:has(.audio-player-placeholder) {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  height: auto !important;
  min-height: 50px;
  gap: 16px;
  padding: 12px 20px !important;
  flex-wrap: nowrap !important;
}

.informacion-pdf-accordion > div:has(.audio-player-placeholder) p {
  line-height: 1.4 !important;
  margin: 0 !important;
  flex: 1 1 auto !important;
  text-align: left;
  min-width: 0;
  max-width: none !important;
}

/* Loading animation */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.fa-spinner.fa-spin {
  animation: spin 1s linear infinite;
}

/* Smooth transitions */
.audio-player-controls * {
  transition-timing-function: cubic-bezier(0.4, 0.0, 0.2, 1);
}
