/* Header Mobile-First - Alluagro */

/* Reset e configuração base */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header principal - Mobile First */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(135deg, #00522d, #28a745);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.header-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    max-width: 100%;
}

/* Menu hambúrguer (esquerda) */
.menu-lateral {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    color: #ffffff;
}

.menu-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 18px;
}

.menu-trigger:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
    text-decoration: none;
    color: white;
}

.menu-trigger:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.menu-trigger i {
    font-size: 18px;
}

/* Logo (centro) */
.logo {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    padding: 0 20px;
}

.logo img {
    max-height: 35px;
    width: auto;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.logo:hover img {
    transform: scale(1.05);
}

/* Ícone de usuário/logout (direita) */
.logout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
}

.logout a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 18px;
}

.logout a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
    text-decoration: none;
    color: white;
}

.logout a:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.logout a i {
    font-size: 18px;
}

/* Ajustar conteúdo principal para não ficar atrás do header fixo */
#app {
    margin-top: 60px;
    min-height: calc(100vh - 60px);
}

/* Ajustar footer se necessário */
.footer {
    margin-top: auto;
}

/* Tablets */
@media (min-width: 768px) {
    .header {
        height: 70px;
    }
    
    .header-container {
        padding: 0 30px;
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .logo img {
        max-height: 40px;
    }
    
    .menu-trigger,
    .logout a {
        width: 48px;
        height: 48px;
        font-size: 19px;
    }
    
    .menu-trigger i,
    .logout a i {
        font-size: 19px;
    }
    
    #app {
        margin-top: 70px;
        min-height: calc(100vh - 70px);
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .header {
        height: 80px;
    }
    
    .header-container {
        padding: 0 40px;
    }
    
    .logo img {
        max-height: 45px;
    }
    
    .menu-trigger,
    .logout a {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .menu-trigger i,
    .logout a i {
        font-size: 20px;
    }
    
    #app {
        margin-top: 80px;
        min-height: calc(100vh - 80px);
    }
}

/* Extra Large Desktop */
@media (min-width: 1400px) {
    .header-container {
        max-width: 1400px;
    }
}

/* Dispositivos muito pequenos */
@media (max-width: 360px) {
    .header-container {
        padding: 0 10px;
    }
    
    .logo {
        padding: 0 10px;
    }
    
    .logo img {
        max-height: 30px;
    }
    
    .menu-trigger,
    .logout a {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .menu-trigger i,
    .logout a i {
        font-size: 16px;
    }
}

/* Modo paisagem em dispositivos móveis */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        height: 50px;
    }
    
    .logo img {
        max-height: 30px;
    }
    
    .menu-trigger,
    .logout a {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .menu-trigger i,
    .logout a i {
        font-size: 16px;
    }
    
    #app {
        margin-top: 50px;
        min-height: calc(100vh - 50px);
    }
}

/* Alto contraste */
@media (prefers-contrast: high) {
    .header {
        border-bottom: 2px solid #fff;
    }
    
    .menu-trigger:focus,
    .logout a:focus {
        outline: 3px solid #fff;
        outline-offset: 3px;
    }
}

/* Redução de movimento */
@media (prefers-reduced-motion: reduce) {
    .menu-trigger,
    .logout a,
    .logo img {
        transition: none !important;
        transform: none !important;
    }
    
    .menu-trigger:hover,
    .logout a:hover,
    .logo:hover img {
        transform: none !important;
    }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .header {
        background: linear-gradient(135deg, #003d1f, #1e5f32);
    }
}