/**
 * Estilos para el Sistema de Protección de CV
 */

/* Modal */
#cvProtectionModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.cv-modal-content {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 16px;
  padding: 2rem;
  max-width: 450px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: slideUp 0.3s ease-out;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Botón cerrar */
#cvModalClose {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all 0.2s ease;
  color: #fff;
}

#cvModalClose:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

/* Títulos y textos del modal */
.cv-modal-content h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #fff;
  font-weight: 700;
}

.cv-modal-content p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Formulario */
#cvDownloadForm {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#cvEmail {
  padding: 0.875rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  color: #fff;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  font-family: inherit;
}

#cvEmail::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

#cvEmail:focus {
  outline: none;
  border-color: rgba(76, 175, 254, 0.6);
  background: rgba(76, 175, 254, 0.08);
  box-shadow: 0 0 0 3px rgba(76, 175, 254, 0.1);
}

/* Botón de descarga en modal */
#cvDownloadForm button {
  padding: 0.875rem 1.5rem;
  background: linear-gradient(135deg, #4ca5fe 0%, #357abd 100%);
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

#cvDownloadForm button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(76, 175, 254, 0.3);
}

#cvDownloadForm button:active:not(:disabled) {
  transform: translateY(0);
}

#cvDownloadForm button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Mensajes */
#cvErrorMessage,
#cvSuccessMessage {
  display: none;
  padding: 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(-10px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

#cvErrorMessage {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  margin-bottom: 1rem;
}

#cvSuccessMessage {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
}

/* Contenedor de visualización del CV */
.cv-viewer-container {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  margin: 2rem 0;
  min-height: 600px;
}

.cv-viewer-container iframe {
  width: 100%;
  height: 600px;
  border: none;
}

/* Mensaje si el navegador no soporta PDF */
.cv-viewer-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3rem 2rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
}

.cv-viewer-fallback a {
  color: #4ca5fe;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.cv-viewer-fallback a:hover {
  color: #6eb5fe;
}

/* Responsive */
@media (max-width: 640px) {
  .cv-modal-content {
    padding: 1.5rem;
    max-width: calc(100% - 2rem);
  }

  .cv-modal-content h3 {
    font-size: 1.25rem;
  }

  .cv-viewer-container iframe {
    height: 400px;
  }

  #downloadCVBtn {
    width: 100%;
    justify-content: center;
  }
}

/* Estados de carga */
.cv-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.cv-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}
