/* ===========================================
   PillNav - Pill-shaped Navigation Styles
   Red Theme (#E63946)
   =========================================== */

.pill-nav-container {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

.pill-nav {
    --base: #0A0A0A;
    --pill-bg: #E63946;
    --hover-text: #FFFFFF;
    --pill-text: #FFFFFF;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 16px 24px;
    background: var(--base);
    border-bottom: 1px solid rgba(230, 57, 70, 0.1);
}

/* Logo Styles */
.pill-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 50%;
    cursor: pointer;
}

.pill-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    user-select: none;
    pointer-events: none;
}

/* Desktop Navigation */
.pill-nav-items.desktop-only {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pill-list {
    display: flex;
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Pill Button Styles */
.pill {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 20px;
    color: var(--pill-text);
    background: none;
    border: 2px solid var(--pill-bg);
    border-radius: 100px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    overflow: visible;
}

.pill.is-active {
    background: var(--pill-bg);
    color: var(--pill-text);
}

.pill.is-active .pill-label {
    color: var(--pill-text);
}

.pill.is-active .pill-label-hover {
    color: var(--pill-text);
}

/* Hover Circle (animated background) */
.hover-circle {
    position: absolute;
    bottom: -12px;
    left: 50%;
    background: var(--pill-bg);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}

/* Label Stack for text animation */
.label-stack {
    position: relative;
    display: inline-block;
    overflow: visible;
    height: auto;
}

.pill-label {
    position: relative;
    display: block;
    color: var(--pill-text);
    user-select: none;
}

/* Mobile Menu Button */
.mobile-menu-button {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.hamburger-line {
    width: 24px;
    height: 2px;
    background: var(--pill-bg);
    border-radius: 2px;
}

/* Mobile Menu Popover */
.mobile-menu-popover {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--base);
    border-bottom: 1px solid rgba(230, 57, 70, 0.1);
    visibility: hidden;
    opacity: 0;
    z-index: 999;
}

.mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 12px 16px;
    display: flex;
    /* Correção: direction deve ser 'row' para horizontal */
    flex-direction: row; 
    /* O "segredo" para centrar os botões */
    justify-content: center; 
    /* Permite que os botões saltem de linha se o ecrã for muito pequeno */
    flex-wrap: wrap; 
    gap: 8px;
}

.mobile-menu-list {
    list-style: none;
    margin: 0 auto !important; /* Centra o container em si */
    padding: 12px 0 !important;
    display: flex !important;
    flex-direction: row !important; /* Mantém horizontal */
    justify-content: center !important; /* CENTRA OS FILHOS */
    align-items: center !important;
    flex-wrap: wrap !important; /* Se não couberem, saltam mas continuam centrados */
    gap: 12px;
    width: 100% !important; /* Força ocupar a largura toda para o centro ser real */
}

.mobile-menu-link.is-active {
    background: var(--pill-bg);
    color: var(--base);
    border-color: var(--pill-bg);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: flex !important;
    }

    .mobile-menu-button {
        display: flex;
    }

    .pill-nav {
        gap: 16px;
    }

    .pill-logo {
        width: 56px;
        height: 56px;
    }

    .mobile-menu-popover {
        max-height: 300px;
        overflow-y: auto;
    }
}

.mobile-menu-link {
    display: inline-flex !important; /* Melhor que inline-block para alinhar texto */
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    color: var(--pill-text);
    text-decoration: none;
    border-radius: 50px; /* Estilo arredondado (pill) */
    border: 2px solid rgb(255, 0, 21);
    text-align: center;
    white-space: nowrap;
    font-size: 14px;
    min-width: 80px; /* Garante que não ficam muito pequenos */
}

/* Ensure mobile-only is hidden on desktop */
.mobile-only {
    display: none;
}

/* Animation for active indicator (optional) */
@keyframes pulse-border {
    0%, 100% {
        border-color: var(--pill-bg);
    }
    50% {
        border-color: rgba(230, 57, 70, 0.5);
    }
}
