/* TextoVoz PWA - Estilos principales */

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

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

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

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

@keyframes recording {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  50% { box-shadow: 0 0 0 20px rgba(239, 68, 68, 0); }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

.animate-pulse-slow {
  animation: pulse 2s infinite;
}

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

.animate-recording {
  animation: recording 1.5s infinite;
}

/* Botones con efecto glass */
.btn-glass {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.btn-glass:active {
  transform: translateY(0);
}

.btn-glass:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Cards con efecto glass */
.card-glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
}

/* Textarea personalizado */
.textarea-custom {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: white;
  resize: none;
  transition: all 0.3s ease;
}

.textarea-custom:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.8);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3);
}

.textarea-custom::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* Input personalizado */
.input-custom {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: white;
  transition: all 0.3s ease;
}

.input-custom:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.8);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3);
}

.input-custom::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* Tabs */
.tab-btn {
  transition: all 0.3s ease;
  position: relative;
}

.tab-btn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, #8b5cf6, #ec4899);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.tab-btn.active::after {
  width: 80%;
}

.tab-btn.active {
  color: white;
  background: rgba(139, 92, 246, 0.3);
}

/* Modal */
.modal-overlay {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

/* Progress bar */
.progress-bar {
  background: linear-gradient(90deg, #8b5cf6, #ec4899, #8b5cf6);
  background-size: 200% 100%;
  animation: shimmer 2s infinite linear;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* Tooltip */
.tooltip {
  position: relative;
}

.tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  font-size: 12px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  margin-bottom: 8px;
}

.tooltip:hover::before {
  opacity: 1;
}

/* Lista de guardados */
.saved-item {
  transition: all 0.3s ease;
}

.saved-item:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateX(5px);
}

/* Audio player personalizado */
.audio-controls {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(236, 72, 153, 0.3));
  border-radius: 16px;
  padding: 16px;
}

/* Botón de grabación */
.record-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.record-btn.recording {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  animation: recording 1.5s infinite;
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.toast.success {
  border-left: 4px solid #10b981;
}

.toast.error {
  border-left: 4px solid #ef4444;
}

.toast.info {
  border-left: 4px solid #3b82f6;
}

/* Formato de texto procesado */
.formatted-text strong {
  font-weight: 700;
}

.formatted-text h1, .formatted-text h2, .formatted-text h3 {
  margin-top: 16px;
  margin-bottom: 8px;
}

.formatted-text ul, .formatted-text ol {
  padding-left: 20px;
  margin: 8px 0;
}

.formatted-text li {
  margin: 4px 0;
}

/* Responsivo */
@media (max-width: 640px) {
  .btn-glass {
    padding: 10px 16px;
    font-size: 14px;
  }
  
  .card-glass {
    border-radius: 16px;
    padding: 16px;
  }
}

/* Loader */
.loader {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s ease infinite;
}

/* Highlight de búsqueda */
.search-highlight {
  background: rgba(250, 204, 21, 0.5);
  padding: 2px 4px;
  border-radius: 4px;
}

/* PWA Install banner */
.install-banner {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  padding: 12px 20px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
