@import url('rotas.css');

:root {
    /* Cores importadas da palete principal */
    --deep-teal: #1a4d4c;
    --sage-green: #7b9c8c;
    --warm-sand: #e5d9cc;
    --off-white: #f8f6f2;
    --charcoal: #2d2f31;
    --stone-gray: #6b6f72;
    --clay-red: #c45d42;
    --cream: #fff9f0;
    --fog: #e8ecef;
    --light-clay: #f0e4dd;
    --bg: var(--off-white);
    --card: var(--cream);
    --muted: var(--stone-gray);
    --accent: var(--deep-teal);
    --accent-600: #0e3a39;
    --glass: rgba(255, 255, 255, 0.9);
    --radius: 0px;
    --radius-sm: 0px;
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 40px -15px rgba(0, 0, 0, 0.15);
    --max-width: 1400px;
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    
    /* Variáveis específicas mantidas para compatibilidade */
    --bg-color: var(--off-white);
    --accent-dark: #0e3a39;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-inner: rgba(255, 255, 255, 0.5);
    --shadow-soft: 0 8px 32px 0 rgba(26, 77, 76, 0.15);
    --text-main: var(--charcoal);
    --text-muted: var(--stone-gray);
    --danger: var(--clay-red);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 10% 10%, rgba(26, 77, 76, 0.08) 0px, transparent 50%),
        radial-gradient(at 90% 90%, rgba(196, 93, 66, 0.08) 0px, transparent 50%);
    font-family: var(--font);
    margin: 0;
    min-height: 100vh;
    color: var(--text-main);
    overflow-x: hidden;
    letter-spacing: -0.01em;
}

/* =========================================
   Estilos específicos da página de rota personalizada
   ========================================= */

/* Forçar que o main desta página não tenha restrições de largura */
main {
    max-width: none !important;
    padding-left: 0;
    margin: 0;
    width: 100%;
}

/* Layout principal (grid) – agora com menos padding lateral */
.dashboard-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
    height: calc(100vh - 80px);
    padding: 20px 10px;
    max-width: none;
    margin: 0;
    width: 100%;
}

/* Efeito glass (apenas para esta página) */
.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
}

.glass-inner {
    background: var(--glass-inner);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Painel lateral */
.info-panel {
    border-radius: var(--radius);
    padding: 30px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: var(--cream);
    border: 1px solid var(--fog);
}

.panel-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.panel-header-row h2 {
    font-size: 1.6rem;
    color: var(--deep-teal);
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

/* Botão "Automática" */
.btn-magic {
    background: var(--deep-teal);
    color: white;
    padding: 8px 18px;
    height: auto;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: 3px 3px 0 var(--clay-red);
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.btn-magic:hover {
    transform: translate(-2px, -2px);
    background: var(--accent-600);
    box-shadow: 5px 5px 0 var(--clay-red);
}

.btn-magic i {
    font-size: 1rem;
}

/* Divisor */
.divider {
    height: 1px;
    background: var(--fog);
    margin: 15px 0;
}

/* Formulários */
.form-group {
    margin-bottom: 12px;
}

.input-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--stone-gray);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

option {
    text-transform: none;
}

/* Filtro de mobilidade */
.filter-box {
    margin-bottom: 15px;
    padding: 12px;
    background: var(--light-clay);
    border: 1px solid var(--warm-sand);
    border-radius: var(--radius-sm);
}

.toggle-control {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 10px;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--deep-teal);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toggle-control input { 
    display: none; 
}

.control-indicator {
    width: 36px;
    height: 18px;
    background: var(--stone-gray);
    border-radius: 15px;
    position: relative;
    transition: 0.3s;
}

.control-indicator:before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: 0.3s;
}

input:checked + .control-indicator {
    background: var(--deep-teal);
}

input:checked + .control-indicator:before {
    transform: translateX(18px);
}

/* Botões secundário e primário */
.btn-secondary, .btn-primary {
    border: none;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8rem;
}

.btn-secondary {
    background: white;
    color: var(--charcoal);
    border: 2px solid var(--deep-teal);
}

.btn-secondary:hover {
    background: var(--light-clay);
    transform: translate(-2px, -2px);
    box-shadow: 3px 3px 0 var(--clay-red);
}

.btn-primary {
    background: var(--deep-teal);
    color: white;
    margin-top: 10px;
    border: 2px solid var(--deep-teal);
}

.btn-primary:hover {
    background: transparent;
    color: var(--deep-teal);
    transform: translate(-2px, -2px);
    box-shadow: 3px 3px 0 var(--clay-red);
}

.full-width {
    width: 100%;
}

/* Lista de pontos (arrastável) */
.lista-editavel {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 5px;
    margin-top: 10px;
}

.ponto-card {
    background: white;
    border: 2px solid var(--deep-teal);
    padding: 12px;
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    cursor: grab;
    user-select: none;
    box-shadow: 3px 3px 0 var(--light-clay);
}

.ponto-card:active {
    cursor: grabbing;
    background: var(--cream);
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 var(--clay-red);
}

.sortable-ghost {
    opacity: 0.4;
    background: var(--fog);
    border: 2px dashed var(--stone-gray);
}

.drag-handle {
    color: var(--stone-gray);
    margin-right: 12px;
    cursor: grab;
    font-size: 1.1rem;
}

.ponto-info {
    flex-grow: 1;
    padding-right: 10px;
}

.ponto-nome {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--charcoal);
    display: block;
}

.ponto-ordem {
    font-size: 0.7rem;
    color: var(--deep-teal);
    font-weight: 700;
    margin-right: 5px;
    background: var(--light-clay);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.btn-delete {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    background: var(--clay-red);
    color: white;
    margin-left: 10px;
}

.btn-delete:hover {
    background: var(--deep-teal);
    transform: scale(1.05);
}

.badge-acessivel {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    color: var(--deep-teal);
    background: var(--fog);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    margin-top: 4px;
    width: fit-content;
    text-transform: uppercase;
}

/* Toggle de transporte */
.toggle-transporte {
    display: flex;
    padding: 4px;
    border-radius: var(--radius-sm);
    gap: 5px;
    background: var(--fog);
}

.toggle-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    color: var(--stone-gray);
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.toggle-btn.btn-ativo {
    background: var(--deep-teal);
    color: white;
}

/* Mapa */
.map-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.map-controls {
    flex-shrink: 0;
}

.main-map-container {
    flex-grow: 1;
    min-height: 0;
    height: auto;
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    border: 3px solid var(--deep-teal);
}

#mapa-personalizado {
    height: 100%;
    width: 100%;
}

.glass-border {
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
}

/* =========================================
   ÍCONE DA ESCOLA
   ========================================= */
.school-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--deep-teal);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 1.3rem;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 3px 3px 0 var(--clay-red);
    border: none;
    text-decoration: none;
}

.school-icon:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 var(--clay-red);
    background: var(--accent-600);
}

.school-icon i, 
.school-icon svg {
    font-size: 1.3rem;
}

/* Container para os ícones no topo direito */
.header-icons {
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

/* Ajuste para o seletor de idioma quando estiver junto com o ícone */
.header-icons {
    position: relative;
    top: 0;
    right: 0;
}

/* Opção: Ícone da escola sozinho no canto inferior direito */
.school-icon-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

/* =========================================
   RESPONSIVIDADE
   ========================================= */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 320px 1fr;
        gap: 15px;
        padding: 15px;
    }
    
    .info-panel {
        padding: 20px;
    }
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        height: auto;
        gap: 20px;
        padding: 10px;
    }
    
    .info-panel {
        height: auto;
        max-height: 500px;
    }
    
    .map-panel {
        height: 400px;
    }
    
    .school-icon {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }
    
    .school-icon i, 
    .school-icon svg {
        font-size: 1.1rem;
    }
    
    .header-icons {
        top: 15px;
        right: 15px;
        gap: 8px;
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        height: auto;
        gap: 20px;
    }
    
    .info-panel {
        height: auto;
        max-height: 500px;
    }
    
    .map-panel {
        height: 400px;
    }
    
    .panel-header-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .panel-header-row h2 {
        font-size: 1.3rem;
    }
    
    .btn-magic {
        width: 100%;
        justify-content: center;
    }
    
    .school-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .school-icon i, 
    .school-icon svg {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .info-panel {
        padding: 15px;
    }
    
    .ponto-card {
        padding: 8px;
    }
    
    .ponto-nome {
        font-size: 0.85rem;
    }
    
    .btn-delete {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .school-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .school-icon i, 
    .school-icon svg {
        font-size: 0.9rem;
    }
}

/* Scrollbar personalizada - uniformizada */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--off-white);
}

::-webkit-scrollbar-thumb {
    background: var(--deep-teal);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--clay-red);
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ponto-card {
    animation: fadeIn 0.3s ease;
}

/* Utilidades */
.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 10px;
}

.mb-2 {
    margin-bottom: 10px;
}

.hidden {
    display: none;
}

/* Links e botões adicionais */
a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: var(--font);
}

/* Efeitos de foco para acessibilidade */
:focus-visible {
    outline: 2px solid var(--clay-red);
    outline-offset: 2px;
}

.fas fa-leaf{
    color: #4CAF50;
}