:root {
    --bg-dark: #0a0a0c;
    --text-main: #ffffff;
    --text-muted: #a0a0b0;
    --accent-red: #ff2a2a;
    --accent-dark-red: #cc0000;
    --glass-bg: rgba(20, 20, 25, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-glow: rgba(255, 42, 42, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Feature Toggle: Palinsesto */
body[data-palinsesto-enabled="false"] li:has(a[href="#palinsesto"]),
body[data-palinsesto-enabled="false"] a[href="#palinsesto"],
body[data-palinsesto-enabled="false"] #palinsesto {
    display: none !important;
}

.glow-bg {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(255, 42, 42, 0.05) 0%, transparent 40%);
    z-index: -1;
    pointer-events: none;
}

h1,
h2,
h3 {
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
}

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 0;
    background: rgba(10, 10, 12, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 100;
    transition: all 0.3s ease, z-index 0s 0.4s;
}

body.menu-open .navbar {
    z-index: 3000;
    background: transparent;
    border-bottom-color: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: all 0.3s ease, z-index 0s 0s;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

/* Navbar and Logo Transition */
.logo-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 101;
}

/* Dynamic Logo transitions */
#dynamic-logo {
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--accent-red);
    box-shadow: 0 10px 40px rgba(255, 42, 42, 0.4);
    transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: fixed;
    z-index: 1000;
}

#dynamic-logo.logo-home {
    /* Home page large state - perfectly perfectly placed to match hero-placeholder */
    width: 220px;
    height: 220px;
    top: 140px;
    left: 50%;
    transform: translateX(-50%);
}

#dynamic-logo.logo-nav {
    /* Nav bar small state - aligned nicely */
    width: 40px;
    height: 40px;
    top: 20px;
    left: max(calc((100vw - 1200px) / 2 + 20px), 20px);
    transform: translateX(0);
    box-shadow: 0 0 10px rgba(255, 42, 42, 0.4);
    border-width: 1px;
}

/* Dynamic Cover Art transitions */
#dynamic-cover-art {
    position: fixed;
    object-fit: cover;
    z-index: 1001;
    transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
}

#dynamic-cover-art.cover-ascolta {
    width: 200px !important;
    height: 200px !important;
    max-width: 200px !important;
    max-height: 200px !important;
    border-radius: 12px;
    top: 240px;
    left: 50%;
    transform: translateX(-50%);
}

#dynamic-cover-art.cover-player {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    top: auto;
    bottom: 8px;
    left: max(calc((100vw - 1200px) / 2), 20px);
    transform: translateX(0);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    /* transition margin-left to smoothly slide to the right for the logo */
    transition: margin-left 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: inline-block;
}

body.home-active .logo-text {
    opacity: 1;
    /* Made visible again per user request */
    margin-left: 0;
}

body:not(.home-active) .logo-text {
    opacity: 1;
    margin-left: 55px;
    /* Make space for logo on the left (40px + 15px gap) */
}

.logo-text span,
.logo span {
    color: var(--accent-red);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-red);
}

.content {
    max-width: 1200px;
    margin: 100px auto 120px;
    padding: 0 20px;
}

.page-section {
    display: none;
    min-height: calc(100vh - 220px);
    animation: fadeIn 0.5s ease;
}

.page-section.active-section {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 15px;
}

.section-header h2 {
    font-size: 2rem;
    color: var(--text-main);
}

.live-badge {
    background: rgba(255, 42, 42, 0.1);
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pulse {
    width: 8px;
    height: 8px;
    background-color: var(--accent-red);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(255, 42, 42, 0.7);
    animation: pulsing 1.5s infinite;
}

@keyframes pulsing {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 42, 42, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(255, 42, 42, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 42, 42, 0);
    }
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.hero {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    min-height: 50vh;
    padding-top: 40px;
}

#hero-logo-placeholder {
    height: 220px;
    width: 220px;
    margin-bottom: 20px;
}

.hero-title {
    font-size: 2.2rem;
    /* Shrunk proper Home screen text at User request */
    margin-bottom: 10px;
    background: linear-gradient(135deg, #fff 0%, #a0a0b0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    font-weight: 300;
}

.btn {
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-red) 0%, var(--accent-dark-red) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 42, 42, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 42, 42, 0.4);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.hero-actions {
    display: flex;
    gap: 20px;
}

.player-large-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 50px 30px;
}

.album-art {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2a2a35 0%, #1a1a25 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 4rem;
    color: var(--accent-red);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin-bottom: 30px;
    border: 1px solid var(--glass-border);
}

.track-info-large h3 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.track-info-large p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.visualizer {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 40px;
    gap: 5px;
    opacity: 0.3;
    transition: opacity 0.3s;
}

.visualizer.active {
    opacity: 1;
}

.visualizer .bar {
    width: 10px;
    background: var(--accent-red);
    border-radius: 5px 5px 0 0;
    height: 5px;
}

@keyframes eq {
    0% {
        height: 10%;
    }

    50% {
        height: 100%;
    }

    100% {
        height: 10%;
    }
}

.contact-links,
.app-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.contact-btn,
.store-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.contact-btn:hover,
.store-btn:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.08);
}

.bottom-player {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(10, 10, 12, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid var(--glass-border);
    padding: 15px 20px;
    z-index: 200;
}

.player-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-left {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 30%;
}

.player-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: margin-left 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body.ascolta-active .player-info {
    margin-left: 0;
}

body:not(.ascolta-active) .player-info {
    margin-left: 65px;
    /* 50px image width + 15px gap */
}

.player-title {
    font-weight: 600;
    font-size: 1rem;
}

.player-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.player-center {
    display: flex;
    align-items: center;
    gap: 30px;
    width: 40%;
    justify-content: center;
}

.player-btn {
    background: white;
    color: black;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.player-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
}

input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 12px;
    width: 12px;
    border-radius: 50%;
    background: var(--accent-red);
    cursor: pointer;
    margin-top: -4px;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.player-right {
    width: 30%;
    display: flex;
    justify-content: flex-end;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: gray;
}

.status-dot.playing {
    background: #00ff00;
    box-shadow: 0 0 8px #00ff00;
}

.status-dot.buffering {
    background: #ffcc00;
    animation: flash 1s infinite alternate;
}

@keyframes flash {
    from {
        opacity: 0.5;
    }

    to {
        opacity: 1;
    }
}

/* Mobile Menu Toggle button (hidden on desktop) */
.menu-toggle {
    display: none;
    font-size: 1.8rem;
    color: var(--text-main);
    cursor: pointer;
    z-index: 1001;
    /* Ensure it stays above the menu */
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .navbar {
        padding: 8px 0;
    }

    .nav-container {
        flex-direction: row;
        /* Keep logo and hamburger side-by-side */
        justify-content: space-between;
        align-items: center;
        padding: 5px 20px;
    }

    .menu-toggle {
        display: block;
        /* Show hamburger on mobile */
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(10, 10, 12, 0.85);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 30px;
        margin-top: 0;
        border-bottom: none;
        box-shadow: none;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.4s ease, visibility 0.4s ease;
        z-index: 1000;
    }

    .nav-links.mobile-nav-active {
        opacity: 1;
        visibility: visible;
        max-height: none;
        padding-top: 0;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
        opacity: 0;
        transform: translateY(-30px);
        filter: blur(10px);
        transition: opacity 0.4s ease, transform 0.4s ease, filter 0.4s ease;
    }

    .nav-links.mobile-nav-active li {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }

    .nav-links.mobile-nav-active li:nth-child(1) {
        transition-delay: 0.1s;
    }

    .nav-links.mobile-nav-active li:nth-child(2) {
        transition-delay: 0.15s;
    }

    .nav-links.mobile-nav-active li:nth-child(3) {
        transition-delay: 0.2s;
    }

    .nav-links.mobile-nav-active li:nth-child(4) {
        transition-delay: 0.25s;
    }

    .nav-links.mobile-nav-active li:nth-child(5) {
        transition-delay: 0.3s;
    }

    .nav-links a {
        display: inline-block;
        padding: 10px 0;
        border-bottom: none;
        font-size: 2rem;
    }

    .nav-links li:last-child a {
        border-bottom: none;
    }

    /* Adjust logo styling specifically for the absolute menu structure */
    .logo-wrapper {
        flex: 1;
    }

    /* Keep the logo small but center it or allow it to sit in the header */
    #dynamic-logo.logo-nav {
        width: 32px;
        height: 32px;
        top: 19px;
        /* Matches center of nav container determined by hamburger menu */
        left: 20px;
        /* Force left side if not already there */
    }

    .logo-text {
        font-size: 1.2rem;
        display: inline-block;
        line-height: 32px;
        /* Match logo height for easy vertical centering */
        margin-left: 45px;
        /* Stay clear of absolute logo + gap */
    }

    body:not(.home-active) .logo-text {
        opacity: 1;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .hero-actions {
        flex-direction: column;
        gap: 15px;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    /* On Ascolta page, scale down cover art dynamically */
    #dynamic-cover-art.cover-ascolta {
        width: 150px !important;
        height: 150px !important;
        top: 250px;
    }

    #ascolta-cover-placeholder {
        width: 150px !important;
        height: 150px !important;
    }

    .player-large-view {
        padding: 30px 15px;
    }

    .track-info-large h3 {
        font-size: 1.4rem;
    }

    .track-info-large p {
        font-size: 1rem;
    }

    .bottom-player {
        padding: 10px 15px;
    }

    /* Make player bar elements stack or squeeze nicely */
    .player-container {
        flex-wrap: nowrap;
        justify-content: space-between;
    }

    /* Hide the right status indicator completely on mobile to save space */
    .player-right {
        display: none;
    }

    /* Hide the volume slider entirely on mobile */
    .volume-container {
        display: none;
    }

    .player-left {
        width: 70%;
    }

    .player-center {
        width: 30%;
        justify-content: flex-end;
    }

    .player-title {
        font-size: 0.9rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }

    .player-subtitle {
        font-size: 0.7rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }

    /* Dynamic cover styling in player */
    #dynamic-cover-art.cover-player {
        width: 40px;
        height: 40px;
        top: auto;
        bottom: 12px;
        left: 15px;
    }

    body:not(.ascolta-active) .player-info {
        margin-left: 55px;
        /* Adjust for smaller 40px cover art */
    }

    .player-info {
        margin-top: 5px;
    }
}