/* ========================================
   OpenCities - Vereadores Page
   ======================================== */

/* Base Styles */
html,
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  color: #0f172a;
}

/* Cards */
.card {
  background: #ffffff;
  border-radius: 0.9rem;
  border: 1px solid #e2e8f0;
  padding: 1rem 1.1rem;
  box-shadow: 0 4px 12px rgba(15,23,42,0.08);
}

.mayor-card {
  background: #ffffff;
  border-radius: 0.9rem;
  border: 1px solid #e2e8f0;
  padding: 0;
  box-shadow: 0 4px 12px rgba(15,23,42,0.08);
  overflow: hidden;
}

.vereador-card {
  background: #e1f5fe !important;
  border-radius: 0.9rem !important;
  border: 1px solid #e2e8f0 !important;
  padding: 0 !important;
  box-shadow: 0 4px 12px rgba(15,23,42,0.08) !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 520px !important;
  max-height: 520px !important;
  gap: 0 !important;
}

.vereador-card > * {
  flex-shrink: 0;
}

.vereador-widget {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  margin-bottom: 0;
  flex-shrink: 0;
}

.vereador-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
}

.vereador-card .rating-actions {
  margin-top: auto;
  padding: 0 1.25rem 1.25rem;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

@media (max-width: 1024px) {
  .vereador-card {
    min-height: auto !important;
  }

  .vereador-card .rating-actions {
    padding-bottom: 1rem;
  }
}

/* Grid de vereadores - 3 colunas fixas */
.vereadores-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  width: 100%;
}

.vereadores-grid > .vereador-card {
  height: 100% !important;
  min-height: 520px !important;
}

/* Tablet - 2 colunas */
@media (max-width: 768px) and (min-width: 481px) {
  .vereadores-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile - 1 coluna */
@media (max-width: 480px) {
  .vereadores-grid {
    grid-template-columns: 1fr;
  }
}

/* Container */
.vereadores-container {
  max-width: 930px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Vereadores Summary Section */
.vereadores-summary {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* AVISO: Não alterar os estilos dos cards .vereadores-info-card e .vereadores-photo-card
   Estes cards devem manter a barra azul no topo com os títulos em branco.
   Alterações aqui podem quebrar o layout consistente da página de vereadores. */

.vereadores-info-card {
  flex: 1;
  background: #ffffff;
  border-radius: 0.9rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(15,23,42,0.08);
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.vereadores-info-card > .card-header {
  background: #0369a1;
  color: #ffffff;
  padding: 0.5rem 1.25rem;
  margin: 0;
  border-radius: 0.9rem 0.9rem 0 0;
  display: flex;
  align-items: center;
  min-height: 1.5rem;
  box-shadow: none;
  border: none;
}

.vereadores-info-card > .card-header h2 {
  color: #ffffff;
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.vereadores-info-card > .overview-stat {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.info-stats-row {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.info-stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.25rem;
}

.info-stat-item .label {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}

.info-stat-item strong {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.vereadores-photo-card {
  flex: 1;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.9rem;
  box-shadow: 0 4px 12px rgba(15,23,42,0.08);
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.vereadores-photo-card > .card-header {
  background: #0369a1;
  color: #ffffff;
  padding: 0.5rem 1.25rem;
  margin: 0;
  border-radius: 0.9rem 0.9rem 0 0;
  display: flex;
  align-items: center;
  min-height: 1.5rem;
  box-shadow: none;
  border: none;
}

.vereadores-photo-card > .card-header h2 {
  color: #ffffff;
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.vereadores-list-card {
  background: #ffffff !important;
  border-radius: 0.9rem !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 12px rgba(15,23,42,0.08) !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin-top: 2rem !important;
}

.vereadores-list-card > .card-header {
  background: #0369a1 !important;
  color: #ffffff !important;
  padding: 0.5rem 1.25rem !important;
  margin: 0 !important;
  border-radius: 0.9rem 0.9rem 0 0 !important;
  display: flex !important;
  align-items: center !important;
  min-height: 1.5rem !important;
  box-shadow: none !important;
  border: none !important;
}

.vereadores-list-card > .card-header h2 {
  color: #ffffff !important;
  margin: 0 !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.vereadores-list-card > .vereadores-list-subtitle {
  padding: 0.75rem 1rem !important;
  text-align: center !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.vereadores-list-card > .vereadores-list-subtitle p {
  margin: 0 !important;
  font-size: 0.75rem !important;
  color: #64748b !important;
}

.vereadores-list-card > .vereadores-grid {
  padding: 0 !important;
  display: block !important;
}

.vereadores-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  table-layout: fixed;
}

.vereadores-table thead {
  background: #f1f5f9;
}

.vereadores-table thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  border-bottom: 2px solid #e2e8f0;
}

.vereadores-table thead th:nth-child(1) {
  width: 60px;
}

.vereadores-table thead th:nth-child(2) {
  width: auto;
  min-width: 200px;
}

.vereadores-table thead th:nth-child(3) {
  width: 120px;
}

.vereadores-table thead th:nth-child(4) {
  width: 80px;
}

.vereadores-table thead th:nth-child(5) {
  width: 100px;
}

.vereadores-table tbody tr {
  border-bottom: 1px solid #e2e8f0;
}

.vereadores-table tbody tr:hover {
  background: #f8fafc;
}

.vereadores-table tbody td {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: #0f172a;
}

.vereadores-table tbody tr:last-child {
  border-bottom: none;
}

.table-stars {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.vereadores-info-card .overview-stat {
  padding: 1rem;
  text-align: center;
}

.overview-stat {
  text-align: center;
}

.overview-stat .label {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.overview-stat strong {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
}

.score {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.score-stars {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.25rem;
  justify-content: center;
}

.overview-photo {
  width: 100%;
  height: 100%;
  min-height: 200px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

@media (max-width: 768px) {
  .vereadores-summary {
    flex-direction: column;
  }
  
  .overview-photo {
    min-height: 150px;
  }
}

/* Header - estilo do site */
.site-header {
  padding: 0.75rem 1.5rem 0.5rem;
  background: #e2e8f0;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 930px;
  margin: 0 auto;
  width: 100%;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-logo img {
  height: 40px;
  width: auto;
}

.btn-login {
  padding: 0.5rem 1rem;
  background: #229381;
  color: #ffffff;
  text-decoration: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid #229381;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-login:hover {
  background: #1e7a37;
  color: #ffffff;
}

.btn-login.sair {
  background: #b91c1c;
  border: 2px solid #ffffff;
  color: #ffffff;
  padding: 0.3rem 0.8rem;
  box-shadow: 0 0 0 2px #b91c1c;
}

.btn-login.sair:hover {
  background: #991b1b;
  color: #ffffff;
}

/* Header responsivo para mobile */
@media (max-width: 768px) {
  .site-header {
    padding: 0.5rem 1rem;
  }

  .header-inner {
    flex-direction: column;
    gap: 0.75rem;
  }

  .header-left {
    width: 100%;
    justify-content: center;
  }

  .header-right {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
  }

  .btn-login {
    font-size: 0.75rem;
    padding: 0.4rem 0.75rem;
  }
}

@media (max-width: 480px) {
  .header-right {
    gap: 0.35rem;
  }

  .btn-login {
    font-size: 0.7rem;
    padding: 0.35rem 0.6rem;
  }

  .header-logo img {
    height: 32px;
  }
}

/* Vereador Card Header */
.vereador-card-header {
  background: #0369a1;
  padding: 0.5rem 1.25rem 1rem 1.25rem;
  margin: -1.4rem -1.2rem 0 -1.2rem 0.3rem;
  border-radius: 1rem 1rem 0 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  min-height: 1.5rem;
}

.vereador-header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.verified-icon {
  color: #22c55e;
  font-size: 1.2rem;
  font-weight: 700;
}

.warning-icon {
  color: #f59e0b;
  font-size: 1.2rem;
}

.vereador-card-header h3 {
  color: #ffffff;
  margin: 0 0 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin-top: 1rem;
}

/* Vereador Widget */
.vereador-widget {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
}

.vereador-top-row {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  align-items: flex-start;
}

.vereador-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.vereador-party {
  font-size: 0.75rem;
  font-weight: 600;
  color: #0C2948;
}

.vereador-stats {
  display: flex;
  gap: 0.5rem;
}

.vereador-stat-label {
  font-size: 0.7rem;
  color: #4F647C;
  font-weight: 600;
}

.vereador-stat-value {
  font-size: 0.7rem;
  font-weight: 700;
  color: #0C2948;
}

.vereador-photo-card {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 999px;
  overflow: hidden;
  background: #0C2948;
}

.vereador-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vereador-info-block {
  width: 100%;
}

.vereador-name-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
}

.vereador-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: #0C2948;
  margin-bottom: 0;
}

.vereador-party {
  display: inline-block;
  background: #0C2948;
  color: #fff;
  padding: 0.2rem 0.6rem;
  border-radius: 0.5rem;
  font-weight: 600;
  margin-top: 0.5rem;
  font-size: 0.75rem;
}

/* Vereador Body */
.vereador-body {
  padding: 1rem;
}

/* Rating Card */
.vereador-rating-card {
  padding: 0;
  border-radius: 0.5rem;
  margin-top: 0.75rem;
  text-align: center;
  overflow: hidden;
}

.rating-card-header {
  background: #0369a1;
  color: #ffffff;
  padding: 0.5rem 1rem;
}

.rating-card-header .rating-label {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
}

.rating-label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.rating-stars {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.camara-rating-stars img {
  width: 32px;
  height: 32px;
}

.rating-stars img {
  width: 32px;
  height: 32px;
}

.rating-stars img:not(:last-child) {
  margin-right: 0.25rem;
}

/* Badges */
.vereador-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-verified {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.badge-participative {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.badge-transparency {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* Conditional Notice */
.conditional-evaluation-notice {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
  margin-bottom: 0.5rem;
}

.conditional-evaluation-notice p {
  margin: 0;
  color: #92400e;
  font-size: 0.875rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .vereador-widget {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .vereador-photo-card {
    width: 100px;
    height: 100px;
  }
}
