/**
 * votacao.css
 * Estilos específicos para a página de Votação Popular.
 * Reaproveita as variáveis de style.css
 */

/* Hero Banner da Votação */
.hero-votacao {
    background: linear-gradient(rgba(138, 21, 56, 0.8), rgba(0, 0, 0, 0.6)), url('fundo-horizontal-2.jpg');
    background-size: cover;
    background-position: center;
    color: var(--white);
    padding: 6rem 2rem;
    text-align: center;
    position: relative;
    border-bottom: 8px solid var(--primary-color);
}

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

.hero-votacao 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);
}

.hero-theme-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: #ffc107;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
    text-transform: none;
    letter-spacing: 0.5px;
}

.subtitle-hero {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-top: 1rem;
}

/* Identidade Visual no Hero */
.hero-votacao .hero-images {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.hero-votacao .hero-title-img {
    max-width: 90%;
    width: 380px;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.hero-votacao .hero-theme-img {
    max-width: 90%;
    width: 380px;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}


/* Filtros por Categoria */
.category-filters-section {
    padding: 2rem;
    background-color: var(--white);
    text-align: center;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 77px; /* Below the header nav */
    z-index: 90;
}

.filters-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-filter {
    background: var(--off-white);
    color: var(--text-dark);
    border: 2px solid var(--primary-light);
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-filter:hover {
    background: var(--secondary-color);
}

.btn-filter.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.apae-warning {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #fff3cd;
    color: #856404;
    border-left: 5px solid #ffeeba;
    border-radius: 4px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

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

/* Controles de Pesquisa e Filtro Extra */
.search-controls-container {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.search-box, .select-box {
    flex: 1;
    min-width: 250px;
}

#search-input, #ano-select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--primary-light);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: var(--font-body);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    background-color: var(--white);
    color: var(--text-dark);
}

#search-input:focus, #ano-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(138, 21, 56, 0.2);
    border-color: var(--primary-color);
}

/* Botão Voltar ao Topo */
#btn-back-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 100;
}

#btn-back-top.show {
    opacity: 1;
    visibility: visible;
}

#btn-back-top:hover {
    transform: translateY(-5px);
    background-color: var(--primary-light);
}

/* Grade de Obras */
.gallery-section {
    padding: 4rem 2rem;
    max-width: 1300px;
    margin: 0 auto;
}

.obras-container {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.ano-section {
    width: 100%;
}

.ano-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--primary-light);
    text-align: left;
}

.obras-grid-inner {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.obra-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid #eaeaea;
    position: relative;
}

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

/* Aspect ratio 2:3 container */
.obra-img-container {
    position: relative;
    width: 100%;
    padding-top: 150%; /* 3/2 = 1.5 -> 150% (Proporção retrato 40x60) */
    background-color: #f0f0f0;
    cursor: zoom-in;
    overflow: hidden;
}

.obra-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.obra-img-container:hover .obra-img {
    transform: scale(1.05);
}

/* Ícone de lupa sobre a imagem */
.zoom-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.obra-img-container:hover .zoom-overlay {
    opacity: 1;
}

.zoom-overlay span {
    color: white;
    font-size: 3rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.obra-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.obra-turma {
    color: var(--primary-color);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
    font-weight: bold;
}

.obra-escola {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.btn-votar {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 0.8rem;
    border-radius: var(--radius);
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s;
    width: 100%;
}

.btn-votar:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

.btn-votar.voted {
    background: #28a745;
    cursor: default;
    transform: none;
}

/* Lightbox Modal */
.lightbox {
    display: none; /* Escondido por padrão */
    position: fixed;
    z-index: 1000; /* Acima do header */
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    border: 3px solid var(--white);
    animation: zoomIn 0.3s ease;
}

.lightbox-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 15px 0;
    font-size: 1.2rem;
    height: auto;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}

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

/* Modal de Votação (CAPTCHA/Confirmação) */
.vote-modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
}

.vote-modal-content {
    background-color: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius);
    max-width: 450px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow-md);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {transform: translateY(-50px); opacity:0;}
    to {transform: translateY(0); opacity:1;}
}

.vote-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.vote-close:hover {
    color: var(--text-dark);
}

.vote-modal h2 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.vote-obra-info {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--secondary-color);
}

.captcha-box {
    background-color: var(--off-white);
    padding: 15px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.math-captcha {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
    font-size: 1.5rem;
    font-weight: bold;
}

.captcha-input {
    width: 80px;
    padding: 8px;
    font-size: 1.2rem;
    text-align: center;
    border: 2px solid var(--primary-light);
    border-radius: 4px;
}

.captcha-error {
    color: red;
    font-size: 0.9rem;
    margin-top: 10px;
    height: 15px;
}

.vote-loading {
    margin-top: 15px;
    color: var(--primary-color);
    font-weight: bold;
}

/* Footer Ajuste */
.footer-votacao {
    background: #111;
    color: var(--white);
    padding: 3rem 2rem;
    text-align: center;
}

.nota-inquestionavel {
    font-size: 1.2rem;
    color: #ffc107; /* Cor de destaque/alerta */
    margin-bottom: 20px;
    padding: 15px;
    border: 1px dashed #ffc107;
    display: inline-block;
    border-radius: 8px;
}

/* Mobile */
@media screen and (max-width: 768px) {
    .hero-votacao h1 {
        font-size: 2.2rem;
    }
    .btn-filter {
        width: 100%;
    }
    .category-filters-section {
        position: static; /* Remove sticky on mobile to save vertical space */
    }
}

/* ==========================================================================
   Carousel de Imagens no Card e Melhorias no Lightbox (Múltiplas Fotos)
   ========================================================================== */

/* Container do carrossel no card */
.obra-img-carousel {
    position: relative;
    width: 100%;
    padding-top: 150%; /* Proporção 2:3 */
    background-color: #f0f0f0;
    overflow: hidden;
}

.obra-img-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: zoom-in;
}

/* Botões do carrossel no card */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    font-size: 1.25rem;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s ease, background-color 0.2s;
    z-index: 10;
}

.obra-img-carousel:hover .carousel-btn {
    opacity: 1;
}

.carousel-btn:hover {
    background: rgba(138, 21, 56, 0.8);
}

.carousel-btn.prev {
    left: 10px;
}

.carousel-btn.next {
    right: 10px;
}

/* Pontinhos de navegação do carrossel no card */
.carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 10px;
    border-radius: 20px;
}

.carousel-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.carousel-dots .dot:hover,
.carousel-dots .dot.active {
    background-color: var(--white);
    transform: scale(1.2);
}

/* Container do Lightbox com Galeria */
.lightbox-gallery-container {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90%;
    margin: 0 auto;
    position: relative;
}

.lightbox-media-wrapper {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Botões do Lightbox */
.lightbox-prev,
.lightbox-next {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 2rem;
    padding: 15px 25px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
    margin: 0 20px;
    user-select: none;
    z-index: 20;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

/* Miniaturas no Lightbox */
.lightbox-thumbnails {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px auto 10px;
    max-width: 600px;
}

.lightbox-thumbnail {
    width: 60px;
    height: 90px; /* Mantém a proporção 2:3 */
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.lightbox-thumbnail:hover,
.lightbox-thumbnail.active {
    opacity: 1;
    border-color: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(138, 21, 56, 0.4);
}

/* Ajustes responsivos para Lightbox no celular */
@media screen and (max-width: 768px) {
    .lightbox-gallery-container {
        max-width: 100%;
    }
    
    .lightbox-prev,
    .lightbox-next {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        margin: 0;
        padding: 10px 15px;
        font-size: 1.5rem;
        background: rgba(0, 0, 0, 0.6);
        border: none;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-content {
        max-height: 60vh;
    }
}

/* ==========================================================================
   Estilos de Autenticação do Google OAuth e Perfil do Usuário
   ========================================================================== */

.hidden {
    display: none !important;
}

.auth-box {
    background-color: var(--off-white);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border: 1px solid var(--secondary-color);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.user-profile-card {
    display: flex;
    align-items: center;
    background: var(--white);
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(138, 21, 56, 0.15);
    text-align: left;
}

.user-photo {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
    border: 2px solid var(--primary-light);
}

.user-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
}

.user-name {
    font-weight: bold;
    font-size: 0.95rem;
    color: var(--text-dark);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-email {
    font-size: 0.85rem;
    color: var(--text-light);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.btn-signout {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: bold;
    cursor: pointer;
    padding: 5px 8px;
    font-size: 0.85rem;
    transition: color 0.2s, background-color 0.2s;
    border-radius: 4px;
    margin-left: 10px;
}

.btn-signout:hover {
    color: var(--primary-light);
    background-color: var(--secondary-color);
}

/* ==========================================================================
   Seção de Instruções de Votação
   ========================================================================== */
.instructions-section {
    padding: 3rem 2rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.instructions-container {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border-top: 6px solid var(--primary-color);
}

.instructions-container h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
}

.instructions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.instruction-card {
    background: var(--off-white);
    padding: 1.5rem;
    border-radius: var(--radius);
    position: relative;
    border: 1px solid #eaeaea;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: left;
}

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

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.instruction-card h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.instruction-card p {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.5;
}

.instructions-important-box {
    background-color: var(--secondary-color);
    border-left: 5px solid var(--primary-color);
    padding: 1.2rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--primary-color);
    text-align: left;
}

.instructions-important-box strong {
    color: var(--primary-light);
}

@media screen and (max-width: 768px) {
    .instructions-section {
        padding: 2rem 1rem 1rem;
    }
    .instructions-container {
        padding: 1.5rem;
    }
}

