/* Classe principal reutilizável */
.btn-star-glow {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
    z-index: 1;
}

/* Brilho pulsante azul */
.btn-star-glow {
    animation: blue-pulse 2s infinite;
}

@keyframes blue-pulse {
    0% { box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(13, 110, 253, 0); }
    100% { box-shadow: 0 0 0 0 rgba(13, 110, 253, 0); }
}

/* Efeito de Estrelinhas (Partículas) */
.btn-star-glow::after {
    content: "✦";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #0d6efd;
    font-size: 10px;
    opacity: 0;
    pointer-events: none;
    text-shadow:
            15px -20px #70a1ff,
            -25px 15px #1e90ff,
            20px 25px #00d2ff,
            -15px -15px #3742fa;
    animation: star-float 3s infinite linear;
}

@keyframes star-float {
    0% { transform: rotate(0deg) scale(0.5); opacity: 0; }
    50% { opacity: 0.8; }
    100% { transform: rotate(360deg) scale(1.2); opacity: 0; }
}

/* --- EFEITO AO PASSAR O MOUSE (HOVER) --- */
.btn-star-glow:hover {
    transform: scale(1.05) translateY(-2px);
    background-color: #0d6efd !important; /* Inverte a cor */
    color: white !important;
    letter-spacing: 1px;
}

.btn-star-glow:hover i {
    animation: spin 0.8s ease-in-out;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

#ib-toast-container .toast {
    min-width: 280px;
    max-width: 420px;
}

.ib-toast-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.ib-toast-body {
    font-size: 0.9rem;
}

.ib-btn-action {
    min-width: 100px;
}

/* small visual tweak so success uses green and info blue consistently */
.toast-info {
    border-left: 4px solid #0d6efd;
}

.toast-success {
    border-left: 4px solid #198754;
}

.toast-warning {
    border-left: 4px solid #ffc107;
}

.toast-danger {
    border-left: 4px solid #dc3545;
}

.btn-info-modal {
    transition: color 0.2s ease-in-out, transform 0.1s ease;
}

.btn-info-modal:hover {
    color: #6c757d !important; /* Cinza mais escuro */
    transform: scale(1.1);
}

#editBairroModal .input-group {
    flex-direction: column-reverse;
}

#editBairroModal .input-group > .form-control {
    width: 100%;
    height: 24vh;

}

:root {
    --ib-blue: #0d6efd;
    --ib-green: #2dbf73;
    --ib-bg-light: #f8f9fa;
    --card-radius: 1rem;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    --hover-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    background-color: #fcfcfc;
}

/* Cards Gerais */
.card-ib {
    background: #fff;
    border: none;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

/* Header Section */
.bairro-hero {
    /* Gradiente com 3 paradas para garantir um loop contínuo e suave */
    background: linear-gradient(135deg,
    rgba(13, 110, 253, 0.28) 0%,
    rgba(45, 191, 115, 0.08) 50%,
    rgba(13, 110, 253, 0.08) 100%
    );
    /* Aumentar o tamanho do fundo é o truque para animar o gradiente */
    background-size: 200% 200%;
    border-radius: var(--card-radius);
    padding: 1.5rem 2rem;
    position: relative;
    overflow: hidden;

    /* Animação durando 12s para ser BEM suave */
    animation: moverGradiente 12s ease infinite;
}

.bairro-hero::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: var(--ib-green);
    opacity: 0.05;
    border-radius: 50%;

    /* Animação de flutuação para o círculo */
    animation: flutuarSutil 8s ease-in-out infinite;
}

/* (Opcional) Adiciona uma segunda bolha azul no canto oposto para dar um ar mais dinâmico */
.bairro-hero::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: -20px;
    width: 100px;
    height: 100px;
    background: rgba(13, 110, 253, 0.1); /* Azul da sua paleta */
    border-radius: 50%;

    /* Flutua no tempo inverso para não ficar sincronizado com o outro */
    animation: flutuarSutil 10s ease-in-out infinite reverse;
}

.bairro-heroR {
    /* Gradiente com 3 paradas para garantir um loop contínuo e suave */
    background: linear-gradient(135deg,
    rgba(214, 48, 49, 0.28) 0%,
    rgba(77, 82, 79, 0.08) 50%,
    rgba(214, 48, 49, 0.08) 100%
    );
    /* Aumentar o tamanho do fundo é o truque para animar o gradiente */
    background-size: 200% 200%;
    border-radius: var(--card-radius);
    padding: 1.5rem 2rem;
    position: relative;
    overflow: hidden;

    /* Animação durando 12s para ser BEM suave */
    animation: moverGradiente 12s ease infinite;
}

.bairro-heroR::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: rgb(0, 0, 0);
    opacity: 0.05;
    border-radius: 50%;

    /* Animação de flutuação para o círculo */
    animation: flutuarSutil 8s ease-in-out infinite;
}

/* (Opcional) Adiciona uma segunda bolha azul no canto oposto para dar um ar mais dinâmico */
.bairro-heroR::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: -20px;
    width: 100px;
    height: 100px;
    background: rgba(214, 48, 49, 0.1); /* Azul da sua paleta */
    border-radius: 50%;

    /* Flutua no tempo inverso para não ficar sincronizado com o outro */
    animation: flutuarSutil 10s ease-in-out infinite reverse;
}

/* --- KEYFRAMES DAS ANIMAÇÕES --- */

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

@keyframes flutuarSutil {
    0% {
        transform: translate(0px, 0px) scale(1);
    }
    50% {
        /* Move levemente para a diagonal e expande muito pouco */
        transform: translate(-15px, 15px) scale(1.05);
    }
    100% {
        transform: translate(0px, 0px) scale(1);
    }
}

/* Badges */
.badge-ib {
    background-color: var(--ib-green);
    color: white;
    padding: 0.5em 0.8em;
    border-radius: 50rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.badge-ic {
    background-color: var(--ib-blue);
    color: white;
    padding: 0.5em 0.8em;
    border-radius: 50rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Score Card */
.score-display {
    text-align: center;
    padding-top: 1.5rem;
}

.score-number {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(45deg, var(--ib-blue), var(--ib-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

/* Grid de Avaliações */
.rating-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.rating-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.03);
    border-radius: 0.8rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.rating-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
    border-color: rgba(13, 110, 253, 0.2);
}

.rating-card .title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #495057;
    margin-bottom: 0.25rem;
}

.rating-card .stars i {
    font-size: 0.85rem;
    color: #ffc107;
}

.progress-track {
    height: 6px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 0.75rem;
}

.progress-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--ib-blue), var(--ib-green));
}

/* Offcanvas & Comentários */
.offcanvas-header-custom {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
}

.comentario-card {
    border: 1px solid #f0f0f0;
    border-radius: 0.8rem;
    background: #fff;
    transition: background 0.2s;
}

.comentario-card:hover {
    background: #fdfdfd;
}

/* Indicador visual lateral sutil em vez de borda grossa */
.indicator-strip {
    width: 4px;
    border-radius: 4px;
    margin-right: 10px;
}

.btn-light {
    transition: 0.5s;
}

.btn-light:hover {
    transform: translateX(-5px);
    transition: 0.5s;
}

.btn-action-group .btn {
    border-radius: 0.6rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
}

.container-fluid {
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.badge-danger-ib {
    background: linear-gradient(135deg, rgb(207, 36, 35), rgb(214, 48, 49)) !important;
    color: #fff;
}

/* ==========================================
   Melhorias Visuais e Animações
   ========================================== */

/* Nota Geral com Gradiente */
.score-number-modern {
    font-size: 4.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: 0.5rem;
}
.score-number-modern-null {
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
    --bs-text-opacity: 1;
    color: rgba(var(--bs-secondary-rgb), var(--bs-text-opacity)) !important;
}

/* Fundo Animado Sutil para o Hall de Ratings */
.bg-animated-subtle {
    background: linear-gradient(-45deg, #f8f9fa, #e3f2fd, #f1f8ff, #ffffff);
    background-size: 400% 400%;
    animation: gradientMove 15s ease infinite;
    border-radius: 1rem; /* Arredondamento suave */
}

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

/* Grid dos Cards de Avaliação */
.rating-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

/* Cards de Avaliação (Efeito Glassmorphism) */
.rating-card-glass {
    background: rgba(255, 255, 255, 0.65); /* Branco translúcido */
    backdrop-filter: blur(12px); /* Desfoque do fundo */
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.8); /* Borda branca suave */
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.rating-card-glass:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    border-color: rgba(13, 110, 253, 0.2);
}

/* Barra de Progresso Customizada */
.progress-track {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 50px;
    height: 6px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #0d6efd, #0dcaf0);
    height: 100%;
    border-radius: 50px;
    transition: width 1s ease-in-out;
}

/* Melhoria no Card de Confiança */
.card-avaliacao-hover .card {
    transition: all 0.3s ease;
    cursor: pointer;
    background-color: #fff;
    border-radius: 12px;
}

.card-avaliacao-hover:hover .card {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08) !important;
    background-color: #f8f9fa;
}

/* Texto expansível (mantido e isolado) */
.expandable-container {
    position: relative;
    max-width: 100%;
}

.content-wrapper {
    position: relative;
    overflow: hidden;
    max-height: 4.8em;
    transition: max-height 0.5s ease-in-out;
}

.content-wrapper.expanded {
    overflow: auto;
    max-height: 35vh;
    scrollbar-color: #4586e987 transparent;
    scrollbar-width: thin;
}

.text-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(transparent, white);
    transition: opacity 0.3s;
    pointer-events: none;
}

.content-wrapper.expanded .text-fade {
    opacity: 0;
}

.read-more-btn {
    font-weight: 600;
    text-decoration: none !important;
    outline: none;
}

/* Estilo base da estrela (NÃO MARCADA = CINZA) */
.star-icon-custom {
    font-size: 2.5rem; /* Grande no Desktop */
    color: #d1d5db !important; /* Cinza claro forçado */
    cursor: pointer;
    transition: transform 0.1s, color 0.2s;
    padding: 0 5px; /* Espaço para facilitar o toque */
}

/* Mobile: Estrelas GIGANTES */
@media (max-width: 768px) {
    /* Empilhar os itens no mobile para dar espaço */
    .rating-row-mobile {
        flex-direction: column;
        align-items: center;
    }
}

/* Estrela Ativa (Amarela) */
.star-icon-custom.active,
.star-icon-custom.hover {
    color: #ffc107 !important; /* Amarelo Bootstrap */
    filter: drop-shadow(0 0 5px rgba(255, 193, 7, 0.5));
}

/* Efeito de clique */
.star-icon-custom:active {
    transform: scale(0.8);
}

/* Card de cada critério */
.criteria-card {
    background-color: #f8f9fa;
    border-radius: 15px;
    margin-bottom: 15px;
    padding: 15px;
    border: 1px solid #eee;
}

.indicator-strip {
    width: 6px; /* Largura da barra colorida */
    min-height: 100%;
    border-radius: 4px 0 0 4px;
    flex-shrink: 0;
}

.comentario-card {
    overflow: hidden; /* Garante que a barra respeite as bordas arredondadas */
}

/* Animaçãozinha de Like */
.btn-like i {
    transition: transform 0.2s;
}

.btn-like:active i {
    transform: scale(1.3);
}
