:root {
    --bg-gradient-top: #f4f6fb;
    --bg-gradient-bottom: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --card-bg: #ffffff;
    --card-hover: #f8fafc;
    --border-color: #e2e8f0;
    --accent: #4f46e5;
    --topbar-bg: #0f172a;
    --btn-primary-bg: #ffffff;
    --btn-primary-text: #4f46e5;
    --dynamic-section-bg: #f8fafc;
}

body.theme-ocean { --accent: #0ea5e9; }
body.theme-sunset { --accent: #f43f5e; }
body.theme-forest { --accent: #10b981; }

body.theme-ocean .hero { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
body.theme-sunset .hero { background: linear-gradient(135deg, #f43f5e, #fb923c); }
body.theme-forest .hero { background: linear-gradient(135deg, #10b981, #059669); }

body.dark-mode {
    --bg-gradient-top: #0f172a;
    --bg-gradient-bottom: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --card-bg: #1e293b;
    --card-hover: #334155;
    --border-color: #334155;
    --accent: #818cf8;
    --topbar-bg: #020617;
    --btn-primary-bg: #4f46e5;
    --btn-primary-text: #ffffff;
    --dynamic-section-bg: #0f172a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(180deg, var(--bg-gradient-top), var(--bg-gradient-bottom)) no-repeat;
    background-size: cover;
    background-attachment: fixed;
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    width: 90%;
    max-width: 1150px;
    margin: auto;
}

/* Top bar */
.top-bar {
    background: var(--topbar-bg);
    color: #cbd5f5;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
}

.top-bar a {
    color: #a5b4fc;
    text-decoration: none;
}

.top-bar a:hover {
    text-decoration: underline;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    padding: 90px 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 50px;
    align-items: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 15px;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    margin-bottom: 30px;
    max-width: 520px;
}

/* CTA */
.cta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-primary {
    background: #ffffff;
    color: #4f46e5;
    padding: 14px 30px;
    border-radius: 40px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    border: 2px solid rgba(255, 255, 255, 0.6);
    color: #fff;
    padding: 13px 28px;
    border-radius: 40px;
    text-decoration: none;
}

/* App image */
.hero-image img {
    width: 100%;
    max-width: 260px;
    border-radius: 26px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
}

/* Features */
.features {
    padding: 90px 0;
    background: var(--bg-gradient-bottom);
    transition: background 0.3s ease;
}

.features h2 {
    text-align: center;
    font-size: 2.3rem;
    margin-bottom: 50px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--card-bg);
    padding: 25px 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.feature-icon {
    font-size: 2.2rem;
    display: block;
}

.feature-text {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
}

/* FAQ Section */
.faq-section {
    padding: 80px 0;
    background: var(--bg-gradient-top);
    transition: background 0.3s ease;
}

.faq-section h2 {
    text-align: center;
    font-size: 2.3rem;
    margin-bottom: 15px;
}

.faq-desc {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 50px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    font-size: 1.05rem;
}

.faq-category {
    margin-bottom: 30px;
}

.faq-category h3 {
    font-size: 1.4rem;
    color: var(--accent);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.faq-item {
    background: var(--card-bg);
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: background 0.3s ease;
}

.faq-question {
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    font-size: 1.1rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.faq-question:hover {
    background: var(--card-hover);
}

.faq-toggle {
    font-size: 1.5rem;
    color: var(--accent);
    transition: transform 0.3s ease;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    background: var(--card-bg);
}

.faq-answer-inner {
    padding: 0 25px 25px 25px;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

.faq-item.active .faq-toggle {
    transform: rotate(45deg);
}

.faq-item.active .faq-answer {
    max-height: 1000px;
}

/* Footer */
.footer {
    background: var(--topbar-bg);
    color: #cbd5f5;
    padding: 35px 0;
    transition: background 0.3s ease;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.footer a {
    color: #a5b4fc;
    text-decoration: none;
    margin-left: 15px;
}

.footer a:hover {
    text-decoration: underline;
}

/* Banner cookie */
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: #0f172a;
    color: #e5e7eb;
    padding: 16px;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.25);
}

.cookie-inner {
    max-width: 1150px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
    font-size: 0.9rem;
}

.cookie-text {
    flex: 1 1 260px;
}

.cookie-text a {
    color: #a5b4fc;
    text-decoration: underline;
}

.cookie-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cookie-btn {
    border-radius: 999px;
    padding: 8px 16px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}

.cookie-btn-accept {
    background-color: #22c55e;
    color: #ffffff;
}

.cookie-btn-reject {
    background-color: transparent;
    color: #e5e7eb;
    border: 1px solid #6b7280;
}

.cookie-btn-accept:hover {
    background-color: #16a34a;
}

.cookie-btn-reject:hover {
    background-color: #111827;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-image img {
        margin: 40px auto 0;
    }

    .cta {
        justify-content: center;
    }

    .subtitle {
        margin: auto auto 30px;
    }

    .footer-content {
        justify-content: center;
        text-align: center;
    }

    .cookie-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Contenuti Dinamici */
.dynamic-section {
    padding: 90px 0;
    background: var(--dynamic-section-bg);
    transition: background 0.3s ease;
}

.dynamic-section h2 {
    text-align: center;
    font-size: 2.3rem;
    margin-bottom: 50px;
}

.dynamic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.content-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, background 0.3s ease;
}

.content-card:hover {
    transform: translateY(-5px);
}

.content-card h3 {
    color: var(--accent);
    margin-bottom: 20px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.content-list {
    list-style: none;
}

.content-list li {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    transition: border-color 0.3s ease;
}

.content-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.content-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--text-primary);
    padding-right: 35px;
    /* Spazio per il cuore */
}

.content-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.content-body {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.album-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.album-cover {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Modal Wikipedia */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--card-bg);
    color: var(--text-primary);
    padding: 30px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-secondary);
}

/* Audio Player */
.audio-preview {
    width: 100%;
    height: 35px;
    margin-top: 10px;
    border-radius: 30px;
    outline: none;
}

.audio-preview::-webkit-media-controls-panel {
    background: var(--border-color);
}

/* Favorite Button */
.fav-btn {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 1.3rem;
    color: #cbd5e1;
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
    background: transparent;
    border: none;
    outline: none;
}

.fav-btn:hover {
    transform: scale(1.1);
}

.fav-btn.active {
    color: #f43f5e;
    animation: pop 0.3s ease;
}

@keyframes pop {
    50% {
        transform: scale(1.3);
    }
}

/* Search Bar */
.search-container {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    width: 100%;
}

.search-input {
    width: 100%;
    max-width: 500px;
    padding: 14px 20px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.15);
}

.custom-dropdown {
    position: relative;
    display: inline-block;
    min-width: 190px;
    font-family: 'Poppins', sans-serif;
    user-select: none;
}

.custom-dropdown-selected {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 10px 15px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    position: relative;
}

.custom-dropdown-selected:hover {
    border-color: #94a3b8;
}

.selected-flag {
    width: 22px;
    margin-right: 10px;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.selected-text {
    color: #1e293b;
    font-size: 1rem;
    flex-grow: 1;
}

.dropdown-arrow {
    font-size: 0.8rem;
    color: #94a3b8;
    transition: transform 0.3s;
}

.custom-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.custom-dropdown-options {
    position: absolute;
    top: 110%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e2e8f0;
    list-style: none;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 320px;
    z-index: 10;
    display: none;
}

/* Custom scrollbar per il menù a tendina e lista brani */
.custom-dropdown-options::-webkit-scrollbar,
.album-tracks-list::-webkit-scrollbar {
    width: 6px;
}

.custom-dropdown-options::-webkit-scrollbar-thumb,
.album-tracks-list::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.custom-dropdown.open .custom-dropdown-options {
    display: block;
    animation: fadeIn 0.2s ease;
}

.custom-dropdown-options li {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
    color: #1e293b;
    font-size: 0.95rem;
}

.custom-dropdown-options li:hover {
    background: #f1f5f9;
}

.custom-dropdown-options li img {
    width: 22px;
    margin-right: 12px;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Language Selector Custom */
.lang-dropdown {
    position: relative;
    display: inline-block;
    font-family: 'Poppins', sans-serif;
    user-select: none;
    z-index: 50;
    /* Per farlo stare sopra gli altri elementi nella navbar */
}

.lang-dropdown-selected {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}

body.dark-mode .lang-dropdown-selected {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lang-dropdown-selected:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lang-flag {
    width: 20px;
    margin-right: 8px;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.lang-text {
    color: #cbd5f5;
    font-size: 0.9rem;
    font-weight: 500;
}

.top-bar a {
    color: #a5b4fc;
    text-decoration: none;
}

body.dark-mode .lang-text {
    color: #cbd5f5;
}

.lang-arrow {
    font-size: 0.7rem;
    color: #cbd5f5;
    margin-left: 8px;
    transition: transform 0.3s;
}

.lang-dropdown.open .lang-arrow {
    transform: rotate(180deg);
}

.lang-dropdown-options {
    position: absolute;
    top: 120%;
    right: 0;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    list-style: none;
    overflow: hidden;
    min-width: 140px;
    display: none;
}

.lang-dropdown.open .lang-dropdown-options {
    display: block;
    animation: fadeIn 0.2s ease;
}

.lang-dropdown-options li {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.lang-dropdown-options li:hover {
    background: var(--card-hover);
}

.lang-dropdown-options li img {
    width: 20px;
    margin-right: 10px;
    border-radius: 2px;
}

/* Events Section */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.event-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    height: 420px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 30px;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-size: cover;
    background-position: center;
}

.event-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0) 100%);
    z-index: 1;
}

.event-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
}

.event-card-content {
    position: relative;
    z-index: 2;
}

.event-date {
    background: var(--accent);
    color: #fff;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    width: max-content;
    margin-bottom: 12px;
}

.event-artist {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.event-location {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.event-btn {
    background: #fff;
    color: var(--accent);
    padding: 10px 22px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-block;
    transition: all 0.2s ease;
}

.event-btn:hover {
    background: var(--accent);
    color: #fff;
}

@media (max-width: 480px) {
    .event-card {
        height: 380px;
    }
}