/**
 * Toolbar Styles
 * 
 * Estilos para a nova barra de ferramentas moderna.
 */

/* ===================================================== */
/* MAINBAR - Controles principais */
/* ===================================================== */

.map-main-bar {
    background-color: transparent !important;
    padding: 0 0 2px 0 !important;
}

.map-main-bar .ol-control {
    background-color: transparent;
    padding: 0 !important;
}

.map-main-bar .ol-control button {
    width: 35px;
    height: 35px;
    background-color: rgba(52, 122, 183, 0.6);
    margin: 0;
    margin-bottom: 1px;
    border: none;
    border-radius: 2px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-main-bar .ol-control button:hover {
    background-color: rgba(52, 122, 183, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

.map-main-bar .ol-control button:focus {
    outline: none;
    background-color: rgba(52, 122, 183, 1);
    box-shadow: 0 0 8px rgba(52, 122, 183, 1);
}

.map-main-bar .ol-control button:active,
.map-main-bar .ol-control button.active {
    background-color: rgba(40, 90, 140, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ===================================================== */
/* TOOLBAR - Ferramentas de interação */
/* ===================================================== */

.map-tool-bar {
    background-color: transparent !important;
    padding: 0 0 2px 0 !important;
}

.map-tool-bar .ol-control {
    background-color: transparent;
    padding: 0 !important;
}

.map-tool-bar .ol-control button {
    width: 35px;
    height: 35px;
    background-color: rgba(52, 122, 183, 0.6);
    margin: 0;
    margin-bottom: 1px;
    border: none;
    border-radius: 2px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-tool-bar .ol-control button:hover {
    background-color: rgba(52, 122, 183, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

.map-tool-bar .ol-control button:focus {
    outline: none;
    background-color: rgba(52, 122, 183, 1);
    box-shadow: 0 0 8px rgba(52, 122, 183, 1);
}

.map-tool-bar .ol-control button:active,
.map-tool-bar .ol-control button.active {
    background-color: rgba(40, 90, 140, 1) !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3) !important;
    border: 2px solid rgba(255, 255, 0, 0.8) !important;
}

/* Destaque quando ferramenta está ativa */
.ol-control.ol-active button,
.ol-control.active button,
.map-tool-bar .ol-control.ol-active button,
.map-tool-bar .ol-control.active button {
    background-color: rgba(40, 90, 140, 1) !important;
    box-shadow: 0 0 10px rgba(52, 122, 183, 1) !important;
    border: 2px solid rgba(255, 255, 0, 0.8) !important;
}

/* ===================================================== */
/* BOTÕES ESPECÍFICOS */
/* ===================================================== */

.tool-select,
.tool-box-zoom,
.tool-pan,
.tool-measure-area,
.tool-measure-length,
.tool-identify,
.tool-draw,
.tool-locator {
    display: block !important;
}

/* ===================================================== */
/* INDICADORES DE CARREGAMENTO */
/* ===================================================== */

#export-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    text-align: center;
}

#export-loading i {
    font-size: 32px;
    color: #3472b7;
    margin-bottom: 10px;
}

#export-loading p {
    margin-top: 10px;
    color: #333;
    font-weight: 500;
}

/* ===================================================== */
/* PAINEL DE IDENTIFICAÇÃO */
/* ===================================================== */

#panelIdentify {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.identify-result-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.identify-result-item h5 {
    margin: 0 0 10px 0;
    color: #3472b7;
    font-weight: 600;
}

.identify-result-item table {
    margin-bottom: 0;
    font-size: 12px;
}

.identify-result-item table td {
    padding: 4px 8px;
}

.identify-result-item table tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* ===================================================== */
/* MENSAGENS DE ALERTA */
/* ===================================================== */

.alert {
    margin-top: 10px;
    border-radius: 4px;
    animation: slideIn 0.3s ease-in-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* ===================================================== */
/* LAYER SELECT (para DrawTool) */
/* ===================================================== */

.layer-select {
    margin-top: 10px;
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.layer-select.d-none {
    display: none !important;
}

/* ===================================================== */
/* SPINNER */
/* ===================================================== */

.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: text-bottom;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* ===================================================== */
/* RESPONSIVENESS */
/* ===================================================== */

@media (max-width: 768px) {
    .map-main-bar .ol-control button,
    .map-tool-bar .ol-control button {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    #export-loading {
        width: 90%;
        max-width: 300px;
    }

    #panelIdentify {
        max-height: 300px;
    }
}

/* ===================================================== */
/* PRINT STYLES */
/* ===================================================== */

@media print {
    .map-main-bar,
    .map-tool-bar,
    .ol-attribution,
    .ol-control {
        display: none !important;
    }

    .ol-viewport {
        background-color: white;
    }

    #map {
        height: auto !important;
        page-break-after: avoid;
    }
}
