/* ================================================================
   BOTÃO FLUTUANTE GLOBAL (FAB)
   Menu de atalhos rápidos — presente em todas as páginas
   ================================================================ */

/* ----------------------------------------------------------------
   CONTAINER PRINCIPAL
---------------------------------------------------------------- */
.fab-global {
    position: fixed;
    bottom: max(20px, calc(env(safe-area-inset-bottom, 0px) + 20px));
    right: 20px;
    z-index: 950;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 12px;
    pointer-events: none;
    -webkit-tap-highlight-color: transparent;
}

/* ----------------------------------------------------------------
   BOTÃO PRINCIPAL (FAB)
---------------------------------------------------------------- */
.fab-principal {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--vermelho), var(--vermelho-escuro));
    /*color: #FFFFFF;*/
    color: #D4AF37;
    border: 3px solid rgba(255, 255, 255, 0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    /*box-shadow: 0 10px 35px rgba(196, 30, 58, 0.5);*/
    box-shadow: 0 10px 35px rgba(243, 209, 45, 1);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease,
                background 0.3s ease;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 2;
}

.fab-principal:hover {
    transform: scale(1.08);
    box-shadow: 0 14px 45px rgba(196, 30, 58, 0.7);
}

.fab-principal:active {
    transform: scale(0.96);
}

/* Rotação do ícone quando aberto */
.fab-global.aberto .fab-principal {
    transform: rotate(135deg);
    background: linear-gradient(135deg, #333333, #1a1a1a);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.5);
}

.fab-principal i {
    transition: transform 0.4s ease;
}

/* Pulse sutil quando fechado (chamar atenção) */
.fab-global:not(.aberto) .fab-principal::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    /*border: 2px solid rgba(196, 30, 58, 0.5);*/
    border: 2px solid rgba(243, 209, 45, 1);
    animation: fabPulse 2.5s ease-out infinite;
    pointer-events: none;
}

@keyframes fabPulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* ----------------------------------------------------------------
   MENU DE OPÇÕES (RADIAL)
---------------------------------------------------------------- */
.fab-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
    pointer-events: none;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
}

.fab-global.aberto .fab-menu {
    max-height: 500px;
    opacity: 1;
    pointer-events: auto;
    padding-bottom: 5px;
}

/* ----------------------------------------------------------------
   ITEM DO MENU
---------------------------------------------------------------- */
.fab-item {
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(20px) scale(0.8);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.3s ease;
    pointer-events: auto;
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: 'Lato', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.fab-global.aberto .fab-item {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Delays em cascata (stagger) */
.fab-global.aberto .fab-item:nth-child(1) { transition-delay: 0.05s; }
.fab-global.aberto .fab-item:nth-child(2) { transition-delay: 0.1s; }
.fab-global.aberto .fab-item:nth-child(3) { transition-delay: 0.15s; }
.fab-global.aberto .fab-item:nth-child(4) { transition-delay: 0.2s; }
.fab-global.aberto .fab-item:nth-child(5) { transition-delay: 0.25s; }
.fab-global.aberto .fab-item:nth-child(6) { transition-delay: 0.3s; }

/* Rótulo (label) */
.fab-label {
    /*background: rgba(26, 26, 26, 0.95);*/
   /* color: #FFFFFF;*/
   background: rgba(139, 0, 0, 0.95);   /* Fundo vinho */
    color: #FFD700;                      /* Texto dourado */
    font-size: 0.82rem;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 50px;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    /*border: 1px solid rgba(255, 255, 255, 0.1);*/
    border: 1px solid rgba(255, 215, 0, 0.3);
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

.fab-item:hover .fab-label {
    background: rgba(196, 30, 58, 0.95); /* Vermelho intenso */
    transform: translateX(-4px);
}

/* Botão circular do item */
.fab-botao {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--vermelho-escuro), #5a0000);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    border: 2px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.fab-item:hover .fab-botao,
.fab-item:active .fab-botao {
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(196, 30, 58, 0.5);
}

/* ----------------------------------------------------------------
   VARIAÇÕES DE COR POR TIPO
---------------------------------------------------------------- */

/* Enviar foto (destaque máximo) */
.fab-item[data-acao="enviar"] .fab-botao {
    background: linear-gradient(135deg, var(--dourado), var(--dourado-claro));
    color: var(--vermelho-escuro);
    animation: fabEnviarPulse 2s ease-in-out infinite;
}

@keyframes fabEnviarPulse {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
    }
    50% {
        box-shadow: 0 10px 30px rgba(212, 175, 55, 0.9);
    }
}

/* Galeria */
.fab-item[data-acao="galeria"] .fab-botao {
    background: linear-gradient(135deg, var(--vermelho), var(--vermelho-claro));
}

/* Ranking */
.fab-item[data-acao="ranking"] .fab-botao {
    background: linear-gradient(135deg, #FFD700, #D4AF37);
    color: #333;
}

/* Mural */
.fab-item[data-acao="recados"] .fab-botao {
    background: linear-gradient(135deg, #6A1B9A, #4A148C);
}

/* Presentes */
.fab-item[data-acao="presentes"] .fab-botao {
    background: linear-gradient(135deg, #2E7D32, #1B5E20);
}

/* Topo */
.fab-item[data-acao="topo"] .fab-botao {
    background: linear-gradient(135deg, #546E7A, #37474F);
}

/* ----------------------------------------------------------------
   AÇÃO ATIVA (página atual)
---------------------------------------------------------------- */
.fab-item.ativo .fab-label {
    background: rgba(196, 30, 58, 0.95);
    color: #FFFFFF;
    font-weight: 700;
}

.fab-item.ativo .fab-label::before {
    content: '● ';
    color: #FFD700;
    font-size: 0.7rem;
    margin-right: 2px;
}

/* ----------------------------------------------------------------
   TOOLTIP DE BOAS-VINDAS (primeira vez)
---------------------------------------------------------------- */
.fab-tooltip {
    position: absolute;
    bottom: 75px;
    right: 0;
    background: linear-gradient(135deg, var(--vermelho-escuro), #5a0000);
    color: #FFFFFF;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    animation: fabTooltipEntrada 0.5s ease 2s both;
    pointer-events: none;
    z-index: 3;
}

.fab-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 24px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #5a0000;
}

.fab-tooltip.fechado {
    display: none;
}

@keyframes fabTooltipEntrada {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ----------------------------------------------------------------
   MODO EVENTO — DESTAQUE ESPECIAL
---------------------------------------------------------------- */
body.modo-evento .fab-global:not(.aberto) .fab-principal::before {
    border-color: #FFD700;
    animation-duration: 1.5s;
}

body.modo-evento .fab-principal {
    background: linear-gradient(135deg, #FFD700, #D4AF37);
    color: var(--vermelho-escuro);
    box-shadow: 0 12px 40px rgba(255, 215, 0, 0.7);
    width: 70px;
    height: 70px;
    font-size: 1.7rem;
    border-color: #FFFFFF;
}

body.modo-evento .fab-global.aberto .fab-principal {
    background: linear-gradient(135deg, #333333, #1a1a1a);
    color: #FFFFFF;
}

body.modo-evento .fab-item[data-acao="enviar"] .fab-botao {
    animation: fabEnviarPulseEvento 1.2s ease-in-out infinite;
}

@keyframes fabEnviarPulseEvento {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 6px 20px rgba(212, 175, 55, 0.7);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 12px 35px rgba(212, 175, 55, 1);
    }
}

/* ----------------------------------------------------------------
   RESPONSIVIDADE
---------------------------------------------------------------- */
@media (max-width: 480px) {
    .fab-global {
        bottom: max(15px, calc(env(safe-area-inset-bottom, 0px) + 15px));
        right: 15px;
        gap: 8px;
    }

    .fab-principal {
        width: 58px;
        height: 58px;
        font-size: 1.3rem;
    }

    .fab-botao {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }

    .fab-label {
        font-size: 0.75rem;
        padding: 6px 12px;
    }

    body.modo-evento .fab-principal {
        width: 62px;
        height: 62px;
        font-size: 1.5rem;
    }
}

/* ----------------------------------------------------------------
   ACESSIBILIDADE
---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .fab-global,
    .fab-principal,
    .fab-menu,
    .fab-item,
    .fab-botao,
    .fab-label {
        animation: none !important;
        transition: none !important;
    }

    .fab-global.aberto .fab-menu {
        max-height: 500px;
        opacity: 1;
    }

    .fab-global.aberto .fab-item {
        transform: none;
        opacity: 1;
    }
}

/* Foco visível para teclado */
.fab-principal:focus-visible,
.fab-item:focus-visible {
    outline: 3px solid #FFD700;
    outline-offset: 2px;
}