/**
 * 🔗 MENU SHARED - RotaTruck v5.0.3
 * Estilos compartilhados entre todos os menus
 * Extraído de sidebar-menu.css (linhas 1-18 + estilos comuns)
 * 
 * ATUALIZAÇÃO v5.0.3:
 * ✅ Adicionado suporte completo para TEMA DIA
 * ✅ Cores adaptativas baseadas em body:not(.theme-dark)
 * ✅ Baseado em: 5-ROTATRUCK_-_DOCUMENTAÇÃO_MASTER_DE_LAYOUT.md
 */

/* ==================== RESET BÁSICO ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    width: 100%;
    height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ==================== SCROLLBAR CUSTOMIZADA ==================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 53, 0.5);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 107, 53, 0.7);
}

/* ==================== TEXTO "MENU" AO LADO DA LOGO ==================== */
.menu-text {
    display: inline-block;
    font-size: 32px;
    font-weight: 900;
    color: #FF6B35;
    margin: 0;
    letter-spacing: 0.5px;
}

/* ==================== MAPA ==================== */
#map {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: calc(var(--z-mapa) + 1);
}

/* ==================== BOTÃO GPS FLUTUANTE ==================== */
.btn-location-custom {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: #FF6B35;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.4);
    transition: all 0.3s ease;
    z-index: var(--z-painel);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-location-custom:hover {
    background: #FF814F;
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(255, 107, 53, 0.6);
}

.btn-location-custom:active {
    transform: scale(0.95);
}

/* ==================== ANIMAÇÕES COMUNS ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* ==================== UTILITÁRIOS ==================== */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.text-center {
    text-align: center;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== TRANSITIONS GLOBAIS ==================== */
.smooth-transition {
    transition: all 0.3s ease;
}

.fast-transition {
    transition: all 0.15s ease;
}

/* ==================== ESTADOS DE LOADING ==================== */
.loading {
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ==================== FOCUS VISÍVEL (ACESSIBILIDADE) ==================== */
*:focus-visible {
    outline: 2px solid #FF6B35;
    outline-offset: 2px;
}

/* ==================== PREVENÇÃO DE SELECT EM ELEMENTOS UI ==================== */
.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* ==================== GLASSMORPHISM COMUM ==================== */
.glass-effect {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
}

.glass-light {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ==================== SOMBRAS COMUNS ==================== */
.shadow-sm {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.shadow-md {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.shadow-lg {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.shadow-orange {
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.4);
}

/* ==================== BORDER RADIUS COMUNS ==================== */
.rounded-sm {
    border-radius: 8px;
}

.rounded-md {
    border-radius: 12px;
}

.rounded-lg {
    border-radius: 16px;
}

.rounded-xl {
    border-radius: 24px;
}

.rounded-full {
    border-radius: 50%;
}

/* ==================== CORES DE ESTADO ==================== */
.text-primary {
    color: #FF6B35;
}

.text-secondary {
    color: rgba(255, 255, 255, 0.7);
}

.text-muted {
    color: rgba(255, 255, 255, 0.5);
}

.text-disabled {
    color: rgba(255, 255, 255, 0.3);
}

.bg-primary {
    background-color: #FF6B35;
}

.bg-secondary {
    background-color: rgba(255, 255, 255, 0.05);
}

/* ==================== GRADIENTES COMUNS ==================== */
.gradient-orange {
    background: linear-gradient(135deg, #FF6B35, #FF814F);
}

.gradient-dark {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.7));
}

/* ==================== Z-INDEX HIERARCHY ==================== */
.z-base {
    z-index: calc(var(--z-mapa) + 1);
}

.z-dropdown {
    z-index: var(--z-painel);
}

.z-overlay {
    z-index: calc(var(--z-painel) + 1);
}

.z-modal {
    z-index: calc(var(--z-painel) + 2);
}

.z-sidebar-overlay {
    z-index: var(--z-lateral);
}

.z-sidebar {
    z-index: calc(var(--z-lateral) + 1);
}

.z-hamburger {
    z-index: var(--z-nav-base);
}

/* ==================== HELPERS DE SPACING ==================== */
.m-0 { margin: 0; }
.m-1 { margin: 4px; }
.m-2 { margin: 8px; }
.m-3 { margin: 12px; }
.m-4 { margin: 16px; }

.p-0 { padding: 0; }
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }

.mt-auto { margin-top: auto; }
.mb-auto { margin-bottom: auto; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

/* ==================== RESPONSIVE HELPERS ==================== */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}


/* ==================== ✨ TEMA DIA (ADICIONADO v5.0.3) ==================== */
/* 
 * CORREÇÃO: Utilitários com suporte a TEMA DIA
 * Baseado em: 5-ROTATRUCK_-_DOCUMENTAÇÃO_MASTER_DE_LAYOUT.md
 */

/* Glassmorphism - Durante o DIA */
body:not(.theme-dark) .glass-effect {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body:not(.theme-dark) .glass-light {
    background: rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Cores de Estado - Durante o DIA */
body:not(.theme-dark) .text-secondary {
    color: rgba(0, 0, 0, 0.7);
}

body:not(.theme-dark) .text-muted {
    color: rgba(0, 0, 0, 0.5);
}

body:not(.theme-dark) .text-disabled {
    color: rgba(0, 0, 0, 0.3);
}

body:not(.theme-dark) .bg-secondary {
    background-color: rgba(0, 0, 0, 0.04);
}

/* Loading - Durante o DIA */
body:not(.theme-dark) .loading::after {
    border: 3px solid rgba(0, 0, 0, 0.2);
    border-top-color: #FF6B35;
}

/* Gradiente Dark - Durante o DIA */
body:not(.theme-dark) .gradient-dark {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
}

/* ==================== FIM DO TEMA DIA ==================== */