/* ==========================================================================
   TALENTUM HR - Portal de Búsquedas, Postulaciones y Gestión de Talento
   styles.css (Archivo de estilos modular, limpio y responsive)
   ========================================================================== */

:root {
  --primary: #1e3a8a;          /* Azul corporativo formal */
  --primary-hover: #1e40af;
  --primary-light: #eff6ff;
  --secondary: #0d9488;        /* Teal moderno para acentos y estados positivos */
  --secondary-hover: #0f766e;
  --accent: #f59e0b;           /* Ámbar para badges y destacados */
  --text-main: #0f172a;        /* Slate oscuro para legibilidad óptima */
  --text-muted: #64748b;       /* Slate intermedio */
  --bg-page: #f8fafc;          /* Fondo suave */
  --bg-surface: #ffffff;       /* Fondo de tarjetas / modales */
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Reset y base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img, svg {
  display: block;
  max-width: 100%;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* Contenedores */
.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* Header & Barra de Navegación */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
}

.brand-logo .brand-icon {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  text-decoration: none;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
  font-size: 0.95rem;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

.btn-nav {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  transition: var(--transition);
}

.btn-nav:hover {
  background: var(--primary-hover);
}

/* Botón menú móvil */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-main);
  cursor: pointer;
  padding: 0.5rem;
}

/* Hero Section */
.hero-section {
  padding: 3.5rem 0 2.5rem;
  background: linear-gradient(180deg, #ffffff 0%, var(--bg-page) 100%);
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--primary-light);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-title span {
  color: var(--secondary);
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 2rem;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 650px;
  margin: 0 auto;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.metric-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

.metric-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Tabs de navegación interactiva */
.section-nav-tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  background: #ffffff;
  position: sticky;
  top: 68px;
  z-index: 90;
}

.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.tab-btn:hover:not(.active) {
  background: #f1f5f9;
  color: var(--text-main);
}

/* Layout General de Secciones */
.app-section {
  padding: 3rem 0;
}

.section-header {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

/* Filtros y Buscador */
.search-filter-bar {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 0.75rem;
  background: var(--bg-surface);
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.input-field, .select-field {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: #fff;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.input-field:focus, .select-field:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: #e2e8f0;
}

/* Grid de Empleos */
.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.job-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.job-role {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.job-company {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--secondary);
}

.badge-tag {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-remote { background: #ecfdf5; color: #047857; }
.badge-hybrid { background: #eff6ff; color: #1d4ed8; }
.badge-presential { background: #fef3c7; color: #b45309; }

.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin: 1rem 0;
  font-size: 0.825rem;
  color: var(--text-muted);
}

.job-meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.job-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.45;
}

.job-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

.job-salary {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Formulario de Postulación Online */
.form-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  max-width: 800px;
  margin: 0 auto;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-label span {
  color: #ef4444;
}

.file-drop-area {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  background-color: #fafbfc;
  transition: var(--transition);
}

.file-drop-area:hover, .file-drop-area.dragover {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.file-preview {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--secondary);
}

/* Panel de Candidatos (Gestor de Selección) */
.candidate-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}

.stat-box h4 {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-box .count {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  margin-top: 0.25rem;
}

.candidates-table-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.candidates-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.candidates-table th {
  background: #f8fafc;
  padding: 0.9rem 1rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.candidates-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.candidates-table tr:last-child td {
  border-bottom: none;
}

.candidate-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: #e2e8f0;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.candidate-name {
  font-weight: 700;
  color: var(--text-main);
}

.candidate-email {
  font-size: 0.775rem;
  color: var(--text-muted);
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.status-revision { background: #fef3c7; color: #92400e; }
.status-entrevista { background: #eff6ff; color: #1e40af; }
.status-finalista { background: #f3e8ff; color: #6b21a8; }
.status-contratado { background: #ecfdf5; color: #065f46; }
.status-descartado { background: #fee2e2; color: #991b1b; }

.action-buttons {
  display: flex;
  gap: 0.4rem;
}

.btn-icon {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-icon:hover {
  background: #f1f5f9;
  color: var(--text-main);
  border-color: #cbd5e1;
}

.btn-icon.delete:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* Notificación Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #1e293b;
  color: #fff;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success { background: #065f46; }
.toast.info { background: #1e3a8a; }

/* Footer */
.footer {
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 3rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ==========================================================================
   RESPONSIVE DESIGN (Mobile First & Breakpoints)
   ========================================================================== */
@media (max-width: 900px) {
  .candidate-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 1.75rem;
  }
  
  .hero-metrics {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: #ffffff;
    flex-direction: column;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
  }

  .nav-links.open {
    display: flex;
  }

  .mobile-toggle {
    display: block;
  }

  .section-nav-tabs {
    overflow-x: auto;
    justify-content: flex-start;
    padding: 0.75rem 1rem;
  }

  .tab-btn {
    white-space: nowrap;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  .search-filter-bar {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-card {
    padding: 1.25rem;
  }

  .candidate-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}
