/* Estilos específicos para a listagem e detalhes de Concursos Públicos */

:root {
  --font-outfit: var(--font-family-base);
  --pe-accent: #2a9d8f;
  --text-main: #1f2937;
  --text-muted: #4b5563;
}

body {
  margin: 0;
  font-family: var(--font-outfit, sans-serif);
  background: radial-gradient(circle at top, #f3f4f6 0%, #e5e7eb 100%) no-repeat fixed;
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

.res-layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* Breadcrumb styling */
.res-breadcrumb {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
  font-weight: 500;
}
.res-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.res-breadcrumb a:hover {
  color: var(--pe-accent);
  text-decoration: underline;
}
.res-breadcrumb span {
  margin: 0 8px;
  color: #9ca3af;
}

/* Banners e Badges */
.pe-banner {
  background: linear-gradient(135deg, #0d1b2a 0%, #1b263b 100%);
  color: white;
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}
.pe-banner-info, .res-banner-info {
  color: #fff;
}
.pe-banner-info *, .res-banner-info * {
  color: #fff;
  max-width: 90%;
}
.pe-banner-info h1 {
  margin: 10px 0;
  font-size: 2rem;
}
.pe-badge-primary {
  background-color: #2a9d8f;
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pe-btn-primary {
  background-color: #e76f51;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.2s;
  display: inline-block;
}
.pe-btn-primary:hover {
  background-color: #f4a261;
}

/* Listagem de Concursos */
.pe-list-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.pe-exam-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  border: 1px solid #eef2f6;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.pe-exam-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.pe-exam-card h2 {
  font-size: 1.25rem;
  color: #2b2d42;
  margin-bottom: 10px;
}
.pe-exam-card .pe-info {
  margin: 6px 0;
  font-size: 0.9rem;
  color: #374151;
  line-height: 1.5;
}
.pe-exam-card .pe-info strong {
  color: #111827;
  font-weight: 600;
}
.pe-card-action {
  margin-top: auto;
  padding-top: 15px;
  text-align: right;
}
.pe-btn-outline {
  display: inline-block;
  padding: 8px 16px;
  border: 2px solid #2a9d8f;
  color: #2a9d8f;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.pe-btn-outline:hover {
  background-color: #2a9d8f;
  color: white;
}

/* Grid de Detalhes */
.pe-detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
}
@media (max-width: 900px) {
  .pe-detail-grid {
    grid-template-columns: 1fr;
  }
}

.pe-section-title {
  font-size: 1.5rem;
  color: #1b263b;
  border-bottom: 2px solid #eef2f6;
  padding-bottom: 10px;
  margin-bottom: 20px;
}

/* Card de Cargos */
.pe-role-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  border-left: 4px solid #2a9d8f;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.pe-role-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 10px;
}
.pe-role-header h3 {
  margin: 0;
  font-size: 1.3rem;
  color: #2b2d42;
}
.pe-salary-badge {
  background-color: #e9ecef;
  color: #495057;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 1rem;
}
.pe-role-details p {
  margin: 5px 0;
  font-size: 0.95rem;
  color: #495057;
}
.pe-role-details strong {
  color: #2b2d42;
}

/* Matérias e Conteúdo */
.pe-subjects {
  margin-top: 15px;
  background: #f8f9fa;
  padding: 15px;
  border-radius: 6px;
}
.pe-subjects h4 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.05rem;
  color: #1b263b;
}
.pe-subject-item {
  margin-bottom: 15px;
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 10px;
}
.pe-subject-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.pe-subject-title {
  font-weight: bold;
  color: #2a9d8f;
  margin-bottom: 5px;
}
.pe-subject-content {
  font-size: 0.9rem;
  color: #6c757d;
  line-height: 1.4;
  white-space: pre-wrap; /* Preserve line breaks from JSONB */
}

/* Sidebar e Timeline */
.pe-side-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin-bottom: 20px;
}
.pe-side-card h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.2rem;
  color: #1b263b;
  border-bottom: 1px solid #eef2f6;
  padding-bottom: 10px;
}
.pe-info-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.pe-info-list li {
  margin-bottom: 10px;
  font-size: 0.95rem;
  color: #495057;
}

.pe-details-list {
  list-style: disc;
  padding-left: 20px;
  margin: 0;
}
.pe-details-list li {
  margin-bottom: 12px;
  font-size: 0.95rem;
  color: #374151;
  line-height: 1.5;
}

.pe-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}
.pe-timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 10px;
  width: 2px;
  background: #eef2f6;
}
.pe-timeline-item {
  position: relative;
  padding-left: 30px;
  margin-bottom: 15px;
}
.pe-timeline-item::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2a9d8f;
  border: 2px solid white;
}
.pe-timeline-date {
  font-weight: bold;
  font-size: 0.85rem;
  color: #2a9d8f;
  display: block;
  margin-bottom: 2px;
}
.pe-timeline-event {
  font-size: 0.95rem;
  color: #2b2d42;
  font-weight: 600;
}
.pe-timeline-desc {
  font-size: 0.85rem;
  color: #6c757d;
  margin-top: 2px;
}

.pe-loading-text {
  text-align: center;
  color: #6c757d;
  font-style: italic;
  padding: 20px;
}

/* Active Timeline State */
.pe-timeline-active {
  background-color: rgba(37, 99, 235, 0.05);
  border-radius: 8px;
  padding: 12px 12px 12px 30px;
}
.pe-timeline-active .pe-timeline-event {
  font-weight: 700;
  color: var(--primary-color);
}
.pe-timeline-active::before {
  background: #39ff14 !important;
  border-color: #39ff14 !important;
  box-shadow: 0 0 8px #39ff14;
  transition: all 0.3s ease;
  z-index: 2;
}

/* Fix popup close button in MapLibre */
.maplibregl-popup-close-button {
  font-size: 20px !important;
  color: #1e293b !important;
  padding: 5px 10px !important;
  right: 0 !important;
  top: 0 !important;
  background-color: transparent !important;
  border: none !important;
  outline: none !important;
  max-width: 35px;
  max-height: 35px;
}
.maplibregl-popup-close-button:hover {
  background-color: rgba(0,0,0,0.05) !important;
  color: #ef4444 !important;
}

.pe-truncate {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
