/**
 * resultados.css
 * Estilos específicos para a visualização dos resultados da Votação Popular.
 */

/* Hero Banner dos Resultados */
.hero-resultados {
    background: linear-gradient(rgba(138, 21, 56, 0.85), rgba(0, 0, 0, 0.7)), url('fundo-horizontal-2.jpg');
    background-size: cover;
    background-position: center;
    color: var(--white);
    padding: 5rem 2rem;
    text-align: center;
    border-bottom: 8px solid var(--primary-color);
}

.hero-resultados-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-resultados h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    font-family: var(--font-heading);
}

/* Caixa de Estatísticas Gerais */
.stats-overview-section {
    padding: 2rem 2rem 0;
    max-width: 1200px;
    margin: 0 auto;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: var(--white);
    padding: 1.8rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    text-align: center;
    border-top: 4px solid var(--primary-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-color);
    font-family: var(--font-heading);
}

/* Container de Resultados */
.results-list-section {
    padding: 2rem 2rem 4rem;
    max-width: 1000px;
    margin: 0 auto;
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

/* Card de Linha de Ranking */
.ranking-row-card {
    display: flex;
    align-items: center;
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.2rem 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid #eaeaea;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}

.ranking-row-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
    border-color: rgba(138, 21, 56, 0.2);
}

/* Elemento de Colocação (Medalhas/Números) */
.rank-badge {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    background-color: var(--off-white);
    border: 3px solid #ddd;
    flex-shrink: 0;
    font-family: var(--font-heading);
}

/* Medalhas Especiais do Top 3 */
.ranking-row-card.rank-1 {
    border-left: 6px solid #ffd700;
    background: linear-gradient(90deg, #fffcf0 0%, #ffffff 100%);
}
.ranking-row-card.rank-1 .rank-badge {
    background-color: #ffd700;
    border-color: #ffd700;
    color: #fff;
    font-size: 1.8rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.3);
}

.ranking-row-card.rank-2 {
    border-left: 6px solid #c0c0c0;
    background: linear-gradient(90deg, #f7f7f7 0%, #ffffff 100%);
}
.ranking-row-card.rank-2 .rank-badge {
    background-color: #c0c0c0;
    border-color: #c0c0c0;
    color: #fff;
    font-size: 1.6rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.ranking-row-card.rank-3 {
    border-left: 6px solid #cd7f32;
    background: linear-gradient(90deg, #faf3ec 0%, #ffffff 100%);
}
.ranking-row-card.rank-3 .rank-badge {
    background-color: #cd7f32;
    border-color: #cd7f32;
    color: #fff;
    font-size: 1.6rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* Miniatura da Obra */
.rank-img-container {
    width: 70px;
    height: 105px; /* Proporção 2:3 */
    border-radius: 4px;
    overflow: hidden;
    cursor: zoom-in;
    position: relative;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
    border: 2px solid #eaeaea;
}

.rank-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.rank-img-container:hover .rank-img {
    transform: scale(1.1);
}

/* Detalhes da Turma e Escola */
.rank-meta {
    flex: 2;
    min-width: 180px;
}

.rank-turma {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--primary-color);
    margin: 0 0 0.3rem 0;
    font-weight: bold;
}

.rank-escola {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
}

/* Gráfico de Barras / Progresso de Votos */
.rank-chart-box {
    flex: 3;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 220px;
}

.progress-bar-bg {
    width: 100%;
    height: 14px;
    background-color: var(--off-white);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-light), var(--primary-color));
    border-radius: 10px;
    width: 0%; /* Animado via JS */
    transition: width 1s cubic-bezier(0.1, 0.8, 0.2, 1);
}

/* Efeito de cores específicas para as barras líderes */
.rank-1 .progress-bar-fill {
    background: linear-gradient(90deg, #ffd700, var(--primary-color));
}

.vote-ratio-text {
    font-size: 0.8rem;
    color: var(--text-light);
    text-align: right;
}

/* Contagem Numérica de Votos */
.rank-count-box {
    text-align: right;
    min-width: 100px;
    flex-shrink: 0;
}

.vote-number {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-dark);
    font-family: var(--font-heading);
    display: block;
}

.vote-label {
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
}

/* Mobile Responsividade */
@media screen and (max-width: 768px) {
    .ranking-row-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.5rem;
    }
    
    .rank-badge {
        margin-bottom: 0.5rem;
    }
    
    .rank-chart-box {
        width: 100%;
        min-width: 100%;
    }
    
    .rank-count-box {
        text-align: center;
        margin-top: 0.5rem;
    }
}

/* ==========================================================================
   Filtros de Categorias, Campo de Pesquisa e Notificações
   ========================================================================== */
.category-filters-section {
    background: var(--white);
    padding: 1rem 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 77px;
    z-index: 90;
    border-bottom: 2px solid rgba(138, 21, 56, 0.08);
    border-top: 1px solid #f0f0f0;
    text-align: center;
    width: 100%;
    margin: 0 auto;
}

.filters-container {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.btn-filter {
    background: var(--white);
    color: var(--text-dark);
    border: 2px solid rgba(138, 21, 56, 0.15);
    padding: 0.8rem 1.6rem;
    border-radius: 30px;
    font-weight: 600;
    font-family: var(--font-heading);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-size: 0.95rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.btn-filter:hover {
    background: var(--secondary-color);
    border-color: var(--primary-light);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(138, 21, 56, 0.15);
}

.btn-filter.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--white);
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(138, 21, 56, 0.3);
    transform: scale(1.05) translateY(-1px);
    font-weight: 700;
}

.search-controls-container {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    width: 100%;
}

.search-box {
    width: 100%;
    max-width: 500px;
}

#search-input {
    width: 100%;
    padding: 0.9rem 1.5rem;
    border: 2px solid rgba(138, 21, 56, 0.15);
    border-radius: 50px;
    font-size: 0.95rem;
    font-family: var(--font-body);
    transition: all 0.3s ease;
    background-color: var(--white);
    color: var(--text-dark);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

#search-input:focus {
    outline: none;
    box-shadow: 0 4px 15px rgba(138, 21, 56, 0.12);
    border-color: var(--primary-color);
}

#search-input::placeholder {
    color: #999;
}

.apae-warning {
    margin-top: 1.5rem;
    padding: 1.2rem;
    background-color: #fffaf0;
    color: #856404;
    border-left: 5px solid #ffc107;
    border-radius: var(--radius);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    box-shadow: var(--shadow-sm);
    font-size: 0.95rem;
    line-height: 1.5;
}

.apae-warning.hidden {
    display: none;
}

/* Responsividade adicional para os filtros */
@media screen and (max-width: 768px) {
    .category-filters-section {
        padding: 1rem 0.5rem;
        margin: 0;
    }
    
    .filters-container {
        gap: 0.5rem;
    }
    
    .btn-filter {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
        flex-grow: 1;
        text-align: center;
    }
    
    #search-input {
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* ==========================================================================
   Lightbox Modal (Zoom de Imagens)
   ========================================================================== */
.lightbox {
    display: none; /* Escondido por padrão */
    position: fixed;
    z-index: 1000; /* Acima de tudo */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(8px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.lightbox-gallery-container {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90%;
    max-height: 80vh;
    position: relative;
    width: 100%;
}

.lightbox-media-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    max-height: 80vh;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 3px solid var(--white);
    animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox-caption {
    margin: 1.5rem auto 0;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #eee;
    font-size: 1.1rem;
    font-family: var(--font-body);
    line-height: 1.6;
}

.lightbox-caption strong {
    color: var(--white);
    font-size: 1.25rem;
}

.lightbox-close {
    position: absolute;
    top: 25px;
    right: 35px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 45px;
    font-weight: 300;
    transition: all 0.2s ease;
    cursor: pointer;
    line-height: 1;
    z-index: 1010;
}

.lightbox-close:hover {
    color: var(--white);
    transform: scale(1.1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Conteúdo Restrito e Efeito de Blur */
.restricted-content {
    transition: filter 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.restricted-content.blurred-content {
    filter: blur(15px);
    pointer-events: none;
    user-select: none;
}

/* Modal de Login dos Resultados (Glassmorphism Premium) */
.resultados-login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    animation: fadeInModal 0.4s ease;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.resultados-login-modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.resultados-login-content {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 3rem 2.5rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
    position: relative;
    animation: scaleUpModal 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.login-logo {
    max-width: 130px;
    width: 100%;
    height: auto;
    margin: 0 auto 1.5rem;
    display: block;
}

.resultados-login-content.shake {
    animation: shakeModal 0.4s ease;
}

.resultados-login-content h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
}

.resultados-login-content p {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.form-group-login {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group-login label {
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group-login input {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 2px solid #ddd;
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: var(--font-body);
    transition: all 0.3s ease;
    background-color: var(--white);
    color: var(--text-dark);
}

.form-group-login input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(138, 21, 56, 0.15);
}

.login-error {
    color: #dc3545;
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    min-height: 18px;
}

/* Animações */
@keyframes shakeModal {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleUpModal {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Responsividade */
@media screen and (max-width: 768px) {
    .resultados-login-content {
        padding: 2rem 1.5rem;
    }
    
    .resultados-login-content h2 {
        font-size: 1.5rem;
    }
}
