/**
 * ================================================
 * MENU-LATERAL-LEGACY.CSS
 * ================================================
 * Extraído de estilosRotas.js (que injetava CSS via JS)
 * Contém estilos para: menu lateral, overlay, formulários,
 * botões, cards de rotas, legenda tráfego, marcador localização,
 * loading spinner, responsivo mobile.
 *
 * Versão: 1.0.0 (migrado de estilosRotas.js v4.0.1)
 * Data: 25/03/2026
 * ================================================
 */

/* ================================================ */
/* MENU LATERAL RESPONSIVO - LADO DIREITO */
/* ================================================ */

.menu-toggle-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: calc(var(--z-nav-base) + 1);
    background: linear-gradient(135deg, #ff6600, #ff8800);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(255, 102, 0, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 102, 0, 0.6);
}

.menu-lateral {
    position: fixed;
    top: 0;
    right: -380px;
    width: 380px;
    height: 100vh;
    background: rgba(0, 51, 102, 0.98);
    backdrop-filter: blur(10px);
    z-index: calc(var(--z-nav-base) + 2);
    transition: right 0.3s ease;
    overflow-y: auto;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
}

.menu-lateral.aberto {
    right: 0;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-nav-base);
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay.visivel {
    display: block;
    opacity: 1;
}

.menu-header {
    padding: 20px;
    background: linear-gradient(135deg, #ff6600, #ff8800);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-header h3 {
    margin: 0;
    font-size: 24px;
}

.btn-fechar-menu {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.btn-fechar-menu:hover {
    transform: rotate(90deg);
}

.menu-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-tab {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.menu-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
}

.menu-tab.active {
    color: #ff6600;
    border-bottom-color: #ff6600;
    background: rgba(255, 102, 0, 0.1);
}

.menu-conteudo {
    padding: 20px;
}

.aba-conteudo {
    display: none;
}

.aba-conteudo.active {
    display: block;
}

/* ================================================ */
/* FORMULÁRIOS */
/* ================================================ */

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 5px;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #ff6600;
    background: rgba(255, 255, 255, 0.15);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-group small {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    margin-top: 3px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* ================================================ */
/* BOTÕES */
/* ================================================ */

.btn-primary,
.btn-secondary {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 5px;
}

.btn-primary {
    background: linear-gradient(135deg, #ff6600, #ff8800);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 102, 0, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-block {
    display: block;
    margin-bottom: 10px;
}

/* ================================================ */
/* CARDS DE ROTAS */
/* ================================================ */

.rotas-cards {
    margin-top: 20px;
}

.card-rota {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.card-rota:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 102, 0, 0.3);
    transform: translateY(-2px);
}

.card-rota.ativa {
    background: rgba(255, 102, 0, 0.15);
    border-color: #ff6600;
}

.card-rota.rota-card-selected {
    background: rgba(0, 255, 127, 0.12) !important;
    border: 2px solid #00ff7f !important;
    box-shadow: 0 0 20px rgba(0, 255, 127, 0.3);
    transform: translateY(0) !important;
}

.card-rota.rota-card-selected:hover {
    background: rgba(0, 255, 127, 0.18) !important;
    border-color: #00ff7f !important;
    box-shadow: 0 0 25px rgba(0, 255, 127, 0.4);
}

.badge-selecionada {
    display: inline-block;
    background: linear-gradient(135deg, #00ff7f, #00cc66);
    color: #001a0d;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-left: 8px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0, 255, 127, 0.3);
    animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(0, 255, 127, 0.3);
    }
    50% {
        box-shadow: 0 2px 15px rgba(0, 255, 127, 0.6);
    }
}

.rota-titulo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.rota-titulo h4 {
    margin: 0;
    color: white;
    font-size: 16px;
}

.rota-badge {
    background: #ff6600;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
}

.rota-info {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

.info-item .icone {
    font-size: 16px;
}

.info-item .valor {
    font-weight: bold;
    color: white;
}

.rota-custo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 10px;
}

.custo-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

.custo-valor {
    font-size: 18px;
    font-weight: bold;
    color: #00ff00;
}

.btn-selecionar {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #00aa00, #00ff00);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-selecionar:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 0, 0.3);
}

/* ================================================ */
/* PAINEL MAPA */
/* ================================================ */

.painel-secao {
    margin-bottom: 20px;
}

.painel-secao h4 {
    color: white;
    margin-bottom: 10px;
    font-size: 16px;
}

.filtros-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filtro-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.filtro-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.filtro-item input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.filtro-item span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

.legenda-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legenda-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.legenda-icone {
    font-size: 18px;
    width: 25px;
    text-align: center;
}

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

#loading-rotas {
    text-align: center;
    padding: 20px;
}

#loading-rotas p {
    color: rgba(255, 255, 255, 0.8);
    margin-top: 10px;
    font-size: 14px;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: #ff6600;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* ================================================ */
/* MENSAGENS */
/* ================================================ */

.sem-resultados {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 20px;
    font-size: 14px;
}

/* ================================================ */
/* LEGENDA TRÁFEGO FLUTUANTE */
/* ================================================ */

.legenda-trafego-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: calc(var(--z-nav-base) + 1);
    transition: opacity 0.3s ease;
}

.legenda-trafego-container.escondido {
    opacity: 0;
    pointer-events: none;
}

.btn-toggle-legenda {
    background: linear-gradient(135deg, #ff6600, #ff8800);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(255, 102, 0, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.btn-toggle-legenda:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 102, 0, 0.6);
}

.icone-trafego {
    font-size: 18px;
}

.texto-legenda {
    font-size: 14px;
}

.painel-legenda-expansivel {
    position: absolute;
    top: 60px;
    left: 0;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 15px;
    min-width: 220px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.3s ease;
}

.painel-legenda-expansivel.aberto {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.painel-legenda-expansivel h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: white;
}

.cor-trafego {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.legenda-footer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

/* ================================================ */
/* MARCADOR "VOCÊ ESTÁ AQUI" */
/* ================================================ */

.marcador-minha-localizacao {
    background: transparent;
    border: none;
}

.pin-localizacao {
    font-size: 32px;
    animation: bounce 2s infinite;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.leaflet-popup-content {
    margin: 10px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

/* ================================================ */
/* RESPONSIVO - MOBILE */
/* ================================================ */

@media (max-width: 768px) {
    .menu-lateral {
        width: 100%;
        right: -100%;
    }

    .menu-lateral.aberto {
        right: 0;
    }

    .menu-toggle-btn {
        padding: 10px 16px;
        font-size: 16px;
    }

    .menu-label {
        display: none;
    }

    .legenda-trafego-container {
        left: 80px;
    }

    .btn-toggle-legenda {
        padding: 10px 16px;
    }

    .texto-legenda {
        display: none;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ================================================ */
/* SCROLLBAR CUSTOMIZADO */
/* ================================================ */

.menu-lateral::-webkit-scrollbar {
    width: 8px;
}

.menu-lateral::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.menu-lateral::-webkit-scrollbar-thumb {
    background: rgba(255, 102, 0, 0.5);
    border-radius: 4px;
}

.menu-lateral::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 102, 0, 0.7);
}
