/* ==========================================================================
   1. VARIABLES Y CONFIGURACIÓN GLOBAL
   ========================================================================== */
:root {
  /* Paleta de Colores Marca jbeeu */
  --primary: #1e6091;
  --primary-hover: #1a4971;
  --primary-light: #e8f1f5;
  --accent: #2a9d8f;
  --accent-light: #e6f4f1;
  
  /* Neutros */
  --bg-main: #f8f9fa;
  --bg-card: #ffffff;
  --text-dark: #1d2d44;
  --text-muted: #6c757d;
  --border-color: #e9ecef;
  --border-hover: #ced4da;
  
  /* Tipografía y Tamaños */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  
  /* Sombras y Transiciones */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1200px;
}

/* Reset Básico */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   2. BOTONES Y COMPONENTES REUTILIZABLES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

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

.btn-secondary {
  background-color: var(--primary-light);
  color: var(--primary);
}

.btn-secondary:hover {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-outline {
  border-color: var(--border-hover);
  background-color: transparent;
  color: var(--text-dark);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: underline;
}

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

/* ==========================================================================
   3. ENCABEZADO (HEADER)
   ========================================================================== */
.header {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo {
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

.logo-dot {
  color: var(--accent);
}

.main-nav ul {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.main-nav a {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  transition: var(--transition);
}

.main-nav a:hover {
  color: var(--primary);
}

/* ==========================================================================
   4. HERO SECTION & BUSCADOR
   ========================================================================== */
.hero-section {
  background: linear-gradient(135deg, #1e6091 0%, #1a4971 100%);
  color: #ffffff;
  padding: 4rem 0 5rem 0;
  text-align: center;
}

.hero-text h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.hero-text p {
  font-size: 1.15rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 2.5rem auto;
}

/* Buscador Flotante */
.search-box {
  background-color: var(--bg-card);
  padding: 0.75rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  gap: 0.75rem;
  max-width: 900px;
  margin: 0 auto;
}

.input-group {
  flex: 1;
  display: flex;
  align-items: center;
  background-color: var(--bg-main);
  border-radius: var(--radius-sm);
  padding: 0 1rem;
  border: 1px solid transparent;
  transition: var(--transition);
}

.input-group:focus-within {
  border-color: var(--primary);
  background-color: #ffffff;
}

.input-group .icon {
  stroke: var(--text-muted);
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.input-group input {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0.85rem 0;
  font-size: 0.95rem;
  color: var(--text-dark);
  outline: none;
}

/* ==========================================================================
   5. LAYOUT PRINCIPAL (FILTROS + RESULTADOS)
   ========================================================================== */
.jobs-section {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  padding-top: 3rem;
  padding-bottom: 4rem;
}

/* Panel Lateral de Filtros */
.filters-sidebar {
  background-color: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  height: fit-content;
}

.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.filters-header h2 {
  font-size: 1.1rem;
}

.filter-group {
  border: none;
  margin-bottom: 1.5rem;
}

.filter-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-dark);
  margin-bottom: 0.75rem;
  display: block;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   6. SECCIÓN DE RESULTADOS Y TARJETAS
   ========================================================================== */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.results-count {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.results-count strong {
  color: var(--text-dark);
}

.sort-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.select-input {
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hover);
  background-color: var(--bg-card);
  color: var(--text-dark);
  font-size: 0.9rem;
  outline: none;
}

/* Grid de Empleos */
.jobs-feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.job-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  transition: var(--transition);
}

.job-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.job-card-logo img {
  border-radius: var(--radius-sm);
  object-fit: cover;
  background-color: var(--bg-main);
}

.job-card-body {
  flex: 1;
}

.job-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.company-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}

.job-tag {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
}

.tag-remote {
  background-color: var(--accent-light);
  color: var(--accent);
}

.job-title {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

.job-title a {
  color: var(--text-dark);
  text-decoration: none;
}

.job-title a:hover {
  color: var(--primary);
}

.job-location {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.job-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge {
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-dark);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}

.job-card-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  height: 100%;
  gap: 1rem;
}

.post-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Paginación */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2.5rem;
}

.page-info {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ==========================================================================
   7. PIE DE PÁGINA (FOOTER)
   ========================================================================== */
.footer {
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0 1.5rem 0;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.footer-brand p {
  color: var(--text-muted);
  max-width: 300px;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 4rem;
}

.link-column h4 {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.link-column ul {
  list-style: none;
}

.link-column a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.4rem;
}

.link-column a:hover {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ==========================================================================
   8. RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 900px) {
  .jobs-section {
    grid-template-columns: 1fr; /* Colapsa filtros arriba en tablet/móvil */
  }

  .search-box {
    flex-direction: column;
  }

  .main-nav {
    display: none; /* Ideal para integrar un menú hamburguesa posteriormente */
  }

  .hero-text h1 {
    font-size: 2rem;
  }
}

@media (max-width: 600px) {
  .job-card {
    flex-direction: column;
  }

  .job-card-action {
    flex-direction: row;
    width: 100%;
    align-items: center;
  }

  .footer-content {
    flex-direction: column;
    gap: 2rem;
  }

  .footer-links {
    gap: 2rem;
  }
}