/*
 * Painel "vivo" da tela de Navios (lista | mapa | detalhes + histórico),
 * seguindo o mesmo padrão dos outros CSS escopados do projeto: CSS puro,
 * classes semânticas sob `.navios-dashboard`, registrado via
 * FilamentAsset no SistemaPanelProvider. Tema escuro via `html.dark`.
 */

.navios-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.navios-dashboard__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 1024px) {
    .navios-dashboard__grid {
        grid-template-columns: 22rem 1fr 20rem;
        align-items: start;
    }
}

.navios-dashboard__card {
    border-radius: 0.75rem;
    background-color: #fff;
    box-shadow: inset 0 0 0 1px rgb(9 9 11 / 0.1);
    padding: 1rem;
}

html.dark .navios-dashboard__card {
    background-color: #18181b;
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.1);
}

.navios-dashboard__card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.navios-dashboard__card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #09090b;
}

html.dark .navios-dashboard__card-title {
    color: #fff;
}

.navios-dashboard__section-title {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #71717a;
}

html.dark .navios-dashboard__section-title {
    color: #a1a1aa;
}

/* --- Lista de navios --- */

.navios-dashboard__list-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.navios-dashboard__input,
.navios-dashboard__select {
    border-radius: 0.5rem;
    box-shadow: inset 0 0 0 1px rgb(9 9 11 / 0.1);
    background-color: transparent;
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
    color: #09090b;
}

.navios-dashboard__input {
    flex: 1;
    min-width: 0;
}

/*
 * O popup nativo de <option> do <select> não herda o tema do resto da
 * página — sem isto, o texto das opções fica branco sobre fundo branco
 * (herdado só o "color: #fff" do controle fechado, não o popup) e some.
 * `color-scheme` avisa o navegador para desenhar os controles nativos
 * (incluindo o popup do select) já no esquema de cor certo.
 */
.navios-dashboard__select {
    color-scheme: light;
}

html.dark .navios-dashboard__select {
    color-scheme: dark;
}

html.dark .navios-dashboard__input,
html.dark .navios-dashboard__select {
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.15);
    color: #fff;
}

.navios-dashboard__select option {
    background-color: #fff;
    color: #09090b;
}

html.dark .navios-dashboard__select option {
    background-color: #18181b;
    color: #fff;
}

.navios-dashboard__list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    max-height: 28rem;
    overflow-y: auto;
}

.navios-dashboard__list-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    border-radius: 0.5rem;
    box-shadow: inset 0 0 0 1px rgb(9 9 11 / 0.08);
    background-color: transparent;
    padding: 0.5rem 0.625rem;
    text-align: left;
    cursor: pointer;
}

.navios-dashboard__list-item:hover {
    background-color: #fafafa;
}

html.dark .navios-dashboard__list-item {
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.08);
}

html.dark .navios-dashboard__list-item:hover {
    background-color: rgb(255 255 255 / 0.05);
}

.navios-dashboard__list-item.is-active {
    box-shadow: inset 0 0 0 1.5px #22d3ee;
    background-color: rgb(34 211 238 / 0.08);
}

.navios-dashboard__list-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.navios-dashboard__list-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #09090b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html.dark .navios-dashboard__list-name {
    color: #fff;
}

.navios-dashboard__list-mmsi {
    font-size: 0.6875rem;
    color: #71717a;
}

html.dark .navios-dashboard__list-mmsi {
    color: #a1a1aa;
}

.navios-dashboard__list-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.6875rem;
    color: #71717a;
    flex-shrink: 0;
}

html.dark .navios-dashboard__list-meta {
    color: #d4d4d8;
}

/* --- Status dot --- */

.navios-dashboard__status-dot {
    flex-shrink: 0;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
}

.navios-dashboard__status-dot--em-movimento {
    background-color: #22c55e;
}

.navios-dashboard__status-dot--parado {
    background-color: #f59e0b;
}

.navios-dashboard__status-dot--sem-posicao {
    background-color: #a1a1aa;
}

/* --- Badge de status (detalhes + histórico) --- */

.navios-dashboard__badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
}

.navios-dashboard__badge--em-movimento {
    background-color: rgb(34 197 94 / 0.1);
    color: #16a34a;
}

.navios-dashboard__badge--parado {
    background-color: rgb(245 158 11 / 0.1);
    color: #b45309;
}

.navios-dashboard__badge--sem-posicao {
    background-color: rgb(161 161 170 / 0.15);
    color: #71717a;
}

/* --- Mapa --- */

.navios-dashboard__map-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 420px;
    border-radius: 0.5rem;
    background-color: #fafafa;
    color: #71717a;
    font-size: 0.8125rem;
    text-align: center;
    padding: 1rem;
}

html.dark .navios-dashboard__map-empty {
    background-color: #09090b;
    color: #a1a1aa;
}

.navios-dashboard__map-empty-icon {
    width: 2rem;
    height: 2rem;
}

.navios-dashboard__button-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    border-radius: 0.5rem;
    box-shadow: inset 0 0 0 1px rgb(9 9 11 / 0.1);
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #09090b;
    background-color: transparent;
    cursor: pointer;
}

html.dark .navios-dashboard__button-icon {
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.15);
    color: #fff;
}

.navios-dashboard__button-icon-svg {
    width: 0.875rem;
    height: 0.875rem;
}

/* --- Detalhes --- */

.navios-dashboard__dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.navios-dashboard__dl dt {
    font-size: 0.6875rem;
    color: #71717a;
}

html.dark .navios-dashboard__dl dt {
    color: #a1a1aa;
}

.navios-dashboard__dl dd {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #09090b;
}

html.dark .navios-dashboard__dl dd {
    color: #fff;
}

.navios-dashboard__link {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #0891b2;
    text-decoration: none;
}

.navios-dashboard__link:hover {
    text-decoration: underline;
}

html.dark .navios-dashboard__link {
    color: #22d3ee;
}

/* --- Histórico --- */

.navios-dashboard__table-wrapper {
    overflow-x: auto;
}

.navios-dashboard__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.navios-dashboard__table th {
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #71717a;
    border-bottom: 1px solid rgb(9 9 11 / 0.1);
    white-space: nowrap;
}

html.dark .navios-dashboard__table th {
    color: #a1a1aa;
    border-bottom-color: rgb(255 255 255 / 0.1);
}

.navios-dashboard__table td {
    padding: 0.5rem 0.75rem;
    color: #09090b;
    border-bottom: 1px solid rgb(9 9 11 / 0.06);
    white-space: nowrap;
}

html.dark .navios-dashboard__table td {
    color: #e4e4e7;
    border-bottom-color: rgb(255 255 255 / 0.06);
}

.navios-dashboard__empty {
    padding: 1.5rem 0.75rem;
    text-align: center;
    font-size: 0.8125rem;
    color: #71717a;
}

html.dark .navios-dashboard__empty {
    color: #a1a1aa;
}
