:root {
    --bg-dark: #0d0914;
    --card-bg: rgba(26, 18, 38, 0.75);
    --gold: #f39c12;
    --gold-light: #f1c40f;
    --purple: #8e44ad;
    --purple-dark: #2c1a4d;
    --text-white: #ffffff;
    --text-muted: #a09cb0;
    --border-color: rgba(243, 156, 18, 0.25);
    --font-heading: 'Cinzel', serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-body);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    background: linear-gradient(rgba(13, 9, 20, 0.75), rgba(13, 9, 20, 0.75)), url('images/fundo3.jpeg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
}

/* NAVBAR */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 2rem;
    background: rgba(13, 9, 20, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.badge {
    background: linear-gradient(135deg, var(--gold), var(--purple));
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.8rem;
}

.logo h1 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--gold-light);
}

.logo p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

.nav-btn:hover, .nav-btn.active {
    background: rgba(243, 156, 18, 0.15);
    color: var(--gold-light);
}

.admin-badge-btn {
    border: 1px solid var(--border-color);
}

/* CONTAINER DAS PÁGINAS */
.main-container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.page-view {
    display: none;
}

.page-view.active {
    display: block;
}

/* PÁGINA INICIAL */
.hero-card {
    text-align: center;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 3rem 1.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin-bottom: 2.5rem;
}

.hero-tag {
    color: var(--gold);
    font-weight: bold;
    letter-spacing: 2px;
    font-size: 0.85rem;
}

.hero-card h2 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    margin: 0.8rem 0;
}

.gold-text {
    color: var(--gold-light);
}

.hero-desc {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2rem;
    font-size: 1.5rem;
    line-height: 1.6;
}

/* TIMER */
.countdown-container {
    background: rgba(0,0,0,0.3);
    padding: 1.5rem;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 2rem;
}

.countdown-label {
    font-size: 0.8rem;
    color: var(--gold);
    margin-bottom: 0.8rem;
    letter-spacing: 1px;
}

.timer {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.timer-box span {
    font-size: 1.8rem;
    font-weight: bold;
    color: #fff;
    display: block;
}

.timer-box small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* BOTÕES */
.btn-primary-lg {
    background: linear-gradient(135deg, var(--gold), #d35400);
    color: #fff;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(243, 156, 18, 0.4);
    transition: 0.3s transform;
    display: block;
    margin: 0 auto 3%;
}

.btn-primary-lg:hover {
    transform: translateY(-3px);
}

/* ========================================================== */
/* LETREIRO DE PATROCÍNIOS (ESTILO RODAPÉ DE TELEVISÃO)      */
/* ========================================================== */

.sponsors-section {
    margin-bottom: 2.5rem;
}

.sponsors-carousel {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    width: 100%;
    background: rgba(13, 9, 20, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 0;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.5);
}

/* Faixa em movimento contínuo (Lado a lado) */
.sponsor-track {
    display: flex;
    align-items: center;
    gap: 2rem;
    width: max-content;
    animation: tickerNews 25s linear infinite;
}

/* Pausa suave ao passar o rato por cima */
.sponsors-carousel:hover .sponsor-track {
    animation-play-state: paused;
}

/* Cartão individual do patrocinador no letreiro */
.sponsor-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
    border: 1px solid rgba(243, 156, 18, 0.2);
    flex-shrink: 0;
}

.sponsor-logo-box {
    width: 120px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0;
}

.sponsor-logo-box img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    filter: brightness(0.9);
    transition: filter 0.3s;
}

.sponsor-logo-box img:hover {
    filter: brightness(1.2);
}

.sponsor-card p {
    font-size: 0.85rem;
    color: var(--gold-light);
    font-weight: 500;
    margin: 0;
}

/* Animação do letreiro infinito */
@keyframes tickerNews {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Esconder os pontos navegadores antigos */
#carouselDots {
    display: none;
}

/* PÁGINA DE VOTAÇÃO */
.back-link-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--gold-light);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 1rem;
}

.categories-tabs {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin: 1.5rem 0;
}

.tab-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid transparent;
    color: #fff;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
}

.tab-btn.active {
    background: var(--purple-dark);
    border-color: var(--gold);
    color: var(--gold-light);
}

.subcategories-pills {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.pill-btn {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
}

.pill-btn.active {
    background: var(--gold);
    color: #000;
    font-weight: bold;
}

/* GRID DE CONCORRENTES */
.nominees-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.nominee-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    overflow: hidden;
    text-align: center;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.nominee-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
    border: 3px solid var(--gold);
}

.nominee-card h4 {
    font-size: 1.2rem;
    margin-bottom: 0.4rem;
}

.nominee-card p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1.2rem;
}

.btn-vote {
    background: linear-gradient(135deg, var(--gold), #d35400);
    color: #fff;
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
}

.btn-voted {
    background: #27ae60;
    color: #fff;
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    font-weight: bold;
    width: 100%;
}

/* ADMIN */
.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 12px;
}

.admin-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn-secondary, .btn-warning, .btn-danger, .btn-primary {
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    border: none;
    font-weight: bold;
    cursor: pointer;
}

.btn-secondary { background: rgba(255,255,255,0.1); color: #fff; }
.btn-warning { background: #f39c12; color: #000; }
.btn-danger { background: #c0392b; color: #fff; }
.btn-primary { background: var(--gold); color: #000; }

/* MODAL */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.active { display: flex; }

.modal-card {
    background: #1a1226;
    border: 1px solid var(--gold);
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
}

.modal-card input {
    width: 100%;
    padding: 0.8rem;
    margin: 1rem 0;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,0.5);
    color: #fff;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* ========================================================== */
/* RESPONSIVIDADE GLOBAL PARA DIFERENTES TAMANHOS DE TELA      */
/* ========================================================== */

@media (max-width: 992px) {
    .main-container {
        padding: 0 0.8rem;
    }
    
    .hero-card h2 {
        font-size: 1.8rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================================== */
/* ESTILOS DA NOTIFICAÇÃO DE SUCESSO E FESTEJO DO VOTO        */
/* ========================================================== */

.success-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(13, 9, 20, 0.75);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.success-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.success-card {
    background: linear-gradient(135deg, #1a1226, #2c1a4d);
    border: 2px solid var(--gold);
    padding: 2.5rem 3rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(243, 156, 18, 0.4);
    transform: scale(0.7);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-overlay.active .success-card {
    transform: scale(1);
}

.success-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--gold), #27ae60);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 1.2rem;
    font-size: 2rem;
    color: #fff;
    box-shadow: 0 0 20px rgba(39, 174, 96, 0.6);
    animation: bounceIcon 0.6s ease infinite alternate;
}

@keyframes bounceIcon {
    from { transform: translateY(0); }
    to { transform: translateY(-8px); }
}

.success-card h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--gold-light);
    margin-bottom: 0.5rem;
}

.success-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ========================================================== */
/* SECÇÃO DE MEMÓRIAS COM ANIMAÇÃO GATILHADA POR SCROLL        */
/* ========================================================== */

.memories-section {
    margin-top: 3rem;
    text-align: center;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 3rem 2rem;
    border-radius: 20px;
}

.memories-section h3 {
    font-size: 0.85rem;
    color: var(--gold);
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.memories-section h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 2.5rem;
}

.memories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.memory-card {
    background: rgba(13, 9, 20, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
}

.memory-img-wrapper {
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
}

.memory-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translateY(80px);
    opacity: 0;
    transition: transform 0.5s ease;
}

.memory-card:hover .memory-img-wrapper img {
    transform: scale(1.05);
}

.memory-content {
    padding: 1.5rem;
    text-align: left;
    background: rgba(26, 18, 38, 0.9);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.memory-content h4,
.memory-content p {
    transform: translateX(100px);
    opacity: 0;
}

.memory-content h4 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--gold-light);
    margin-bottom: 0.5rem;
}

.memory-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ========================================================== */
/* ESTADO ATIVO: QUANDO A SECÇÃO APARECE NO ECRÃ             */
/* ========================================================== */
.memories-section.animate .memory-img-wrapper img {
    animation: slideUpImageSlow 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.memories-section.animate .memory-content h4,
.memories-section.animate .memory-content p {
    animation: slideFromRightTextSlow 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpImageSlow {
    0% {
        transform: translateY(80px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideFromRightTextSlow {
    0% {
        transform: translateX(100px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .memories-section {
        padding: 2rem 1rem;
    }
    .memories-section h2 {
        font-size: 1.4rem;
    }
}
/* Transições mais lentas (1.8 segundos) */
@keyframes slideUpImageSlow {
    0% {
        transform: translateY(80px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideFromRightTextSlow {
    0% {
        transform: translateX(100px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Ajustes Responsivos */
@media (max-width: 768px) {
    .memories-section {
        padding: 2rem 1rem;
    }
    .memories-section h2 {
        font-size: 1.4rem;
    }
}

/* Telemóveis e Ecrãs Pequenos (Abaixo de 768px) */
@media (max-width: 768px) {
    /* Navbar compacta */
    .navbar {
        padding: 0.8rem 1rem;
        flex-direction: column;
        gap: 0.8rem;
    }

    .logo {
        text-align: center;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
        gap: 0.3rem;
    }

    .nav-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }

    /* Cartão Principal / Hero */
    .hero-card {
        padding: 2rem 1rem;
    }

    .hero-card h2 {
        font-size: 1.4rem;
    }

    /* Temporizador adaptado para telemóveis */
    .timer {
        gap: 0.8rem;
    }

    .timer-box span {
        font-size: 1.4rem;
    }

    /* Grelha de Estatísticas no Admin */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .admin-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .admin-actions {
        flex-direction: column;
    }

    /* Grelha de Concorrentes: 1 coluna em telemóveis pequenos */
    .nominees-grid {
        grid-template-columns: 1fr;
    }

    /* Abas de categorias com rolagem suave */
    .categories-tabs {
        justify-content: flex-start;
    }
}

/* Ecrãs Muito Pequenos (Abaixo de 480px) */
@media (max-width: 480px) {
    .timer {
        gap: 0.4rem;
    }

    .timer-box {
        padding: 0.3rem;
    }

    .timer-box span {
        font-size: 1.2rem;
    }

    .btn-primary-lg {
        width: 100%;
        padding: 0.9rem 1rem;
        font-size: 1rem;
    }
}

/* ESTILOS DO RODAPÉ */
.main-footer {
    background-color: #0d0d0d;
    border-top: 2px solid var(--gold, #d4af37);
    color: #cccccc;
    padding: 3rem 1.5rem 1rem 1.5rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2.5rem;
}

.footer-title {
    color: var(--gold, #d4af37);
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
    font-weight: 700;
}

.footer-subtitle {
    color: #ffffff;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #333;
    padding-bottom: 0.4rem;
}

.footer-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #aaa;
}

.footer-contacts {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-contacts li {
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
    color: #bbb;
}

.footer-contacts strong {
    color: #fff;
}

.social-links {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.social-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #1a1a1a;
    color: var(--gold, #d4af37);
    border: 1px solid var(--gold, #d4af37);
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.social-btn:hover {
    background: var(--gold, #d4af37);
    color: #000;
}

.footer-bottom {
    max-width: 1200px;
    margin: 2rem auto 0 auto;
    padding-top: 1rem;
    border-top: 1px solid #222;
    text-align: center;
    font-size: 0.8rem;
    color: #777;
}