:root {
    --primary-color: #ff0055;
    --primary-glow: rgba(255, 0, 85, 0.5);
    --text-color: #ffffff;
    --bg-dark: #09090b;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-bg-2: rgb(195, 195, 195);
    --glass-border: rgba(255, 255, 255, 0.12);
    --skeleton-bg: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    /* background-color: var(--bg-dark); */
    color: var(--text-color);
    /* height: 100vh; */
    display: flex;
    justify-content: center;
    align-items: center;
    /* overflow: hidden; */
    position: relative;
    background: transparent;
    /* Ensure it doesn't cover WP background */
}

@keyframes bgPulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.1);
        opacity: 1;
    }
}


.background-blur {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #333;
    /* Fallback color */
    background-size: cover;
    background-position: center;
    filter: blur(80px) brightness(0.4);
    z-index: -1;
    transition: background-image 0.5s ease;
}

.player-container {
    background: rgba(0, 0, 0, 0.4);
    /* Glass effect on top of blur */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.player-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--player-bg);
    background-size: cover;
    background-position: center;
    filter: blur(30px) brightness(0.6);
    z-index: -1;
    transition: background-image 0.5s ease;
    opacity: 0.8;
}

#header-logo {
    height: 40px;
}

/* Responsive Layout */
@media (min-width: 768px) {
    .player-container {
        max-width: 100%;
		width:100%;
        display: flex;
        flex-direction: column;
        text-align: left;
    }
	
	.header{display:none;}

    .player-content {
        display: flex;
        gap: 2rem;
        align-items: stretch;
    }

    .cover-art {
        flex: 0 0 280px;
        margin-bottom: 0px !important;
    }

    .cover-art img {
        width: 100%;
        height: 280px;
    }

    .player-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    .track-info {
        text-align: center;
    }

    .controls {
        justify-content: flex-start;
    }
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-link {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    transition: all 0.2s;
    cursor: pointer;
    padding: 0.5rem;
}

.admin-link:hover {
    color: var(--primary-color);
    transform: rotate(15deg);
}

.status {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 1px;
}

.live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 10px var(--primary-color);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 var(--primary-glow);
    }

    70% {
        transform: scale(1.2);
        opacity: 0.8;
        box-shadow: 0 0 0 10px rgba(255, 0, 85, 0);
    }

    100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(255, 0, 85, 0);
    }
}

/* Skeleton Screens */
.skeleton {
    background: var(--skeleton-bg);
    background: linear-gradient(90deg, var(--skeleton-bg) 25%, rgba(255, 255, 255, 0.08) 50%, var(--skeleton-bg) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

#track-title.loading {
    width: 180px;
    height: 28px;
    display: inline-block;
}

#artist-name.loading {
    width: 120px;
    height: 18px;
    display: inline-block;
    margin-top: 8px;
}

/* Audio Visualizer */
.visualizer-container {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    height: 30px;
    margin-top: 15px;
    opacity: 0;
    transition: opacity 0.3s;
}

.visualizer-container.active {
    opacity: 1;
}

.vis-bar {
    width: 3px;
    background: var(--primary-color);
    border-radius: 3px 3px 0 0;
    height: 2px;
}

.visualizer-container.active .vis-bar {
    animation: visAnim 0.5s ease-in-out infinite alternate;
}

@keyframes visAnim {
    0% {
        height: 5px;
    }

    100% {
        height: 25px;
    }
}

/* Variate animation delay for bars */
.vis-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.vis-bar:nth-child(3) {
    animation-delay: 0.2s;
}

.vis-bar:nth-child(4) {
    animation-delay: 0.15s;
}

.vis-bar:nth-child(5) {
    animation-delay: 0.25s;
}


.cover-art {
    margin-bottom: 1.5rem;
    position: relative;
    perspective: 1000px;
    /* Add perspective for 3D effect if needed, though simple rotate is 2D */
}

.cover-art img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, cursor 0.2s;
}

.cover-art {
    position: relative;
}

.cover-art img {
    /* Consenti click sulla immagine */
    pointer-events: auto;
}

/* AD CLICK PILL */
.ad-click-pill {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 0, 85, 0.9);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(255, 0, 85, 0.6);
    transition: all 0.2s;
    font-family: 'Outfit', sans-serif;
    z-index: 10;
    pointer-events: auto;
}

.ad-click-pill:hover {
    background: rgba(255, 0, 85, 1);
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 0, 85, 0.8);
}

@keyframes slideInPill {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Rotation Animation Class */
.rotate-anim {
    animation: rotate-in 0.6s ease-out;
}

@keyframes rotate-in {
    0% {
        transform: rotateY(90deg) scale(0.8);
        opacity: 0;
    }

    100% {
        transform: rotateY(0deg) scale(1);
        opacity: 1;
    }
}

.track-info {
    margin-bottom: 2rem;
}

.track-info h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-wrap: pretty;
    overflow: hidden;
    text-overflow: ellipsis;
    color: rgba(255, 255, 255, 0.70);
}

.track-info p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.play-btn {
    background: var(--primary-color);
    border: none;
    color: white;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(255, 0, 85, 0.4);
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 0, 85, 0.6);
}

.change-channel-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(255, 0, 85, 0.4);
    margin-top: auto;
    font-family: 'Outfit', sans-serif;
}

.change-channel-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 0, 85, 0.6);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: 30px;
}

#volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
    margin: 0px;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--primary-glow);
    transition: transform 0.2s;
}

#volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* The original input[type=range] rule is now redundant for the volume slider,
   but keeping it for other potential range inputs or if #volume-slider is not used. */
input[type=range] {
    -webkit-appearance: none;
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 2px;
    outline: none;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

/* Modal */
.modal {
    display: none;
    position: absolute;
    /* Changed from fixed to absolute */
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s;
    border-radius: 24px;
    /* Match container border radius */
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal.show {
    display: flex !important;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: rgba(144,203,193,0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    width: 90%;
    max-height: 90%;
    overflow-y: auto;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    animation: slideUp 0.3s;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 auto;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.close-btn:hover {
    color: white;
}

.channel-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

/* Override specifics for Modal Channel List */
.modal .channel-list {
    display: flex;
    flex-direction: column;
    /* Force column direction */
    gap: 10px;
}

.channel-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 15px;
    border-radius: 12px;
    cursor: pointer;
    word-break: break-word;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    box-shadow: 0px 8px 43px -23px rgba(208, 208, 208, 1);
    -webkit-box-shadow: 0px 8px 43px -23px rgba(208, 208, 208, 1);
    -moz-box-shadow: 0px 8px 43px -23px rgba(208, 208, 208, 1);
}

.channel-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.channel-item.active {
    background: rgba(255, 0, 85, 0.2);
    border-color: var(--primary-color);
    color: white;
}

/* Scrollbar styling per modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.channels {
    text-align: left;
    border-top: 1px solid var(--glass-border);
    padding-top: 1.5rem;
}

.channels h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.5);
}

.channel-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
    /* Firefox */
}

.channel-list::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.channel-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    border-radius: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
    border: 1px solid transparent;
	text-wrap:pretty;
}

.channel-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.channel-item.active {
    background: rgba(255, 0, 85, 0.2);
    border-color: var(--primary-color);
    color: white;
}

/* Mobile (default) */
@media (max-width: 767px) {
    .player-content {
        display: flex;
        flex-direction: column;
		width:100% !important;
    }
	
	.header{display:none !important;}

    .player-info {
        display: flex;
        flex-direction: column;
    }
	
	.cover-art {
        margin-bottom: 0px !important;
    }

    .volume-control {
        display: none !important;
    }
	
	.track-info {
        text-align: center;
		margin-bottom:0px !important;
    }
	
	#visualizer{margin-bottom:15px;}
}