/* ---------- Estilos Modernos ---------- */

:root {
  --primary-gradient: linear-gradient(135deg, rgba(255, 0, 0, 0.8), rgba(204, 0, 0, 0.8));
  --secondary-gradient: linear-gradient(135deg, rgba(128, 128, 128, 0.8), rgba(102, 102, 102, 0.8));
  --glass-bg: rgba(255, 255, 255, 0.8);
  --message-user-bg: linear-gradient(to right, rgba(255, 0, 0, 0.05), rgba(255, 0, 0, 0.1));
  --message-bot-bg: linear-gradient(to right, rgba(128, 128, 128, 0.05), rgba(128, 128, 128, 0.1));
  --input-bg: rgba(255, 255, 255, 0.95);
  --text-primary: #cc0000;
  --text-secondary: #666666;
  --shadow-color: rgba(0, 0, 0, 0.1);
}

/* Agregar al final de style.css: Ocultar botón de cámara en PC */
@media (min-width: 768px) {
  #camera-button {
    display: none;
  }
}


body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(45deg, #f8f9fa, #e9ecef);
  color: #1f2937;
  height: 100%;
  display: flex;
  flex-direction: column;
}

#chat-container {
  flex: 1;
  width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 100vh;
}

#chat-header {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 1000;
  box-shadow: 0 4px 30px var(--shadow-color);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.new-chat-btn {
  background: transparent;
  border: none;
  color: rgba(0, 0, 0, 0.6);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.new-chat-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #cc0000;
}

.new-chat-btn:active {
  transform: scale(0.95);
}

.header-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

#chat-header img {
  height: 45px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#chat-header img:hover {
  transform: scale(1.1) rotate(-5deg);
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.15));
}

#chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: transparent;
  height: 0; /* Fuerza el scroll cuando el contenido excede el espacio */
}

.message {
  max-width: 70%;
  margin-bottom: 16px;
  padding: 14px 18px;
  border-radius: 20px;
  opacity: 0;
  transform: translateY(20px);
  animation: messageAppear 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  position: relative;
}

@keyframes messageAppear {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.user-message {
  background: white;
  color: #1a1a1a;
  align-self: flex-end;
  margin-right: 12px;
  box-shadow: 0 2px 6px rgba(255, 0, 0, 0.08);
}

.user-message::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: -8px;
  width: 20px;
  height: 20px;
  background: linear-gradient(45deg, white 50%, transparent 50%);
  transform: translateY(-50%) rotate(-45deg);
}

.bot-message {
  background: #f8f9fa;
  color: #1a1a1a;
  align-self: flex-start;
  margin-left: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.bot-message::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -8px;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #f8f9fa 50%, transparent 50%);
  transform: translateY(-50%) rotate(45deg);
}

.user-message .message-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.bot-message .message-text strong {
  color: var(--text-secondary);
  font-weight: 600;
}

/* Contenedor del mensaje y controles */
.message-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.message-text {
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-wrap;
  letter-spacing: 0.2px;
  flex: 1;
}

/* Botón TTS */
.tts-button {
  background: transparent;
  border: none;
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-secondary);
  opacity: 0.7;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tts-button:hover {
  background: rgba(128, 128, 128, 0.1);
  transform: scale(1.1);
  opacity: 1;
}

.tts-button.playing {
  color: var(--text-primary);
  background: rgba(255, 0, 0, 0.1);
  animation: pulse 1.5s infinite;
  opacity: 1;
}

.tts-button.loading svg {
  animation: spin 1s linear infinite;
}

.tts-button.loading .spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.tts-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

@media (max-width: 480px) {
  .message-content {
    gap: 8px;
  }
  
  .tts-button {
    width: 32px;
    height: 32px;
  }
  
  .tts-button svg {
    width: 18px;
    height: 18px;
  }
}

.message-text ul {
  list-style: none;
  padding-left: 0;
  margin: 8px 0;
}

.message-text ul li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 6px;
}

.message-text ul li::before {
  content: '•';
  position: absolute;
  left: 4px;
  top: -1px;
  font-size: 15px;
  opacity: 0.5;
  color: currentColor;
}

.message-text ul ul {
  padding-left: 12px;
  margin: 4px 0;
}

.message-text ul ul li::before {
  content: '○';
  font-size: 12px;
  top: 1px;
  left: 2px;
}

.bot-message .message-text strong {
  color: var(--text-primary);
}

.bot-message .message-text em {
  color: var(--text-secondary);
}

.file-message {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 12px;
  max-width: 300px;
}

.file-preview {
  position: relative;
  width: 100%;
  height: auto;
  max-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #fff;
  object-fit: contain;
  border-radius: 12px;
  margin-top: 8px;
  transition: transform 0.3s ease, border-color 0.3s ease;
  box-shadow: 0 2px 10px var(--shadow-color);
  border: 2px solid transparent;
}

.file-preview:hover {
  transform: scale(1.02);
}

.file-preview.success {
  border-color: #4caf50;
}

#chat-input {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 -4px 30px var(--shadow-color);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

#chat-input.drag-over {
  background: var(--glass-bg);
  border: 2px dashed var(--text-primary);
  padding: 18px;
  animation: pulse-border 1.5s infinite;
}

@keyframes pulse-border {
  0% { border-color: rgba(204, 0, 0, 0.4); }
  50% { border-color: rgba(204, 0, 0, 0.8); }
  100% { border-color: rgba(204, 0, 0, 0.4); }
}

/* Full page drop overlay */
.drop-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.drop-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.drop-overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  transform: scale(0.8) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.drop-overlay.active .drop-overlay-content {
  transform: scale(1) translateY(0);
}

.drop-overlay-icon {
  width: 120px;
  height: 120px;
  border: 3px dashed var(--accent-primary);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: drop-pulse 2s ease-in-out infinite;
}

.drop-overlay-icon svg {
  width: 60px;
  height: 60px;
  fill: var(--accent-primary);
  animation: drop-bounce 1s ease-in-out infinite;
}

.drop-overlay-text {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

.drop-overlay-hint {
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-align: center;
}

@keyframes drop-pulse {
  0%, 100% {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 0 rgba(204, 0, 0, 0.4);
  }
  50% {
    border-color: var(--accent-secondary);
    box-shadow: 0 0 30px 10px rgba(204, 0, 0, 0.2);
  }
}

@keyframes drop-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--input-bg);
  border-radius: 24px;
  padding: 8px;
  box-shadow: 0 2px 10px var(--shadow-color);
}

#user-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 12px;
  font-size: 16px;
  resize: none;
  min-height: 24px;
  max-height: 150px;
  line-height: 1.5;
  font-family: 'Inter', sans-serif;
}

#user-input:focus {
  outline: none;
}

#user-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

.action-button {
  background: transparent;
  border: none;
  padding: 10px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-primary);
  opacity: 0.7;
}

.action-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

#user-input:disabled {
  background: rgba(0, 0, 0, 0.05);
  cursor: not-allowed;
}

#mic-button,
#upload-button {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#mic-button {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#mic-button.listening {
    animation: pulse 1.5s infinite;
    color: #ffffff;
    background-color: #ff4444;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

#mic-button.listening::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,68,68,0) 70%);
    animation: ripple 1.5s infinite;
}

@keyframes ripple {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 20px rgba(255, 68, 68, 0.7);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
    }
}

#mic-button:hover,
#upload-button:hover {
  background: rgba(255, 0, 0, 0.05);
  transform: scale(1.1);
  opacity: 1;
}

#mic-button.recording {
  background: rgba(255, 0, 0, 0.1);
  color: var(--text-primary);
  animation: pulse 1.5s infinite;
  opacity: 1;
}

#send-button {
    background: transparent;
    color: var(--text-primary);
    border: none;
    border-radius: 50%;
    width: 46px;
    height: 46px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#send-button svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  transform: translateX(-1px);
  transition: transform 0.3s ease;
  opacity: 0.8;
}

#send-button:hover {
  transform: scale(1.1);
  background: rgba(255, 0, 0, 0.1);
}

#send-button:hover svg {
  transform: translateX(2px);
  opacity: 1;
}

#send-button:active {
  transform: scale(0.95);
}

#reset-button {
  background: var(--message-bot-bg);
  color: var(--text-secondary);
  border: 1px solid rgba(128, 128, 128, 0.1);
  border-radius: 20px;
  padding: 8px 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

#reset-button:hover {
  transform: translateY(-2px);
  background: rgba(128, 128, 128, 0.15);
}

.typing-indicator {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  width: fit-content;
  margin: 8px 0;
  border: 1px solid rgba(128, 128, 128, 0.1);
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--text-secondary);
  border-radius: 50%;
  display: inline-block;
  animation: bounce 1.4s infinite ease-in-out both;
  opacity: 0.5;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.attachment-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
}

.attachment-preview {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px var(--shadow-color);
  transition: transform 0.3s ease;
}

.attachment-preview:hover {
  transform: scale(1.05);
}

.attachment-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Estilos para la previsualización de archivos */
.file-preview-container {
  position: relative;
  margin: 4px;
  padding: 4px;
  background: #f5f5f5;
  border-radius: 6px;
  max-width: 80px;
}

.delete-file-button {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  background: #ff4444;
  border: none;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  z-index: 1;
  padding: 0;
}

.delete-file-button:hover {
  background: #ff0000;
  transform: scale(1.1);
}

.delete-file-button:active {
  transform: scale(0.9);
}

.delete-file-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.file-preview img,
.file-preview video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.file-preview .file-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-preview .file-icon svg {
  width: 100%;
  height: 100%;
  fill: #666;
}

.file-name {
  display: none;
}

/* Barra de progreso y estado de procesamiento */
.upload-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #cc0000, #ff4444);
  transition: width 0.2s ease;
}

.progress-bar.converting {
  background: linear-gradient(90deg, #ff9800, #ffc107);
  animation: pulse-convert 1.5s ease-in-out infinite;
}

@keyframes pulse-convert {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.progress-text {
  position: absolute;
  bottom: 6px;
  right: 6px;
  font-size: 10px;
  font-weight: bold;
  color: #cc0000;
  background: rgba(255, 255, 255, 0.9);
  padding: 2px 6px;
  border-radius: 10px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Estado de conversión en silueta */
.file-status {
  font-size: 11px;
  font-weight: 600;
  color: #ff9800;
  text-align: center;
  padding: 4px 8px;
  background: rgba(255, 152, 0, 0.15);
  border-radius: 4px;
  margin-top: 4px;
  min-height: 20px;
}

.file-status:empty {
  display: none;
}

.file-status.converting {
  animation: pulse-convert 1.5s ease-in-out infinite;
}

.file-status.error {
  color: #f44336;
  background: rgba(244, 67, 54, 0.15);
  animation: none;
}

#send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  background: var(--message-bot-bg);
}

#send-button:disabled:hover {
  transform: none;
  background: var(--message-bot-bg);
}

/* Estado de error */
.upload-error {
  border: 1px solid #f44336;
}

.error-message {
  color: #f44336;
  font-size: 12px;
  margin-top: 4px;
  text-align: center;
}

/* Estilos para los mensajes de archivo en el chat */
.message .file-message {
  background: var(--glass-bg);
  border-radius: 12px;
  padding: 12px;
  margin: 8px 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  max-width: 300px;
}

.message .file-message .file-preview-image,
.message .file-message .file-preview-video {
  width: 100%;
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 8px;
  display: block;
}

.message .file-message .file-preview-video {
  background: #000;
}

.message .file-message .file-icon {
  width: 48px;
  height: 48px;
  margin: 8px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  padding: 8px;
}

.message .file-message .file-icon svg {
  width: 32px;
  height: 32px;
  fill: var(--text-secondary);
}

.message .file-message .file-name {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 8px;
  word-break: break-word;
}

/* Contenedor de adjuntos */
#attachment-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  max-height: 200px;
  overflow-y: auto;
  background: #f5f5f5;
  border-radius: 8px;
}

#attachment-container:empty {
  display: none;
}

/* Contenedor de siluetas */
.silhouettes-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Contador de archivos */
.file-counter {
  width: 100%;
  text-align: center;
  padding: 8px;
  color: #666;
  font-size: 14px;
  margin-bottom: 8px;
}

.file-counter.complete {
  color: #4CAF50;
  font-weight: 500;
}

/* Siluetas de archivos */
.file-preview-container.silhouette {
  opacity: 0.5;
  background: #f0f0f0;
  transition: all 0.3s ease;
}

.file-preview-container.silhouette.completed {
  opacity: 0;
  transform: scale(0.9);
}

.file-icon-silhouette {
  width: 48px;
  height: 48px;
  background: #ddd;
  border-radius: 4px;
  position: relative;
}

.image-silhouette::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  background: #bbb;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z'/%3E%3C/svg%3E") no-repeat center;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z'/%3E%3C/svg%3E") no-repeat center;
}

.video-silhouette::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  background: #bbb;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4z'/%3E%3C/svg%3E") no-repeat center;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4z'/%3E%3C/svg%3E") no-repeat center;
}

.file-silhouette::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  background: #bbb;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z'/%3E%3C/svg%3E") no-repeat center;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z'/%3E%3C/svg%3E") no-repeat center;
}

/* Spinner de carga para siluetas */
.silhouette-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.silhouette-spinner .spinner-svg {
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}

.silhouette-spinner .spinner-path {
  animation: spin-path 1s linear infinite;
  transform-origin: center;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spin-path {
  0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
  50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
  100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

/* Mejorar la previsualización en el chat */
.message .file-preview {
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
  background: #f5f5f5;
  max-width: 300px;
}

.message .file-preview img,
.message .file-preview video {
  width: 100%;
  height: auto;
  display: block;
}

.message .file-name {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}

@media (max-width: 768px) {
  .message {
    max-width: 90%;
  }

  #chat-header {
    padding: 12px 16px;
  }

  #chat-header img {
    height: 35px;
  }

  .input-row {
    padding: 4px;
  }

  #user-input {
    padding: 10px 12px;
    font-size: 15px;
  }

  #send-button {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .message {
    max-width: 95%;
  }

  #reset-button span {
    display: none;
  }

  .attachment-preview {
    width: 80px;
    height: 80px;
  }
}

/* Agregar al final de style.css: Fijar la app y evitar el scroll global */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

#pro-button {
  background: var(--message-bot-bg);
  color: var(--text-secondary);
  border: 1px solid rgba(128, 128, 128, 0.1);
  border-radius: 20px;
  padding: 8px 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  position: relative;
}

/* Estilos modernos para el tooltip del botón Pro */
#pro-button::before {
  content: attr(data-tooltip-title);
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%) translateY(100%) scale(0.8);
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  z-index: 1000;
  font-weight: 400;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#pro-button::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%) translateY(100%) scale(0.8);
  border: 6px solid transparent;
  border-bottom-color: rgba(0, 0, 0, 0.85);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  z-index: 1000;
}

#pro-button:hover::before,
#pro-button:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(100%) scale(1);
}

#pro-button.active {
  background: var(--primary-gradient);
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(255, 0, 0, 0.2);
}

#pro-button:hover {
  transform: translateY(-2px);
  background: rgba(128, 128, 128, 0.15);
}

#pro-button.active:hover {
  background: var(--primary-gradient);
  opacity: 0.9;
}

#api-key-button {
  background: var(--message-bot-bg);
  color: var(--text-secondary);
  border: 1px solid rgba(128, 128, 128, 0.1);
  border-radius: 20px;
  padding: 8px 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

#api-key-button:hover {
  transform: translateY(-2px);
  background: rgba(128, 128, 128, 0.15);
  color: var(--text-primary);
}

#api-key-button svg {
  transform: scale(0.9);
}

#api-key-button:hover svg {
  transform: scale(1) rotate(15deg);
}

@media (max-width: 480px) {
  #api-key-button span {
    display: none;
  }
  
  #api-key-button {
    padding: 8px;
  }
  
  #pro-button span {
    display: none;
  }
  
  #pro-button {
    padding: 8px;
  }
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(5px);
  transition: opacity 0.3s ease-out;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--text-secondary);
  border-radius: 50%;
  border-top-color: var(--text-primary);
  animation: spin 1s linear infinite;
  box-shadow: 0 4px 15px var(--shadow-color);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}



/* ------------------ Nuevos estilos para el Historial de Chats ------------------ */
#chat-app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

#chat-history {
  width: 320px;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  /* Colapsado por defecto */
  position: fixed;
  left: -320px;
  top: 0;
  height: 100vh;
  z-index: 99999;
  transition: left 0.3s ease;
}

#chat-history.open {
  left: 0;
}

.history-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 99998;
  pointer-events: none;
}

.history-overlay.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#chat-history h2 {
  margin: 0;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.6);
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.history-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-actions button {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.2s;
}

.history-actions button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.history-actions #pro-button.active {
  color: #ffd700;
  background: rgba(255, 215, 0, 0.15);
}

.close-history {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.close-history:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

.close-history svg {
  width: 20px;
  height: 20px;
}

#chat-history-list {
  list-style: none;
  padding: 12px;
  margin: 0;
  flex: 1;
}

#chat-history-list li {
  position: relative;
  padding: 14px 16px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  overflow: hidden;
}

#chat-history-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--text-primary);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

#chat-history-list li:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateX(4px);
}

#chat-history-list li:hover::before {
  transform: scaleY(1);
}

#chat-history-list li.active-chat {
  background: linear-gradient(135deg, rgba(204, 0, 0, 0.2), rgba(204, 0, 0, 0.1));
  border-color: var(--text-primary);
  box-shadow: 0 4px 15px rgba(204, 0, 0, 0.3);
}

#chat-history-list li.active-chat::before {
  transform: scaleY(1);
}

#chat-history-list li .chat-title {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

#chat-history-list li .delete-chat {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
  padding: 0;
}

#chat-history-list li .delete-chat svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

#chat-history-list li .delete-chat:hover {
  background: rgba(244, 67, 54, 0.2);
  color: #f44336;
  transform: scale(1.1);
}

#chat-history-list li.active-chat .delete-chat {
  color: rgba(255, 255, 255, 0.7);
}

#chat-history-list li.active-chat .delete-chat:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Contenedor de acciones de chat */
#chat-history-list li .chat-actions {
  flex-shrink: 0;
  display: flex;
  gap: 4px;
  align-items: center;
}

/* Botón editar título */
#chat-history-list li .edit-chat {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
  padding: 0;
}

#chat-history-list li .edit-chat svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

#chat-history-list li .edit-chat:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
  transform: scale(1.1);
}

#chat-history-list li.active-chat .edit-chat {
  color: rgba(255, 255, 255, 0.7);
}

#chat-history-list li.active-chat .edit-chat:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Botón pin/despin */
#chat-history-list li .pin-chat {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#chat-history-list li .pin-chat svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

#chat-history-list li .pin-chat:hover {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  transform: scale(1.1);
}

#chat-history-list li.active-chat .pin-chat {
  color: rgba(255, 255, 255, 0.7);
}

#chat-history-list li.active-chat .pin-chat:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Estado fijado */
#chat-history-list li.pinned {
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid #f59e0b;
}

#chat-history-list li.pinned .pin-chat {
  color: #f59e0b;
}

#chat-history-list li.pinned.active-chat .pin-chat {
  color: #fbbf24;
}

/* Scrollbar personalizado para el historial */
#chat-history::-webkit-scrollbar {
  width: 6px;
}

#chat-history::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

#chat-history::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

#chat-history::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Pull to refresh indicator para historial */
#history-refresh-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  height: 0;
  overflow: hidden;
}

#history-refresh-indicator svg {
  transition: transform 0.3s ease;
}

#history-refresh-indicator.ready {
  color: var(--text-primary);
}

#history-refresh-indicator.refreshing {
  opacity: 1 !important;
  color: var(--text-primary);
}

#history-refresh-indicator.refreshing svg {
  animation: spin 1s linear infinite;
}

/* Aseguramos que el contenedor del chat se ajuste al resto del espacio */
#chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Ocultar el botón hamburguesa en pantallas grandes */
#menu-toggle-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: rgba(0, 0, 0, 0.6);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
}

#menu-toggle-button:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #cc0000;
}

#new-chat-button {
  display: flex;
}

/* NUEVO BLOQUE: Responsive para el historial de chats en móviles */
@media (max-width: 768px) {
  /* Ocultar el historial lateral por defecto fuera de la pantalla */
  #chat-history {
    position: fixed;
    top: 0;
    left: -320px; /* Oculto a la izquierda */
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    overflow-y: auto;
    z-index: 1001;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.3);
  }

  /* Mostrar el historial cuando se active la clase "open" */
  #chat-history.open {
    left: 0;
  }

  /* Mostrar el botón de cerrar en móviles */
  .close-history {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Overlay para cerrar el menú al hacer click fuera */
  .history-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: -1;
  }

  #chat-history.open .history-overlay {
    opacity: 1;
    visibility: visible;
  }

  /* Mostrar el botón hamburguesa */
  #menu-toggle-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-right: 8px;
    border-radius: 8px;
    transition: background 0.3s ease;
    color: var(--text-secondary);
  }

  #menu-toggle-button:hover {
    background: rgba(0, 0, 0, 0.05);
  }

  #menu-toggle-button svg {
    stroke: currentColor;
  }

  /* Ajustar el layout de la cabecera para alinear el botón y el logo */
  #chat-header {
    display: flex;
    align-items: center;
  }

  /* Asegurar que el contenedor del chat ocupe el ancho completo */
  #chat-container {
    margin-left: 0;
  }
}

/* ---------- Fuentes de búsqueda - Diseño Moderno IA ---------- */

.sources-container {
  margin-top: 12px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(204, 0, 0, 0.15);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 249, 250, 0.95));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sources-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(204, 0, 0, 0.06), rgba(204, 0, 0, 0.03));
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.sources-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.5s ease;
}

.sources-header:hover::before {
  left: 100%;
}

.sources-header:hover {
  background: linear-gradient(135deg, rgba(204, 0, 0, 0.1), rgba(204, 0, 0, 0.05));
}

.sources-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.sources-icon {
  width: 16px;
  height: 16px;
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    filter: drop-shadow(0 0 3px rgba(204, 0, 0, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 8px rgba(204, 0, 0, 0.8));
  }
}

.sources-count {
  background: var(--primary-gradient);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  animation: count-bounce 0.5s ease-out;
}

@keyframes count-bounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.sources-chevron {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
  color: var(--text-secondary);
}

.sources-container.expanded .sources-chevron {
  transform: rotate(180deg);
}

.sources-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
}

.sources-container.expanded .sources-list {
  max-height: 300px;
  overflow-y: auto;
  padding: 8px 14px 12px;
}

.sources-list::-webkit-scrollbar {
  width: 6px;
}

.sources-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

.sources-list::-webkit-scrollbar-thumb {
  background: rgba(204, 0, 0, 0.3);
  border-radius: 3px;
}

.sources-list::-webkit-scrollbar-thumb:hover {
  background: rgba(204, 0, 0, 0.5);
}

.source-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  transition: all 0.2s ease;
  margin-bottom: 4px;
  animation: source-fade-in 0.3s ease forwards;
  opacity: 0;
}

@keyframes source-fade-in {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.source-item:nth-child(1) { animation-delay: 0.05s; }
.source-item:nth-child(2) { animation-delay: 0.1s; }
.source-item:nth-child(3) { animation-delay: 0.15s; }
.source-item:nth-child(4) { animation-delay: 0.2s; }
.source-item:nth-child(5) { animation-delay: 0.25s; }

.source-item:hover {
  background: rgba(204, 0, 0, 0.06);
  transform: translateX(3px);
}

.source-item a {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #374151;
  font-size: 13px;
  flex: 1;
  line-height: 1.4;
}

.source-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--text-primary);
}

.source-domain {
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-all;
}

/* Efecto de shimmer para indicar actividad IA */
.thinking-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: linear-gradient(135deg, rgba(204, 0, 0, 0.1), rgba(204, 0, 0, 0.05));
  border-radius: 12px;
  font-size: 11px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.thinking-dots {
  display: flex;
  gap: 3px;
}

.thinking-dots span {
  width: 4px;
  height: 4px;
  background: var(--text-primary);
  border-radius: 50%;
  animation: thinking-bounce 1.4s ease-in-out infinite;
}

.thinking-dots span:nth-child(1) { animation-delay: 0s; }
.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinking-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-6px);
  }
}


/* Icono grande para archivos sin preview (HEIC, etc) */
.file-icon-large {
  width: 120px;
  height: 120px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(204, 0, 0, 0.05), rgba(204, 0, 0, 0.1));
  border-radius: 12px;
  color: var(--text-primary);
}

.file-icon-large svg {
  width: 64px;
  height: 64px;
}

/* ============ LOGIN SCREEN ============ */

.login-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-screen.hidden {
  display: none;
}

.login-container {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 48px 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  text-align: center;
  max-width: 380px;
  width: 90%;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.login-logo {
  width: 80px;
  height: 80px;
  margin-bottom: 16px;
  border-radius: 20px;
}

.login-container h1 {
  margin: 0 0 32px;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#login-form input {
  padding: 14px 18px;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.9);
  transition: border-color 0.2s, box-shadow 0.2s;
}

#login-form input:focus {
  outline: none;
  border-color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.1);
}

#login-form input::placeholder {
  color: #9ca3af;
}

#login-button {
  padding: 14px 24px;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-top: 8px;
}

#login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(204, 0, 0, 0.3);
}

#login-button:active {
  transform: translateY(0);
}

#login-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.login-error {
  color: #dc2626;
  font-size: 0.875rem;
  margin: 8px 0 0;
  min-height: 20px;
}

/* ============ FIN LOGIN SCREEN ============ */

/* ============ MEMORY PANEL ============ */

#memory-button {
  background: var(--message-bot-bg);
  color: var(--text-secondary);
  border: 1px solid rgba(128, 128, 128, 0.1);
  border-radius: 20px;
  padding: 8px 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

#memory-button:hover {
  transform: translateY(-2px);
  background: rgba(128, 128, 128, 0.15);
  color: var(--text-primary);
}

#memory-button svg {
  transform: scale(0.9);
}

#memory-button:hover svg {
  transform: scale(1);
}

@media (max-width: 480px) {
  #memory-button span {
    display: none;
  }

  #memory-button {
    padding: 8px;
  }

  #logout-button span {
    display: none;
  }

  #logout-button {
    padding: 8px;
  }
}

#logout-button {
  background: var(--message-bot-bg);
  color: var(--text-secondary);
  border: 1px solid rgba(128, 128, 128, 0.1);
  border-radius: 20px;
  padding: 8px 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

#logout-button:hover {
  transform: translateY(-2px);
  background: rgba(244, 67, 54, 0.1);
  color: #f44336;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.memory-panel {
  background: white;
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.memory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.memory-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.memory-header .close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.memory-header .close-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

.memory-info {
  padding: 12px 24px;
  background: rgba(204, 0, 0, 0.04);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.memory-info p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.optimize-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.optimize-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.optimize-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.optimize-btn.loading {
  pointer-events: none;
}

.optimize-btn.loading svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.memory-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: #f8f9fa;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.memory-search svg {
  color: #9ca3af;
  flex-shrink: 0;
}

.memory-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  color: #374151;
}

.memory-search input::placeholder {
  color: #9ca3af;
}

.search-clear-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #9ca3af;
  border-radius: 4px;
  transition: all 0.15s;
}

.search-clear-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #6b7280;
}

.memory-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 150px;
  max-height: 400px;
}

.memory-empty {
  color: var(--text-secondary);
  font-size: 14px;
  text-align: center;
  padding: 40px 0;
  width: 100%;
}

.memory-item {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 12px;
  padding: 14px 16px;
  background: #f8f9fa;
  border-radius: 12px;
  transition: all 0.2s ease;
  animation: memoryAppear 0.3s ease;
}

@keyframes memoryAppear {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.memory-item:hover {
  background: #f1f3f5;
}

.memory-item.highlight {
  background: linear-gradient(135deg, rgba(204, 0, 0, 0.08), rgba(204, 0, 0, 0.04));
  border: 1px solid rgba(204, 0, 0, 0.2);
  animation: highlightPulse 2s ease-out;
}

@keyframes highlightPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(204, 0, 0, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(204, 0, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(204, 0, 0, 0);
  }
}

.memory-content {
  flex: 1;
  font-size: 14px;
  color: #374151;
  line-height: 1.5;
  word-break: break-word;
}

.memory-content input {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid var(--text-primary);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}

.memory-content input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.1);
}

.memory-dates {
  width: 100%;
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: #9ca3af;
  margin-top: 2px;
}

.memory-dates span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.memory-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.memory-actions .nav-btn {
  padding: 6px;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.15s;
}

.memory-actions .nav-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.08);
  color: #374151;
}

.memory-actions .nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.memory-actions .history-btn {
  padding: 5px;
  background: transparent;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.15s;
}

.memory-actions .history-btn:hover:not(:disabled) {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #374151;
}

.memory-actions .history-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.memory-actions .undo-btn {
  color: #f59e0b;
}

.memory-actions .undo-btn:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.1);
  border-color: #f59e0b;
}

.memory-actions .redo-btn {
  color: #10b981;
}

.memory-actions .redo-btn:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.1);
  border-color: #10b981;
}

.memory-actions .view-history-btn {
  color: #8b5cf6;
}

.memory-actions .view-history-btn:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: #8b5cf6;
}

/* Modal de historial de versiones */
.memory-history-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999999;
  animation: fadeIn 0.2s ease;
}

.memory-history-content {
  background: white;
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.memory-history-content .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.memory-history-content .modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #374151;
}

.memory-history-content .close-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #9ca3af;
  padding: 4px 8px;
  border-radius: 6px;
}

.memory-history-content .close-btn:hover {
  background: #f3f4f6;
  color: #374151;
}

.memory-history-current {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 12px;
  margin: 16px 20px;
}

.memory-history-current strong {
  color: #16a34a;
  font-size: 0.8rem;
  display: block;
  margin-bottom: 6px;
}

.memory-history-current p {
  margin: 0;
  font-size: 0.9rem;
  color: #374151;
}

.memory-history-list {
  padding: 0 20px 20px;
}

.memory-history-list strong {
  color: #6b7280;
  font-size: 0.8rem;
  display: block;
  margin-bottom: 10px;
}

.history-version-item {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.history-version-content {
  font-size: 0.85rem;
  color: #4b5563;
  margin-bottom: 6px;
  word-break: break-word;
}

.history-version-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-version-date {
  font-size: 0.7rem;
  color: #9ca3af;
}

.history-version-delete {
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #9ca3af;
  border-radius: 4px;
  transition: all 0.15s;
}

.history-version-delete:hover {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.no-history {
  color: #9ca3af;
  font-style: italic;
  font-size: 0.85rem;
}

.memory-actions button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.memory-actions button:hover {
  background: rgba(0, 0, 0, 0.06);
}

.memory-actions .edit-btn:hover {
  color: #2563eb;
}

.memory-actions .delete-btn:hover {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
}

.memory-actions .save-btn {
  color: #16a34a;
}

.memory-actions .save-btn:hover {
  background: rgba(22, 163, 74, 0.1);
}

.memory-actions .cancel-btn:hover {
  color: #dc2626;
}

.memory-add {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: #fafafa;
  border-radius: 0 0 20px 20px;
}

.memory-add input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.memory-add input:focus {
  outline: none;
  border-color: var(--text-primary);
}

.memory-add input::placeholder {
  color: #9ca3af;
}

#add-memory-btn {
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#add-memory-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(204, 0, 0, 0.3);
}

#add-memory-btn:active {
  transform: scale(0.98);
}

/* Scrollbar para la lista de memorias */
.memory-list::-webkit-scrollbar {
  width: 6px;
}

.memory-list::-webkit-scrollbar-track {
  background: transparent;
}

.memory-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}

.memory-list::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* ============ FIN MEMORY PANEL ============ */

/* ============ USERS PANEL ============ */

.users-panel {
  background: white;
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.3s ease;
}

.users-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.users-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.users-header .close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.users-header .close-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

.users-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.users-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f9fafb;
  border-radius: 10px;
  margin-bottom: 8px;
  transition: background 0.2s ease;
}

.user-item:hover {
  background: #f3f4f6;
}

.user-item.admin {
  background: rgba(204, 0, 0, 0.06);
  border-left: 3px solid #cc0000;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
}

.user-name {
  font-weight: 500;
  color: var(--text-primary);
}

.user-admin-badge {
  font-size: 0.7rem;
  background: #cc0000;
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
}

.user-actions {
  display: flex;
  gap: 4px;
}

.user-action-btn {
  background: transparent;
  border: none;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.user-action-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.user-action-btn.edit:hover {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.user-action-btn.delete:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.users-add {
  display: flex;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: #f9fafb;
  border-radius: 0 0 20px 20px;
}

.users-add input[type="text"],
.users-add input[type="password"] {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.users-add input[type="text"]:focus,
.users-add input[type="password"]:focus {
  border-color: #667eea;
}

.users-add input[type="text"] {
  flex: 1.5;
}

#add-user-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

#add-user-btn:hover {
  transform: scale(1.05);
}

/* User Edit Modal */
.user-edit-panel {
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  animation: slideUp 0.3s ease;
}

.user-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.user-edit-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #374151;
}

.user-edit-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.user-edit-username {
  font-size: 1.2rem;
  font-weight: 600;
  color: #374151;
  text-align: center;
  padding: 12px;
  background: #f3f4f6;
  border-radius: 8px;
}

.user-edit-body input[type="password"] {
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
}

.user-edit-body input[type="password"]:focus {
  border-color: #667eea;
}

.save-btn {
  padding: 12px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.save-btn:hover {
  transform: translateY(-1px);
}

#users-button {
  display: none;
}

#users-button.visible {
  display: flex;
}

/* ============ FIN USERS PANEL ============ */

/* ============ MEMORY TOAST NOTIFICATIONS ============ */

#memory-toast-container {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.memory-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.5);
  pointer-events: auto;
  animation: toastSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  max-width: 400px;
}

.memory-toast.toast-out {
  animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
  }
}

.memory-toast-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.memory-toast-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.5;
}

.memory-toast.toast-add .memory-toast-icon {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.memory-toast.toast-update .memory-toast-icon {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
}

.memory-toast.toast-delete .memory-toast-icon {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.memory-toast-content {
  flex: 1;
  min-width: 0;
  cursor: pointer;
  padding: 4px 8px;
  margin: -4px -8px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.memory-toast-content:hover {
  background: rgba(0, 0, 0, 0.05);
}

.memory-toast-title {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 2px;
}

.memory-toast-message {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.memory-toast-close {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  color: #9ca3af;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.memory-toast-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #6b7280;
}

.memory-toast-close svg {
  width: 16px;
  height: 16px;
}

/* Progress bar en el toast */
.memory-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--text-primary), #ff6b6b);
  border-radius: 0 0 16px 16px;
  animation: toastProgress 3s linear forwards;
}

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

@media (max-width: 480px) {
  #memory-toast-container {
    left: 16px;
    right: 16px;
    transform: none;
    bottom: 80px;
  }

  .memory-toast {
    max-width: 100%;
  }

  .memory-toast-message {
    max-width: 180px;
  }
}

/* ============ FIN MEMORY TOAST ============ */

/* ============ CONFIRM MODAL ============ */

.confirm-panel {
  background: white;
  border-radius: 24px;
  padding: 32px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: confirmAppear 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes confirmAppear {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.confirm-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d97706;
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(217, 119, 6, 0);
  }
}

.confirm-panel h3 {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
}

.confirm-panel p {
  margin: 0 0 28px;
  font-size: 0.95rem;
  color: #6b7280;
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.confirm-btn {
  padding: 12px 28px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  min-width: 120px;
}

.confirm-btn.cancel {
  background: #f3f4f6;
  color: #4b5563;
}

.confirm-btn.cancel:hover {
  background: #e5e7eb;
  transform: translateY(-2px);
}

.confirm-btn.danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.confirm-btn.danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.confirm-btn:active {
  transform: translateY(0);
}

/* ============ FIN CONFIRM MODAL ============ */

