/* Menu de Navegação Horizontal Fixo com Notificações */
:root {
    /* Alturas do chrome fixo no topo — status-bar.js define --jarvis-status-bar-height quando ativo */
    --jarvis-status-bar-height: 0px;
    --jarvis-main-nav-height: 40px;
    --jarvis-chrome-top: calc(var(--jarvis-status-bar-height) + var(--jarvis-main-nav-height));
    /* Empilhamento: modais sempre acima do menu (z-index do .main-nav) */
    --z-jarvis-main-nav: 2000;
    --z-jarvis-modal: 3000;
    --z-jarvis-modal-confirm: 3100;
}

.main-nav {
    position: fixed;
    top: var(--jarvis-status-bar-height);
    left: 0;
    right: 0;
    background: #2d3748;
    height: var(--jarvis-main-nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: var(--z-jarvis-main-nav);
    font-size: 0.875rem;
}

/* Container de Navegação (60%) */
.nav-content {
    width: 60%;
    display: flex;
    align-items: center;
    padding: 0 15px;
    overflow-x: auto;
    overflow-y: hidden;
}

.nav-content::-webkit-scrollbar {
    height: 3px;
}

.nav-content::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 3px;
}

.main-nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.main-nav-item {
    position: relative;
}

.main-nav-link {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 15px;
    color: #e2e8f0;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    height: var(--jarvis-main-nav-height);
}

.main-nav-link:hover {
    background: #4a5568;
    color: white;
}

.main-nav-link.active {
    background: #4a5568;
    color: white;
    border-bottom: 2px solid #48bb78;
}

.main-nav-icon {
    font-size: 1rem;
}

/* Indicador de submenu */
.has-submenu > .main-nav-link::after {
    content: '▼';
    font-size: 0.65rem;
    margin-left: 3px;
    opacity: 0.7;
}

/* Submenu (dropdown) - VERSÃO SIMPLES */
.main-nav-submenu {
    position: absolute;
    top: var(--jarvis-main-nav-height);
    left: 0;
    background: #2d3748;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-radius: 0 0 6px 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    list-style: none;
    margin: 0;
    padding: 5px 0;
    z-index: 9999;
    pointer-events: none;
}

/* Hover removido - usando clique em vez de hover */

.main-nav-submenu-item {
    margin: 0;
}

.main-nav-submenu-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    color: #cbd5e0;
    text-decoration: none;
    font-weight: 400;
    transition: all 0.2s ease;
    font-size: 0.813rem;
}

.main-nav-submenu-link:hover {
    background: #4a5568;
    color: white;
    padding-left: 20px;
}

.main-nav-submenu-link.active {
    background: #4a5568;
    color: white;
    border-left: 3px solid #48bb78;
}

/* Separador visual */
.main-nav-submenu-item:nth-child(3) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 6px;
    padding-bottom: 2px;
}

/* ==================== ÁREA DE NOTIFICAÇÕES (40%) ==================== */
.notifications-area {
    width: 40%;
    height: var(--jarvis-main-nav-height);
    background: linear-gradient(135deg, #1e2a3a 0%, #2d3748 100%);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.notifications-carousel {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 15px;
    cursor: default;
}

.notification-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 15px;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.notification-item.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.notification-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.notification-text {
    color: #e2e8f0;
    font-size: 0.813rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 400;
}

/* Indicadores do Carrossel */
.carousel-indicators {
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 10;
}

.carousel-indicators .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-indicators .dot.active {
    background: #48bb78;
    width: 18px;
    border-radius: 3px;
}

.carousel-indicators .dot:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ==================== ANIMAÇÕES ==================== */
@keyframes fadeSlideIn {
    0% {
        opacity: 0;
        transform: translateX(20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeSlideOut {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-20px);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ==================== MOBILE - NOTIFICAÇÕES ==================== */
.notifications-mobile {
    display: none;
    position: relative;
    z-index: 2001;
}

.notifications-bell {
    position: relative;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 5px 10px;
    transition: transform 0.2s ease;
}

.notifications-bell:hover {
    transform: scale(1.1);
}

.notifications-bell:active {
    transform: scale(0.95);
}

.notifications-badge {
    position: absolute;
    top: -2px;
    right: 2px;
    background: #e74c3c;
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

/* Dropdown Mobile */
.notifications-dropdown {
    position: absolute;
    top: var(--jarvis-main-nav-height);
    right: 0;
    width: 320px;
    max-height: 400px;
    background: #2d3748;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 2001;
    overflow: hidden;
}

.notifications-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notifications-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: #1e2a3a;
}

.notifications-dropdown-header h3 {
    margin: 0;
    color: #e2e8f0;
    font-size: 0.938rem;
    font-weight: 600;
}

.close-dropdown {
    background: none;
    border: none;
    color: #cbd5e0;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.close-dropdown:hover {
    color: white;
}

.notifications-dropdown-list {
    max-height: 350px;
    overflow-y: auto;
}

.notification-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease;
}

.notification-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.notification-dropdown-item .notification-icon {
    font-size: 1.2rem;
}

.notification-dropdown-item .notification-text {
    color: #cbd5e0;
    font-size: 0.813rem;
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
}

/* Scrollbar do dropdown */
.notifications-dropdown-list::-webkit-scrollbar {
    width: 6px;
}

.notifications-dropdown-list::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 3px;
}

/* Compensar chrome fixo (status-bar + menu). !important evita páginas que zeram padding no body. */
body {
    padding-top: var(--jarvis-chrome-top) !important;
}

/* ==================== RESPONSIVO ==================== */
@media (max-width: 768px) {
    :root {
        --jarvis-main-nav-height: 35px;
    }

    .main-nav {
        font-size: 0.75rem;
    }
    
    /* Navegação ocupa 85% em mobile */
    .nav-content {
        width: 85%;
        padding: 0 10px;
    }
    
    .main-nav-link {
        padding: 8px 10px;
        height: var(--jarvis-main-nav-height);
        gap: 3px;
    }
    
    .main-nav-icon {
        font-size: 0.9rem;
    }
    
    .main-nav-submenu {
        min-width: 160px;
    }
    
    .main-nav-submenu-link {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    
    /* Área de notificações reduzida a 15% */
    .notifications-area {
        width: 15%;
        background: transparent;
        border-left: none;
    }
    
    /* Esconder carrossel em mobile */
    .notifications-carousel {
        display: none;
    }
    
    .carousel-indicators {
        display: none;
    }
    
    /* Mostrar ícone mobile */
    .notifications-mobile {
        display: flex;
        width: 100%;
        justify-content: center;
        align-items: center;
        position: relative;
        z-index: 2001;
    }
    
    .notifications-bell {
        font-size: 1.1rem;
        padding: 3px 8px;
    }
    
    .notifications-badge {
        font-size: 0.6rem;
        padding: 1px 4px;
        top: -1px;
        right: 0;
    }
    
    /* Dropdown full width em mobile muito pequeno */
    .notifications-dropdown {
        width: 100vw;
        right: -10px;
        max-height: 350px;
    }
}

/* Mobile muito pequeno */
@media (max-width: 480px) {
    .main-nav-link span:not(.main-nav-icon) {
        display: none;
    }
    
    .main-nav-link {
        padding: 8px;
    }
    
    .has-submenu > .main-nav-link::after {
        display: none;
    }
    
    .notifications-dropdown {
        width: 100vw;
        left: 0;
        right: 0;
        border-radius: 0 0 8px 8px;
    }
}
