:root {
    --fc-blue: #003da5; /* FC Porto Blue */
    --fc-blue-light: #0055ff;
    --fc-blue-dark: #001f54;
    --fc-gold: #c49a45; /* Champions Gold */
    --white: #ffffff;
    --bg-color: #f0f4f8;
    --text-color: #333333;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-color);
    background-image: linear-gradient(135deg, var(--fc-blue-dark) 0%, var(--fc-blue) 100%);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Header */
.header {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--white);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header h1 {
    font-size: 3rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
    color: var(--white);
}

.header p {
    font-size: 1.2rem;
    font-weight: 400;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.stats {
    display: inline-block;
    background: var(--fc-gold);
    color: var(--fc-blue-dark);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(196, 154, 69, 0.4);
    animation: pulse 2s infinite;
}

.loading-val {
    animation: loading-pulse 1s infinite alternate;
}

@keyframes loading-pulse {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

.header-logo-container {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.maisfcp-logo {
    max-width: 180px;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
    transition: transform 0.3s ease;
}

.maisfcp-logo:hover {
    transform: scale(1.05);
}

/* Main Content Layout */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 1rem;
}

/* Join Section (Glassmorphism) */
.join-section {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    margin-bottom: 3rem;
    z-index: 10;
}

.join-section.loading-state {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(1);
    position: relative;
}

.join-section.loading-state::after {
    content: "A carregar contador...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--fc-blue);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-weight: 700;
    z-index: 11;
}

.join-section.loading-state form {
    visibility: hidden;
}

.join-section h2 {
    color: var(--fc-blue-dark);
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--fc-blue-dark);
}

input[type="text"], input[type="email"] {
    width: 100%;
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
}

input[type="text"]:focus, input[type="email"]:focus {
    outline: none;
    border-color: var(--fc-blue);
    box-shadow: 0 0 0 3px rgba(0, 61, 165, 0.2);
}

/* Avatar Selection */
.avatar-selection {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.avatar-option {
    width: 80px;
    height: 100px;
    cursor: pointer;
    border: 3px solid transparent;
    border-radius: 10px;
    transition: all 0.2s ease;
    padding: 5px;
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.avatar-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.avatar-option.selected {
    border-color: var(--fc-blue);
    background-color: rgba(0, 61, 165, 0.05);
    transform: scale(1.05);
}

/* Buttons */
.btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 10px;
    background: var(--fc-blue);
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:hover {
    background: var(--fc-blue-light);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 61, 165, 0.4);
}

.btn.secondary {
    background: var(--fc-gold);
    color: var(--fc-blue-dark);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 1.5rem;
}

.btn.secondary:hover {
    background: #deb65b;
    box-shadow: 0 5px 15px rgba(196, 154, 69, 0.4);
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Messages */
.message {
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    font-weight: 700;
    margin-top: 1.5rem;
    animation: fadeIn 0.5s ease;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.hidden {
    display: none !important;
}

/* Loader */
.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
}

/* Cordão Section */
.cordao-section {
    width: 100vw;
    position: relative;
    padding: 3rem 0 6rem 0; /* Ajustar padding para visibilidade */
    overflow: hidden;
    border-top: 2px solid rgba(255,255,255,0.2);
    border-bottom: 2px solid rgba(255,255,255,0.2);
}

.cordao-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('monumentos_porto.jpeg');
    background-repeat: repeat-x;
    background-position: center bottom;
    background-size: auto 100%;
    opacity: 0.35; /* Aumentado para melhor visibilidade no fundo escuro */
    z-index: 0;
    pointer-events: none;
}

.cordao-container-wrapper {
    width: 100%;
    position: relative;
    z-index: 2; /* Garante que os bonecos ficam por cima do fundo */
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2rem 0 3rem 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--fc-gold) rgba(255,255,255,0.1);
}

.cordao-container-wrapper::-webkit-scrollbar {
    height: 12px;
}
.cordao-container-wrapper::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}
.cordao-container-wrapper::-webkit-scrollbar-thumb {
    background-color: var(--fc-gold);
    border-radius: 10px;
}

.cordao-container {
    display: flex;
    align-items: flex-end;
    min-height: 180px;
    padding: 0 100px 0 50px; /* Reduced left padding to keep stadium visible at start */
    width: max-content;
}

.scroll-instruction {
    text-align: center;
    color: var(--white);
    font-size: 1rem;
    font-weight: 700;
    margin-top: -1.5rem;
    opacity: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    animation: bounceX 2s infinite;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    width: 100%;
}

.scroll-instruction:hover {
    color: var(--fc-gold);
    transform: scale(1.05);
}

/* Boneco Item */
.boneco-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 -2px; /* Reduced negative margin to make arms touch at the tips */
    position: relative;
    transition: transform 0.3s ease;
    z-index: 1;
    min-width: 120px;
    height: 150px;
}

.boneco-item:hover {
    transform: translateY(-10px) scale(1.1);
    z-index: 10;
}

.boneco-item.highlight {
    animation: highlightBounce 1s infinite alternate;
    z-index: 20;
}

.boneco-svg-container {
    width: 120px;
    height: 150px;
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.3));
}

.boneco-name-tag {
    background: var(--white);
    color: var(--fc-blue-dark);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    position: absolute;
    bottom: -25px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border: 2px solid var(--fc-gold);
}

.boneco-number {
    position: absolute;
    top: -20px;
    background: var(--fc-blue);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 10px;
}

.loading-cordao {
    color: var(--white);
    font-size: 1.2rem;
    width: 100vw;
    text-align: center;
    position: absolute;
    left: 0;
}

/* Animations */
@keyframes spin {
    to { transform: rotate(360deg); }
}

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

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes bounceX {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(10px); }
}

@keyframes highlightBounce {
    from { transform: translateY(0) scale(1.1); filter: drop-shadow(0 0 15px var(--fc-gold)); }
    to { transform: translateY(-15px) scale(1.15); filter: drop-shadow(0 0 25px var(--fc-gold)); }
}

/* Landmarks */
.landmark-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    margin: 0 20px;
    z-index: 5;
    animation: fadeIn 1s ease;
}

.landmark-img {
    width: 250px;
    height: auto;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.3));
    transition: transform 0.3s ease;
}

.landmark-item:hover .landmark-img {
    transform: translateY(-5px) scale(1.05);
}

.landmark-name {
    background: var(--fc-blue-dark);
    color: var(--fc-gold);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 900;
    margin-top: -15px;
    z-index: 6;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    border: 2px solid var(--fc-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Footer */
.footer {
    width: 100%;
    padding: 3rem 1rem 2rem;
    background: rgba(0, 31, 84, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--white);
    text-align: center;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    margin-bottom: 2rem;
}

.footer-link {
    color: var(--white);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-link:hover {
    transform: translateY(-5px) scale(1.2);
}

.social-icon {
    width: 32px;
    height: 32px;
    stroke-width: 1.5;
}

.footer-link.instagram:hover {
    color: #E1306C;
    filter: drop-shadow(0 0 10px rgba(225, 48, 108, 0.6));
}

.footer-link.spotify:hover {
    color: #1DB954;
    filter: drop-shadow(0 0 10px rgba(29, 185, 84, 0.6));
}

.footer-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--white);
    padding: 2px;
    transition: all 0.3s ease;
}

.footer-logo-betano {
    height: 32px;
    width: auto;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 2px rgba(255,255,255,0.2));
}

.footer-link.logo-app:hover .footer-logo {
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
}

.footer-link.betano-footer:hover .footer-logo-betano {
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px rgba(255, 122, 0, 0.6));
}

.footer-bottom {
    font-size: 0.85rem;
    opacity: 0.6;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .boneco-svg-container {
        width: 90px;
        height: 110px;
    }
    
    .boneco-item {
        margin: 0 -2px;
        min-width: 90px;
        height: 110px;
    }

    .footer-content {
        gap: 2rem;
    }
    
    .social-icon {
        width: 28px;
        height: 28px;
    }
    
    .footer-logo {
        width: 32px;
        height: 32px;
    }
    
    .footer-logo-betano {
        height: 28px;
    }
}

/* Scroll Down Button */
.scroll-down-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--fc-gold);
    color: var(--fc-blue-dark);
    border: none;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: float 2s infinite ease-in-out;
}

.scroll-down-btn:hover {
    transform: scale(1.1);
    background: #e5b95d;
}

.scroll-down-btn.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@media (max-width: 768px) {
    .scroll-down-btn {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}
