/* ========== VARIABLES CSS ========== */
:root {
  --job-agent-primary-color: #3b82f6;
  --job-agent-primary-dark: #1d4ed8;
  --job-agent-secondary-color: #f3f4f6;
  --job-agent-danger-color: #dc2626;
  --job-agent-danger-dark: #b91c1c;
  --job-agent-text-primary: #111827;
  --job-agent-text-secondary: #374151;
  --job-agent-border-color: #e5e7eb;
  --job-agent-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --job-agent-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --job-agent-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.15);
  --job-agent-transition: all 0.3s ease;
  --job-agent-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ========== RESET Y BASE ========== */
html, body {
  overflow-x: hidden;
  max-width: 100%;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* ========== IFRAME PRINCIPAL ========== */
.job-agent-iframe-root {
  /*height: 100vh;
  max-height: 700px;*/
  min-height: 100%;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 0;
  overflow: hidden;
  overflow-x: hidden !important;
  font-family: var(--job-agent-font-family);
  box-sizing: border-box;
}

.job-agent-iframe-container {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: var(--job-agent-iframe-width, 400px);
  height: var(--job-agent-iframe-height, 600px);
  max-height: calc(100dvh - 20%);
  max-height: 100dvh;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--job-agent-shadow-lg);
  z-index: 9998;
  display: none;
  transition: var(--job-agent-transition);
  overflow: hidden;
}

.job-agent-iframe-container.show {
  display: block;
  opacity: 1;
}

.job-agent-iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: inherit;
  background: #fff;
}

/* ========== FAB (FLOATING ACTION BUTTON) ========== */
.job-agent-fab {
  position: fixed;
  bottom: var(--job-agent-fab-bottom, 20px);
  right: var(--job-agent-fab-right, 20px);
  width: var(--job-agent-fab-size, 64px);
  height: var(--job-agent-fab-size, 64px);
  border-radius: 50%;
  background: var(--job-agent-fab-bg, linear-gradient(135deg, #00e1ff 0%, #7b61ff 100%));
  border: none;
  box-shadow: var(--job-agent-shadow-md);
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.2s ease;
  padding: 0;
}

.job-agent-fab:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.job-agent-fab img {
  width: calc(var(--job-agent-fab-size, 64px) * 0.75);
  height: calc(var(--job-agent-fab-size, 64px) * 0.75);
  border-radius: 50%;
}

/* ========== CHAT ========== */
.job-agent-chat {
  height: 100%;
  display: flex;
  flex-direction: column;
  font-family: var(--job-agent-font-family);
  background: var(--job-agent-chat-bg, #ffffff);
}

.job-agent-modal-content{
  background-color: var(--job-agent-chat-bg, #ffffff);
}

.job-agent-header {
  background: var(--job-agent-header-bg, #007bff);
  color: var(--job-agent-header-color, white);
  padding: 16px;
  border-radius: var(--job-agent-header-radius, 0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.job-agent-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--job-agent-messages-bg, #f8f9fa);
  min-height: 200px;
}

.job-agent-footer {
  background: var(--job-agent-footer-bg, #f8f9fa);
  padding: 16px;
  border-radius: var(--job-agent-footer-radius, 0);
  border-top: 1px solid var(--job-agent-border-color);
  flex-shrink: 0;
}

.job-agent-message {
  margin-bottom: 12px;
  display: flex;
}

.job-agent-message.user {
  justify-content: flex-end;
}

.job-agent-message.bot {
  justify-content: flex-start;
}

.job-agent-message-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: var(--job-agent-bubble-radius, 18px);
  word-wrap: break-word;
  font-size: var(--job-agent-font-size, 14px);
}

.job-agent-message.user .job-agent-message-bubble {
  background: var(--job-agent-user-bubble-bg, #007bff);
  color: var(--job-agent-user-bubble-color, white);
}

.job-agent-message.bot .job-agent-message-bubble {
  background: var(--job-agent-bot-bubble-bg, white);
  color: var(--job-agent-bot-bubble-color, #333);
  border: 1px solid var(--job-agent-border-color);
}

.job-agent-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.job-agent-loading img {
  width: 32px;
  height: 32px;
}

.job-agent-embedded .job-agent-header {
  border-radius: 16px 16px 0 0;
}

.job-agent-embedded .job-agent-footer {
  border-radius: 0 0 16px 16px;
}

/* ========== MODALES ========== */
.job-agent-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  overflow-x: hidden;
  box-sizing: border-box;
}

.job-agent-modal {
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  border: 1px solid var(--job-agent-border-color);
  box-sizing: border-box;
  max-width: calc(100vw - 40px);
}

.job-agent-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--job-agent-border-color);
}

.job-agent-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--job-agent-text-primary);
  margin: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.job-agent-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: var(--job-agent-transition);
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.job-agent-modal-close:hover {
  background-color: var(--job-agent-secondary-color);
  color: var(--job-agent-text-secondary);
}

.job-agent-modal-close:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.job-agent-modal-body {
  padding: 20px 24px;
}

.job-agent-modal-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  /*margin-top: 20px;*/
  padding: 20px;
  border-top: 1px solid var(--job-agent-border-color);
  flex-wrap: wrap;
  box-sizing: border-box;
}

/* Modales específicos */
.job-agent-email-validation-modal,
.job-agent-clear-profile-modal {
  max-width: 450px;
  max-width: calc(100vw - 40px);
  width: 90%;
}

/* ========== ALERTAS PERSONALIZADAS ========== */
.job-agent-alert-overlay {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  max-width: 400px;
  width: 90%;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideInFromTop 0.3s ease-out;
  border: 1px solid;
}

.job-agent-alert-success {
  background-color: #ECFDF5;
  color: #065F46;
  border-color: #10B981;
}

.job-agent-alert-error {
  background-color: #FEF2F2;
  color: #991B1B;
  border-color: #EF4444;
}

.job-agent-alert-warning {
  background-color: #FFFBEB;
  color: #92400E;
  border-color: #F59E0B;
}

.job-agent-alert-info {
  background-color: #EFF6FF;
  color: #1E40AF;
  border-color: #3B82F6;
}

.job-agent-alert-icon {
  font-size: 1.25rem;
}

.job-agent-alert-text {
  flex: 1;
}

.job-agent-alert-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  color: inherit;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.job-agent-alert-close:hover {
  opacity: 1;
}

/* ========== MODALES ESPECÍFICOS ADICIONALES ========== */
.job-agent-clear-modal-title {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #DC2626;
  font-size: 1.25rem;
  font-weight: 600;
}

.job-agent-clear-modal-description {
  margin-bottom: 1rem;
  color: #6B7280;
  line-height: 1.5;
}

.job-agent-clear-modal-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #D1D5DB;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.job-agent-clear-modal-input:disabled {
  cursor: not-allowed;
}

/* ========== GRUPOS DE BOTONES ========== */
.job-agent-button-group {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.job-agent-button-cancel {
  background-color: #F3F4F6;
  color: #374151;
}

.job-agent-button-cancel:hover:not(:disabled) {
  background-color: #E5E7EB;
}

/* ========== FORMULARIOS ========== */
.job-agent-validation-message {
  font-size: 16px;
  color: var(--job-agent-text-primary);
  margin-bottom: 16px;
  text-align: center;
  font-weight: 600;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.job-agent-validation-instruction {
  font-size: 15px;
  color: var(--job-agent-text-secondary);
  margin-bottom: 24px;
  text-align: center;
  line-height: 1.5;
  font-weight: 500;
  background-color: #f8fafc;
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 4px solid var(--job-agent-primary-color);
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.job-agent-input-group {
  margin-bottom: 20px;
}

.job-agent-input-field,
.job-agent-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--job-agent-border-color);
  border-radius: 8px;
  font-size: 16px;
  background-color: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
  max-width: 100%;
  color: var(--job-agent-text-primary);
}

.job-agent-input-field:focus,
.job-agent-input:focus {
  outline: none;
  border-color: var(--job-agent-primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.job-agent-input-field:disabled {
  background-color: #f9fafb;
  color: #9ca3af;
  cursor: not-allowed;
}

.job-agent-validation-error {
  margin-top: 8px;
  padding: 8px 12px;
  background-color: #fef2f2;
  color: var(--job-agent-danger-color);
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}

.job-agent-validation-loading {
  margin-top: 8px;
  padding: 8px 12px;
  background-color: #eff6ff;
  color: #2563eb;
  border: 1px solid #dbeafe;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

/* ========== BOTONES ========== */
.job-agent-button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--job-agent-transition);
  min-width: 100px;
  box-sizing: border-box;
  white-space: nowrap;
}

.job-agent-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.job-agent-button-primary {
  background-color: var(--job-agent-primary-color);
  color: white;
}

.job-agent-button-primary:hover:not(:disabled) {
  background-color: var(--job-agent-primary-dark);
  transform: translateY(-1px);
}

.job-agent-button-secondary {
  background-color: var(--job-agent-secondary-color);
  color: var(--job-agent-text-secondary);
  border: 1px solid #d1d5db;
}

.job-agent-button-secondary:hover:not(:disabled) {
  background-color: #e5e7eb;
  transform: translateY(-1px);
}

.job-agent-button-danger {
  background-color: var(--job-agent-danger-color);
  color: white;
}

.job-agent-button-danger:hover:not(:disabled) {
  background-color: var(--job-agent-danger-dark);
  transform: translateY(-1px);
}

.job-agent-button-danger:disabled {
  background-color: #fca5a5;
  color: #7f1d1d;
}

/* ========== JOB CARDS ========== */
.job-agent-job-card {
  background: #ffffff;
  border: 1px solid var(--job-agent-border-color);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--job-agent-shadow-sm);
  transition: var(--job-agent-transition);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.5s ease-out;
}

.job-agent-job-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--job-agent-primary-color), var(--job-agent-primary-dark));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.job-agent-job-card:hover::before {
  transform: scaleX(1);
}

.job-agent-job-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--job-agent-shadow-md);
  border-color: #d1d5db;
}

.job-agent-job-card:nth-child(even) {
  animation-delay: 0.1s;
}

.job-agent-job-card:nth-child(odd) {
  animation-delay: 0.2s;
}

.job-agent-job-info {
  margin-bottom: 16px;
}

.job-agent-job-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--job-agent-text-primary);
  margin: 0 0 12px 0;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 8px;
}

.job-agent-job-title::before {
  font-size: 20px;
  opacity: 0.8;
}

.job-agent-badge-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.job-agent-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--job-agent-secondary-color);
  color: var(--job-agent-text-secondary);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--job-agent-border-color);
  transition: all 0.2s ease;
}

.job-agent-badge:hover {
  background: #e5e7eb;
  transform: scale(1.02);
}

/* Badge variants */
.job-agent-badge.archetype {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.job-agent-badge.location {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.job-agent-badge.department {
  background: #fef3c7;
  color: #d97706;
  border-color: #fde68a;
}

.job-agent-badge.remote {
  background: #f0f9ff;
  color: #0284c7;
  border-color: #bae6fd;
}

.job-agent-badge.hybrid {
  background: #f5f3ff;
  color: #7c3aed;
  border-color: #c4b5fd;
}

.job-agent-badge.presencial {
  background: #fef2f2;
  color: var(--job-agent-danger-color);
  border-color: #fecaca;
}

.job-agent-job-button {
  width: 100%;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--job-agent-primary-color), var(--job-agent-primary-dark));
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--job-agent-transition);
  position: relative;
  overflow: hidden;
}

.job-agent-job-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.job-agent-job-button:hover::before {
  left: 100%;
}

.job-agent-job-button:hover {
  background: linear-gradient(135deg, var(--job-agent-primary-dark), #1e40af);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.job-agent-job-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.job-agent-job-button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
  .job-agent-job-card {
    padding: 16px;
    margin-bottom: 12px;
  }
  
  .job-agent-job-title {
    font-size: 16px;
    margin-bottom: 10px;
  }
  
  .job-agent-badge-container {
    gap: 6px;
  }
  
  .job-agent-badge {
    padding: 4px 8px;
    font-size: 12px;
  }
  
  .job-agent-job-info {
    margin-bottom: 12px;
  }
  
  .job-agent-job-button {
    padding: 10px 16px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  /* Iframe responsive */
  .job-agent-iframe-root {
    width: 100%;
    height: 100vh;
    max-height: none;
    border-radius: 0;
  }
  
  .job-agent-iframe-container {
    width: calc(100vw - 20px);
    height: calc(100vh - 100px);
    right: 10px;
    bottom: 70px;
    border-radius: 12px;
  }
  
  .job-agent-fab {
    right: 16px;
    bottom: 16px;
    width: 56px;
    height: 56px;
  }
  
  .job-agent-fab img {
    width: 42px;
    height: 42px;
  }
  
  .job-agent-header {
    padding: 12px 16px;
  }
  
  .job-agent-messages {
    padding: 12px;
  }
  
  .job-agent-footer {
    padding: 12px 16px;
  }
  
  /* Modal responsive */
  /*.job-agent-modal-footer {
    flex-direction: column;
    gap: 8px;
    padding: 10px;
  }*/
  
  .job-agent-button {
    width: 100%;
    min-width: auto;
  }
  
  .job-agent-email-validation-modal,
  .job-agent-clear-profile-modal {
    width: 95%;
    max-width: calc(100vw - 20px);
  }
  
  .job-agent-modal-overlay {
    padding: 10px;
  }
  
  /* Job cards responsive */
  .job-agent-job-card {
    padding: 14px;
    border-radius: 8px;
  }
  
  .job-agent-job-title {
    font-size: 15px;
  }
  
  .job-agent-badge {
    padding: 3px 6px;
    font-size: 11px;
    border-radius: 12px;
  }
}

@media (max-width: 320px) {
  .job-agent-iframe-container {
    width: calc(100vw - 10px);
    right: 5px;
  }
  
  .job-agent-fab {
    right: 12px;
    bottom: 12px;
    width: 52px;
    height: 52px;
  }
}

/* ========== ANIMACIONES ========== */
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInFromTop {
  from {
    transform: translateX(-50%) translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

/* ========== FORMULARIOS ESPECÍFICOS ========== */
.job-agent-edit-form-group {
  margin-bottom: 1.5rem;
}

.job-agent-form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
}

.job-agent-region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
  max-height: 150px;
  overflow-y: auto;
  padding: 0.5rem;
  border: 1px solid #D1D5DB;
  border-radius: 0.375rem;
}

.job-agent-region-button {
  padding: 0.5rem;
  border-radius: 0.25rem;
  border: 1px solid;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  background-color: white;
  color: #374151;
  border-color: #D1D5DB;
  transition: all 0.2s;
}

.job-agent-region-button.selected {
  background-color: #3B82F6;
  color: white;
  border-color: #3B82F6;
}

.job-agent-region-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.job-agent-file-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #D1D5DB;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.job-agent-file-input:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.job-agent-file-error {
  font-size: 0.75rem;
  color: #DC2626;
  margin-top: 0.25rem;
  margin: 0;
}

.job-agent-processing-indicator {
  padding: 1rem;
  background-color: #EFF6FF;
  border-radius: 0.375rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.job-agent-processing-text {
  color: #1D4ED8;
  font-size: 0.875rem;
  font-weight: 500;
}

/* ========== BOTONES DE PERFIL ========== */
.job-agent-profile-actions {
  margin-top: 0.5rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-direction: row;
}

.job-agent-profile-button {
  max-width: 150px;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s;
}

.job-agent-profile-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.job-agent-edit-button {
  background-color: #3B82F6;
  color: white;
}

.job-agent-edit-button:hover:not(:disabled) {
  background-color: #2563EB;
}

.job-agent-delete-button {
  background-color: #DC2626;
  color: white;
}

.job-agent-delete-button:hover:not(:disabled) {
  background-color: #B91C1C;
}

.message.lightSpeedIn.delay-2s {
  margin-left: 0.5rem;
} 