/* Estilos profissionais para os stories */
.stories {
    display: flex;
    gap: 1rem;
    padding: 1.5rem 0;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scroll-snap-type: x mandatory;
    max-width: 100%;
    margin: 0 auto;
    justify-content: center; /* Centralizado no desktop */
}

.stories::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.story {
    flex: 0 0 auto;
    width: 85px;
    text-align: center;
    cursor: pointer;
    position: relative;
    scroll-snap-align: center;
    transition: all 0.3s ease;
}

.story:hover {
    transform: translateY(-3px);
}

.story-avatar {
    width: 59px;
    height: 59px;
    border-radius: 50%;
    margin: 0 auto 0.2rem;
    overflow: initial;
    position: relative;
}

/* Borda dupla profissional */
.story-avatar::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    background: linear-gradient(180deg, #ffde00, #00e1ff);
    z-index: -1;
    opacity: 0.9;
}

/* Borda interna */
.story-avatar::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    z-index: -1;
}

/* Efeito de brilho na borda ao passar o mouse */
.story:hover .story-avatar::before {
    background: linear-gradient(45deg, #FF9D4D, #8EE1D1, #FF9D4D);
    background-size: 200% 200%;
    animation: gradient-shift 2s ease infinite;
    box-shadow: 0 0 20px rgba(142, 225, 209, 0.7);
}

/* Efeito de brilho na borda interna ao passar o mouse */
.story:hover .story-avatar::after {
    background: linear-gradient(135deg, #5a8f6e, #3F6F50);
    animation: pulse 2s infinite;
}

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

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.story-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid white;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 0;
}

.story:hover .story-avatar img {
    transform: scale(1.05);
}

.story-name {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 85px;
    margin: 0 auto;
    transition: color 0.3s ease;
    letter-spacing: -0.2px;
}

.story:hover .story-name {
    color: var(--color-green);
}

/* Indicador de story não visualizado */
.story::after {
    content: '';
    position: absolute;
    bottom: 23px;
    right: 12px;
    width: 8px;
    height: 8px;
    background-color: #ff790e;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    opacity: 0.9;
}

/* Melhorias para o modal de stories */
.story-modal-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    color: white;
    background: linear-gradient(to right, var(--color-green-dark), var(--color-green));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.story-modal-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    margin-right: 1rem;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.story-modal-title {
    flex: 1;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.3px;
}

.story-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.story-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Ajustes responsivos */
@media (max-width: 767px) {
    .stories {
        padding: 1.5rem 0;
        gap: 1rem;
        justify-content: left; /* Alinhado à esquerda no mobile */
    }
    
    .story {
        width: 80px;
    }
    
    .story-avatar {
        width: 70px;
        height: 70px;
    }
    
    .story-name {
        font-size: 0.75rem;
        max-width: 80px;
    }
    
    .story::after {
        bottom: 23px;
        right: 13px;
        width: 7px;
        height: 7px;
    }
}
