/* ==================================================
   CONSULTA DE EMOLUMENTOS
   Estilos visuais do plugin
   Cores Institucionais:
   - Verde: #00753F
   - Azul:  #2C4B86
================================================== */

/* Container principal */
.ce-container {
  width: 100%;
  max-width: 1366px;
  margin: 0 auto;
  font-family: Lexend Deca, Arial, sans-serif;
  color: #334155;
  box-sizing: border-box;
}

.ce-container * {
  box-sizing: border-box;
}

/* ==================================================
   FILTROS (ANO E TABELA - 2 COLUNAS)
================================================== */

.ce-filters {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
  padding: 20px;
  margin-bottom: 35px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.12);
}

.ce-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ce-field label {
  font-size: 15px;
  font-weight: 600;
  color: #2C4B86;
}

.ce-field select {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  background: #ffffff;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(90deg, #e2e8f0 100%, #e2e8f0 100%) border-box;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 15px;
  color: #334155;
  cursor: pointer;
  transition: all 0.25s ease;
}

.ce-field select:hover:not(:disabled) {
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(90deg, #00753F 0%, #2C4B86 100%) border-box;
}

.ce-field select:focus {
  outline: none;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(90deg, #00753F 0%, #2C4B86 100%) border-box;
  box-shadow: 0 0 0 3px rgba(0, 117, 63, 0.18);
}

.ce-field select:disabled {
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
  border: 1px solid #e2e8f0;
}

/* ==================================================
   ÁREA DE CONTEÚDO (SIDEBAR + PAINÉIS)
================================================== */

.ce-content {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 25px;
  align-items: stretch;
  animation: ceFade 0.3s ease;
}

@keyframes ceFade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================================================
   MENU DOS BOTÕES (SIDEBAR)
================================================== */

.ce-sidebar {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.ce-tab-btn,
.ce-pdf-btn {
  width: 100%;
  min-height: 46px;
  padding: 12px 18px;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(90deg, #00753F 0%, #2C4B86 100%) border-box;
  border: 2px solid transparent;
  border-radius: 10px;
  color: #2C4B86;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.ce-tab-btn:hover,
.ce-pdf-btn:hover {
  background: linear-gradient(90deg, #00753F 0%, #2C4B86 100%);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(44, 75, 134, 0.2);
}

.ce-tab-btn.active,
.ce-pdf-btn.active {
  background: linear-gradient(90deg, #00753F 0%, #2C4B86 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 117, 63, 0.3);
}

/* ==================================================
   PAINÉIS DE CONTEÚDO
================================================== */

.ce-panels {
  width: 100%;
  min-width: 0;
}

.ce-panel {
  width: 100%;
}

/* ==================================================
   VISUALIZADOR PDF
================================================== */

.ce-viewer {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.ce-pdf-frame,
#ce-pdf {
  width: 100%;
  height: 750px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.ce-download,
#ce-download {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 220px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(90deg, #00753F 0%, #2C4B86 100%);
  color: #ffffff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 117, 63, 0.25);
}

.ce-download:hover,
#ce-download:hover {
  transform: translateY(-2px);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(44, 75, 134, 0.35);
}

/* ==================================================
   TABELA EM ÁUDIO (TABLEPRESS)
================================================== */

.ce-audio-wrapper {
  width: 100%;
  overflow-x: auto;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

/* Ajustes visuais harmonizados com TablePress */
.ce-audio-wrapper table.tablepress {
  width: 100% !important;
  border-collapse: collapse;
  margin: 0 auto;
}

.ce-audio-wrapper table.tablepress thead th {
  background: #2C4B86;
  color: #ffffff;
  font-weight: 600;
  border: 1px solid #1e355b;
}

.ce-audio-wrapper table.tablepress th,
.ce-audio-wrapper table.tablepress td {
  padding: 12px 14px;
  font-size: 14px;
}

.ce-audio-wrapper audio {
  max-width: 100%;
  height: 38px;
}

/* ==================================================
   MENSAGENS E ALERTAS
================================================== */

.ce-notice {
  padding: 24px;
  border-radius: 10px;
  font-size: 15px;
  line-height: 1.6;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.ce-notice-warning {
  border-left: 5px solid #f59e0b;
  color: #92400e;
  background: #fffbeb;
}

.ce-notice-info {
  border-left: 5px solid #2C4B86;
  color: #1e355b;
  background: #f0f4fa;
}

/* Feedbacks globais */
.ce-loading,
.ce-audio-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 30px;
  font-size: 15px;
  font-weight: 600;
  color: #2C4B86;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ce-empty,
.ce-error {
  padding: 24px;
  text-align: center;
  font-size: 15px;
  color: #647883;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ce-error {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

/* Spinner animado com a identidade visual */
.ce-spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 3px solid rgba(44, 75, 134, 0.2);
  border-radius: 50%;
  border-top-color: #00753F;
  animation: ceSpin 0.8s linear infinite;
}

@keyframes ceSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ==================================================
   RESPONSIVO TABLET
================================================== */

@media (max-width: 900px) {
  .ce-filters {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .ce-content {
    grid-template-columns: 1fr;
  }

  .ce-sidebar {
    flex-direction: row;
  }

  .ce-tab-btn,
  .ce-pdf-btn {
    text-align: center;
    justify-content: center;
  }

  .ce-pdf-frame,
  #ce-pdf {
    height: 600px;
  }
}

/* ==================================================
   RESPONSIVO CELULAR
================================================== */

@media (max-width: 600px) {
  .ce-container {
    padding: 0 8px;
  }

  .ce-filters {
    padding: 15px;
    margin-bottom: 25px;
  }

  .ce-sidebar {
    flex-direction: column;
  }

  .ce-tab-btn,
  .ce-pdf-btn {
    min-height: 44px;
    text-align: center;
    justify-content: center;
  }

  .ce-pdf-frame,
  #ce-pdf {
    height: 450px;
  }

  .ce-download,
  #ce-download {
    width: 100%;
  }

  .ce-audio-wrapper {
    padding: 12px;
  }
}
