/* ===== VARIABLES & THEME ===== */
:root {
    --bg-color: #0d0d0f; /* Molto scuro ma non nero puro */
    --surface-color: rgba(25, 25, 30, 0.6);
    --gold: #d4af37;
    --gold-light: #f9e596;
    --gold-dark: #aa8529;
    --text-primary: #ffffff;
    --text-sec: #b0b0b0;
    --border-glass: rgba(212, 175, 55, 0.2);
    --font-heading: 'Cinzel', serif;
    --font-body: 'Montserrat', sans-serif;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Background Effects */
.bg-glow {
    position: fixed;
    top: -20%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(212,175,55,0.15) 0%, rgba(13,13,15,0) 70%);
    border-radius: 50%;
    z-index: -2;
    filter: blur(50px);
}

.particles {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, .logo {
    font-family: var(--font-heading);
    color: var(--gold-light);
}

.text-center { text-align: center; }

/* ===== UTILITIES (GLASSMORPHISM) ===== */
.glass-card {
    background: var(--surface-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

/* ===== BUTTONS ===== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #000;
    font-weight: 600;
    padding: 14px 32px;
    border-radius: 30px;
    border: none;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.5);
}

.btn-outline {
    background: transparent;
    color: var(--text-sec);
    border: 1px solid var(--text-sec);
    padding: 12px 28px;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    font-size: 0.9rem;
}

.btn-outline:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    top: 0; left: 0; width: 100%;
    padding: 20px 0;
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(13, 13, 15, 0.9);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-glass);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 2px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    position: relative;
}

.nav-links a:hover {
    color: var(--gold);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px; left: 0; width: 0; height: 1px;
    background: var(--gold);
    transition: width 0.3s ease;
}

.nav-links a:hover::after { width: 100%; }

/* ===== HERO SECTION ===== */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 50px;
}

.hero-content {
    max-width: 800px;
    padding: 60px 40px;
    text-align: center;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 15px;
}

.title {
    font-size: 4.5rem;
    line-height: 1.1;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
}

.divider span {
    width: 60px; height: 1px;
    background: var(--gold);
}

.divider i {
    color: var(--gold);
    font-size: 1.5rem;
}

.hero-text {
    font-size: 1.1rem;
    color: var(--text-sec);
    margin-bottom: 40px;
}

/* Countdown */
.countdown-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.countdown-item span {
    font-size: 2.5rem;
    font-weight: bold;
    font-family: var(--font-heading);
    color: var(--text-primary);
    margin-bottom: 5px;
}

.countdown-item p {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold);
}

/* ===== DETAILS SECTION ===== */
.details-section {
    padding: 100px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.detail-card {
    padding: 40px 30px;
    text-align: center;
    transition: var(--transition);
}

.detail-card:hover {
    transform: translateY(-10px);
    border-color: var(--gold);
    box-shadow: 0 15px 40px rgba(212, 175, 55, 0.15);
}

.icon-wrapper {
    width: 70px; height: 70px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    border: 1px solid var(--border-glass);
}

.icon-wrapper i {
    font-size: 1.8rem;
    color: var(--gold);
}

.detail-card h3 {
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.detail-card p {
    color: var(--text-sec);
    margin-bottom: 8px;
}

.detail-card .highlight {
    color: var(--text-primary);
    font-weight: 600;
}

.link-map {
    display: inline-block;
    margin-top: 15px;
    color: var(--gold);
    font-size: 0.9rem;
    text-decoration: none;
    border-bottom: 1px solid var(--gold);
    padding-bottom: 2px;
}

/* ===== QUIZ & LEADERBOARD ===== */
.quiz-container {
    padding: 100px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.quiz-flex {
    display: flex;
    gap: 40px;
}

.quiz-card {
    flex: 2;
    padding: 40px;
}

.leaderboard-card {
    flex: 1;
    padding: 30px;
    min-width: 320px;
    display: flex;
    flex-direction: column;
}

/* Quiz UI */
.quiz-desc { color: var(--text-sec); margin: 15px 0 30px; }

.custom-input {
    width: 100%;
    padding: 15px 20px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    margin-bottom: 20px;
    transition: var(--transition);
}

.custom-input:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(0,0,0,0.5);
}

.hidden { display: none !important; }
.error-text { color: #ff5e5e; font-size: 0.85rem; margin-top: 5px; }

/* Progress Bar */
.progress-bar {
    width: 100%; height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    margin-bottom: 15px;
    overflow: hidden;
}

.progress {
    height: 100%; width: 0%;
    background: var(--gold);
    transition: width 0.4s ease;
}

.question-count {
    font-size: 0.8rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.question-text {
    font-size: 1.5rem;
    margin: 15px 0 30px;
    line-height: 1.4;
}

.options-grid {
    display: grid;
    gap: 15px;
}

.option-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-glass);
    color: #fff;
    padding: 15px 20px;
    border-radius: 10px;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    font-size: 1rem;
}

.option-btn:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--gold);
}

.option-btn.correct {
    background: rgba(46, 213, 115, 0.2);
    border-color: #2ed573;
}

.option-btn.wrong {
    background: rgba(255, 71, 87, 0.2);
    border-color: #ff4757;
}

/* Result Screen */
.score-circle {
    width: 150px; height: 150px;
    border-radius: 50%;
    background: conic-gradient(var(--gold) 0%, rgba(212,175,55,0.2) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 30px auto;
    border: 4px solid #1a1a1a;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
}

.score-circle span {
    font-size: 3rem;
    font-family: var(--font-heading);
    color: var(--gold-light);
    line-height: 1;
}

/* Leaderboard */
.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 15px;
}

.pulse-indicator {
    width: 10px; height: 10px;
    background: #2ed573;
    border-radius: 50%;
    box-shadow: 0 0 0 rgba(46, 213, 115, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(46, 213, 115, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(46, 213, 115, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 213, 115, 0); }
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: hidden;
}

.lb-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    border-left: 3px solid transparent;
    transition: all 0.5s ease;
}

.lb-item.update-anim {
    background: rgba(212, 175, 55, 0.15);
}

.lb-item.rank-1 { border-left-color: #ffd700; background: rgba(255, 215, 0, 0.05); }
.lb-item.rank-2 { border-left-color: #c0c0c0; }
.lb-item.rank-3 { border-left-color: #cd7f32; }

.lb-rank { width: 30px; font-weight: bold; color: var(--gold); font-family: var(--font-heading); }
.lb-name { flex: 1; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-score { font-weight: bold; color: var(--gold-light); }
.lb-item.is-me { border: 1px solid var(--gold); }
.lb-item.is-me .lb-name::after {
    content: ' (Tu)';
    font-size: 0.7rem; color: var(--gold);
}


/* ===== VIP PASS SECTION & FORM ===== */
.rsvp-section {
    padding: 80px 20px 120px;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.rsvp-card {
    padding: 60px 40px;
}

.rsvp-card p {
    color: var(--text-sec);
    margin: 20px 0 40px;
    font-size: 1.1rem;
}

.rsvp-form {
    width: 100%;
}

.form-group {
    margin-bottom: 25px;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 12px;
    color: var(--gold-light);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.radio-group {
    display: flex;
    gap: 15px;
}

.radio-group input[type="radio"] {
    display: none;
}

.radio-label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
}

.radio-label:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.radio-group input[type="radio"]:checked + .radio-label {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--gold);
    color: var(--gold-light);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.2);
    font-weight: 600;
}

.slide-down {
    max-height: 200px;
    opacity: 1;
    overflow: hidden;
    transition: all 0.4s ease;
}

.slide-down.hidden {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    border: none;
    padding: 0;
    display: block !important;
}

@media (max-width: 500px) {
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
}

.rsvp-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

/* Guestbook Custom Styles */
.msg-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 20px;
    text-align: left;
    position: relative;
    animation: fadeInSlide 0.5s ease forwards;
}

@keyframes fadeInSlide {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.msg-text {
    color: #fff;
    font-size: 1.05rem;
    margin-bottom: 8px !important;
    word-wrap: break-word;
}

.msg-date {
    color: var(--gold-dark);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.msg-img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 15px;
    border: 1px solid var(--border-glass);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.upload-btn {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-glass);
    padding: 6px 15px;
    border-radius: 20px;
    color: var(--gold-light);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.upload-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--gold);
}

.btn-delete {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    color: #ff4757;
    border: 1px solid #ff4757;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.btn-delete:hover {
    background: #ff4757;
    color: #fff;
}

/* Digital Ticket Styles */
.ticket {
    position: relative;
    max-width: 350px;
    margin: 40px auto 0;
    background: linear-gradient(145deg, #1f1f23, #0d0d0f);
    border: 1px solid var(--gold);
    border-radius: 15px;
    padding: 30px 20px;
    box-shadow: 0 15px 35px rgba(212,175,55,0.2), inset 0 0 20px rgba(0,0,0,0.8);
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    animation: popTicket 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popTicket {
    to { transform: translateY(0); opacity: 1; }
}

/* Holographic effect */
.ticket-holo {
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: linear-gradient(45deg, transparent 45%, rgba(212,175,55,0.3) 50%, transparent 55%);
    transform: rotate(45deg);
    animation: holoSweep 4s infinite linear;
    pointer-events: none;
}

@keyframes holoSweep {
    0% { transform: translateY(-100%) rotate(45deg); }
    100% { transform: translateY(100%) rotate(45deg); }
}

.ticket-header {
    color: var(--gold);
    font-size: 1.2rem;
    font-family: var(--font-heading);
    letter-spacing: 4px;
    margin-bottom: 25px;
    border-bottom: 1px dashed rgba(212,175,55,0.3);
    padding-bottom: 15px;
}

#ticket-name {
    font-size: 1.8rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 5px;
    font-family: var(--font-heading);
}

.ticket-event {
    color: var(--gold-light);
    font-size: 0.9rem;
    letter-spacing: 3px;
    margin-bottom: 30px;
}

.ticket-details-box {
    display: flex;
    justify-content: space-between;
    background: rgba(0,0,0,0.4);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid rgba(255,255,255,0.05);
}

.ticket-details-box div {
    text-align: left;
}

.ticket-details-box p {
    margin: 0 0 5px 0 !important;
    font-size: 0.7rem;
    color: var(--text-sec);
    letter-spacing: 1px;
}

.ticket-details-box span {
    color: #fff;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
}

.ticket-barcode {
    font-family: 'Courier New', Courier, monospace;
    font-size: 2rem;
    color: var(--text-sec);
    letter-spacing: 2px;
    opacity: 0.7;
    margin-top: 20px;
    font-weight: bold;
    transform: scaleY(1.5);
}

.rsvp-deadline {
    font-size: 0.85rem !important;
    opacity: 0.7;
    margin: 0 !important;
}

/* ===== FOOTER ===== */
footer {
    text-align: center;
    padding: 30px;
    border-top: 1px solid var(--border-glass);
    color: var(--text-sec);
    font-size: 0.9rem;
    background: rgba(0,0,0,0.5);
}

/* ===== ANIMATIONS & RESPONSIVE ===== */
.fade-in { opacity: 0; transform: translateY(20px); transition: all 1s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

.slide-up { opacity: 0; transform: translateY(40px); transition: all 0.8s ease; }
.slide-up.visible { opacity: 1; transform: translateY(0); }


@media (max-width: 900px) {
    .quiz-flex { flex-direction: column; }
    .title { font-size: 3rem; }
    .hero-content { padding: 40px 20px; }
}

@media (max-width: 600px) {
    .nav-links { display: none; } /* Simplified mobile nav */
    .nav-content { justify-content: center; } /* Centers the logo on mobile */
    
    .hero-section { padding: 80px 15px 40px; }
    .hero-content { padding: 30px 15px; }
    .title { font-size: 2.2rem; }
    .subtitle { font-size: 1rem; }
    .hero-text { font-size: 1rem; margin-bottom: 30px; }
    .divider { margin: 20px 0; }
    .divider span { width: 40px; }
    
    .countdown-item span { font-size: 1.8rem; }
    .countdown-container { gap: 15px; flex-wrap: wrap; }
    .countdown-item { min-width: 60px; }
    
    .details-section, .quiz-container, .rsvp-section { padding: 60px 15px; }
    .section-title { font-size: 2rem; margin-bottom: 30px; }
    
    /* Gids & Cards */
    .details-grid { grid-template-columns: 1fr; }
    .detail-card { padding: 30px 20px; }
    
    .quiz-card { padding: 30px 20px; }
    .question-text { font-size: 1.2rem; }
    .option-btn { font-size: 0.95rem; padding: 12px 15px; }
    
    .score-circle { width: 120px; height: 120px; }
    .score-circle span { font-size: 2.5rem; }

    /* RSVP & Ticket */
    .rsvp-card { padding: 40px 15px; }
    .rsvp-actions { flex-direction: column; align-items: stretch; }
    .btn-primary { width: 100%; }
    
    .ticket { margin: 30px auto 0; padding: 25px 15px; width: 100%; box-sizing: border-box; }
    #ticket-name { font-size: 1.4rem; word-break: break-word; }
    .ticket-event { font-size: 0.75rem; letter-spacing: 1px; margin-bottom: 20px; }
    
    .ticket-details-box { display: flex; flex-direction: column; gap: 10px; text-align: center; }
    .ticket-details-box div { text-align: center; }
    .ticket-barcode { font-size: 1.2rem; transform: scaleY(1.2); overflow: hidden; }
}

@media (max-width: 500px) {
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
}
