/**
 * KPromoSender Advanced Player - Core CSS
 * Modern, responsive audio player styles
 */

/* =============================================
   CSS CUSTOM PROPERTIES (Variables)
   ============================================= */
:root {
    /* Core Colors */
    --kpromo-primary: #FF6B35;
    --kpromo-secondary: #00C4FF;
    --kpromo-accent: #FFF;
    --kpromo-background: #1a1a1a;
    --kpromo-text: #ffffff;
    --kpromo-border: rgba(255, 255, 255, 0.1);
    
    /* Player Dimensions */
    --kpromo-player-padding: 32px;
    --kpromo-artwork-size: 120px;
    --kpromo-font-size-title: 24px;
    --kpromo-font-size-artist: 18px;
    --kpromo-font-size-meta: 14px;
    --kpromo-control-size: 52px;
    --kpromo-border-radius: 16px;
    
    /* Animations */
    --kpromo-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --kpromo-transition-fast: all 0.15s ease;
    --kpromo-spring: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Z-index layers */
    --kpromo-z-player: 100;
    --kpromo-z-sticky: 9999;
    --kpromo-z-modal: 10000;
    --kpromo-z-overlay: 200;
}

/* =============================================
   RESPONSIVE BREAKPOINTS
   ============================================= */
/* Mobile First Approach */
@media (max-width: 767px) {
    :root {
        --kpromo-player-padding: 16px;
        --kpromo-artwork-size: 60px;
        --kpromo-font-size-title: 16px;
        --kpromo-font-size-artist: 14px;
        --kpromo-font-size-meta: 12px;
        --kpromo-control-size: 44px;
        --kpromo-border-radius: 12px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    :root {
        --kpromo-player-padding: 24px;
        --kpromo-artwork-size: 80px;
        --kpromo-font-size-title: 18px;
        --kpromo-font-size-artist: 16px;
        --kpromo-font-size-meta: 13px;
        --kpromo-control-size: 48px;
    }
}

@media (min-width: 1440px) {
    :root {
        --kpromo-player-padding: 40px;
        --kpromo-artwork-size: 150px;
        --kpromo-font-size-title: 28px;
        --kpromo-font-size-artist: 20px;
        --kpromo-font-size-meta: 16px;
        --kpromo-control-size: 56px;
    }
}

/* =============================================
   RESET & BASE STYLES
   ============================================= */
.kpromo-player *,
.kpromo-player *::before,
.kpromo-player *::after {
    box-sizing: border-box;
}

.kpromo-player {
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    isolation: isolate;
    contain: layout style paint;
}

.kpromo-player button {
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    outline: none;
    transition: var(--kpromo-transition);
    touch-action: manipulation;
}

.kpromo-player button:focus-visible {
    outline: 2px solid var(--kpromo-primary);
    outline-offset: 2px;
}

.kpromo-player img {
    max-width: 100%;
    height: auto;
    display: block;
}

.kpromo-player svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
    pointer-events: none;
}

/* =============================================
   PROGRESS BAR INDIPENDENTE
   ============================================= */
.grid-progress-bar {
    grid-area: progress;
    width: 100%;
    padding: 16px 0;
    margin: 8px 0;
}

.progress-track {
    position: relative;
    width: 100%;
    height: var(--progress-bar-height, 4px);
    background: var(--progress-bar-bg-color, rgba(255, 255, 255, 0.1));
    border-radius: calc(var(--progress-bar-height, 4px) / 2);
    cursor: pointer;
    overflow: hidden;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--progress-bar-color, var(--kpromo-primary));
    border-radius: calc(var(--progress-bar-height, 4px) / 2);
    transition: width 0.1s linear;
}

.progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    width: var(--progress-bar-thumb-size, 12px);
    height: var(--progress-bar-thumb-size, 12px);
    background: var(--progress-bar-thumb-color, #FFFFFF);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.progress-track:hover .progress-thumb {
    opacity: 1;
}

.progress-time-display {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

/* =============================================
   GRID LAYOUT PLAYER
   ============================================= */
.kpromo-player-grid {
    background: var(--background-color, var(--kpromo-background));
    color: var(--text-color, var(--kpromo-text));
    border-radius: var(--kpromo-border-radius);
    padding: var(--kpromo-player-padding);
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto auto auto;
    grid-template-areas: 
        "artwork info cta"
        "waveform waveform waveform"
        "progress progress progress"
        "controls controls controls";
    gap: 24px;
    align-items: center;
    position: relative;
    overflow: hidden;
}

@media (max-width: 767px) {
    .kpromo-player-grid {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "artwork"
            "info"
            "waveform"
            "controls"
            "cta";
        gap: 16px;
        text-align: center;
    }
}

/* =============================================
   ARTWORK CONTAINER
   ============================================= */
.grid-artwork-container {
    grid-area: artwork;
    position: relative;
}

.grid-artwork {
    position: relative;
    width: var(--kpromo-artwork-size);
    height: var(--kpromo-artwork-size);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.artwork-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--kpromo-transition);
}

.artwork-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--kpromo-transition);
    backdrop-filter: blur(4px);
}

.grid-artwork:hover .artwork-overlay {
    opacity: 1;
}

.grid-play-btn {
    background: var(--primary-color, var(--kpromo-primary));
    color: white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.8);
    transition: var(--kpromo-transition);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.grid-artwork:hover .grid-play-btn {
    transform: scale(1);
}

.grid-play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.grid-play-btn .play-icon {
    width: 20px;
    height: 20px;
    margin-left: 2px; /* Visual centering for play icon */
}

/* Play button text (when enabled) */
.play-text {
    margin-left: 8px;
    font-weight: 600;
    font-size: 14px;
}

/* =============================================
   VISUALIZER OVERLAY
   ============================================= */
.visualizer-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: 0.8;
}

.grid-visualizer {
    width: 100%;
    height: 100%;
}

/* Show visualizer only when playing */
.kpromo-player.is-playing .visualizer-overlay {
    opacity: 1;
}

.kpromo-player:not(.is-playing) .visualizer-overlay {
    opacity: 0;
}

/* =============================================
   TRACK INFO
   ============================================= */
.grid-info {
    grid-area: info;
    min-width: 0; /* Prevent overflow */
}

.grid-title {
    font-size: var(--kpromo-font-size-title);
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.2;
    color: var(--text-color, var(--kpromo-text));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.grid-artist {
    font-size: var(--kpromo-font-size-artist);
    font-weight: 500;
    margin: 0 0 12px 0;
    color: var(--secondary-color, var(--kpromo-secondary));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.grid-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: var(--kpromo-font-size-meta);
    color: rgba(255, 255, 255, 0.7);
}

.grid-meta > span {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
}

@media (max-width: 767px) {
    .grid-meta {
        justify-content: center;
    }
}

/* =============================================
   WAVEFORM DISPLAY
   ============================================= */
.grid-waveform {
    grid-area: waveform;
    position: relative;
    height: 80px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.waveform-display {
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.waveform-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color, var(--kpromo-primary)) 0%, var(--secondary-color, var(--kpromo-secondary)) 100%);
    width: 0%;
    transition: width 0.1s linear;
    pointer-events: none;
    opacity: 0.8;
}

.waveform-time-display {
    position: absolute;
    bottom: 8px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

/* =============================================
   PLAYER CONTROLS
   ============================================= */
.grid-controls {
    grid-area: controls;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

@media (max-width: 767px) {
    .grid-controls {
        gap: 12px;
    }
}

.grid-controls button {
    width: var(--kpromo-control-size);
    height: var(--kpromo-control-size);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color, var(--kpromo-text));
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--kpromo-transition);
    backdrop-filter: blur(10px);
}

.grid-controls button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.grid-controls button svg {
    width: 24px;
    height: 24px;
}

/* Main play button */
.main-play-btn {
    width: calc(var(--kpromo-control-size) * 1.2);
    height: calc(var(--kpromo-control-size) * 1.2);
    background: var(--primary-color, var(--kpromo-primary));
    color: white;
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.3);
}

.main-play-btn:hover {
    background: var(--primary-color, var(--kpromo-primary));
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.main-play-btn svg {
    width: 28px;
    height: 28px;
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--kpromo-transition);
    background: rgba(255, 255, 255, 0.1);
}

.volume-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.volume-btn .icon-volume {
    width: 20px;
    height: 20px;
    fill: #ffffff;
    transition: var(--kpromo-transition);
}

/* Stato mutato - icona rossa */
.volume-btn.is-muted .icon-volume {
    fill: #ff4444;
}

/* Stato non mutato - icona bianca */
.volume-btn.is-unmuted .icon-volume {
    fill: #ffffff;
}

/* Effetto hover per stato mutato */
.volume-btn.is-muted:hover .icon-volume {
    fill: #ff6666;
}

/* Effetto hover per stato non mutato */
.volume-btn.is-unmuted:hover .icon-volume {
    fill: #f0f0f0;
}

/* =============================================
   WIDGET ELEMENTOR VOLUME CONTROL
   ============================================= */
.kpromo-player-volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kpromo-player-volume-control .volume-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--kpromo-transition);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
}

.kpromo-player-volume-control .volume-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.kpromo-player-volume-control .volume-btn svg {
    width: 20px;
    height: 20px;
    transition: var(--kpromo-transition);
}

/* Icona volume-on (altoparlante con onde) - bianca quando attivo */
.kpromo-player-volume-control .volume-btn .volume-on {
    fill: #ffffff;
}

/* Icona volume-off (altoparlante barrato) - rossa quando disattivato */
.kpromo-player-volume-control .volume-btn .volume-off {
    fill: #ff4444;
}

/* Stato mutato - mostra icona rossa */
.kpromo-player-volume-control .volume-btn.is-muted .volume-on {
    display: none;
}

.kpromo-player-volume-control .volume-btn.is-muted .volume-off {
    display: block;
    fill: #ff4444;
}

/* Stato non mutato - mostra icona bianca */
.kpromo-player-volume-control .volume-btn.is-unmuted .volume-on {
    display: block;
    fill: #ffffff;
}

.kpromo-player-volume-control .volume-btn.is-unmuted .volume-off {
    display: none;
}

/* Effetti hover per widget Elementor */
.kpromo-player-volume-control .volume-btn.is-muted:hover .volume-off {
    fill: #ff6666;
}

.kpromo-player-volume-control .volume-btn.is-unmuted:hover .volume-on {
    fill: #f0f0f0;
}

.volume-slider {
    position: relative;
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
}

.volume-input {
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.volume-slider::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--primary-color, var(--kpromo-primary));
    width: 80%; /* Default volume */
    transition: var(--kpromo-transition-fast);
}

@media (max-width: 767px) {
    .volume-control {
        display: none; /* Hide on mobile to save space */
    }
}

/* =============================================
   CTA BUTTONS
   ============================================= */
.grid-cta {
    grid-area: cta;
    display: flex;
    gap: 12px;
    align-items: center;
}

@media (max-width: 767px) {
    .grid-cta {
        justify-content: center;
        flex-wrap: wrap;
    }
}

.grid-cta button {
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--kpromo-transition);
    text-decoration: none;
}

.cta-download {
    background: var(--primary-color, var(--kpromo-primary));
    color: white;
}

.cta-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(255, 107, 53, 0.3);
}

.cta-share {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color, var(--kpromo-text));
}

.cta-share:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.cta-favorite {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color, var(--kpromo-text));
}

.cta-favorite:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.cta-favorite.is-favorited {
    background: var(--secondary-color, var(--kpromo-secondary));
    color: white;
}

.grid-cta button svg {
    width: 16px;
    height: 16px;
}

/* =============================================
   FEEDBACK CONTROLS (LIKE/DISLIKE)
   ============================================= */
.feedback-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.feedback-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    min-width: 60px;
    justify-content: center;
}

.feedback-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.feedback-btn svg {
    width: 16px;
    height: 16px;
    transition: all 0.3s ease;
}

.feedback-btn .like-count,
.feedback-btn .dislike-count {
    font-size: 11px;
    font-weight: 700;
    min-width: 16px;
    text-align: center;
}

/* Like button states */
.like-btn.active {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    border-color: #ff6b6b;
    color: white;
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.3);
}

.like-btn.active svg {
    fill: white;
    transform: scale(1.1);
}

.like-btn:not(.active) svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

/* Dislike button states */
.dislike-btn.active {
    background: linear-gradient(135deg, #a55eea, #8854d0);
    border-color: #a55eea;
    color: white;
    box-shadow: 0 4px 16px rgba(165, 94, 234, 0.3);
}

.dislike-btn.active svg {
    fill: white;
    transform: scale(1.1);
}

.dislike-btn:not(.active) svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

/* Animation di feedback */
.feedback-btn.loading {
    opacity: 0.6;
    transform: scale(0.95);
    pointer-events: none;
}

.feedback-btn.success {
    animation: feedbackSuccess 0.6s ease;
}

@keyframes feedbackSuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Responsive feedback controls */
@media (max-width: 767px) {
    .feedback-controls {
        order: 1;
        margin-left: 0;
        margin-top: var(--kpromo-spacing-sm);
        justify-content: center;
        width: 100%;
        gap: var(--kpromo-spacing-md);
    }
    
    .feedback-btn {
        flex: 1;
        max-width: 120px;
        padding: 10px 16px;
        border-radius: 25px;
        font-size: 13px;
        min-height: var(--kpromo-touch-target);
    }
    
    .feedback-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .feedback-btn .like-count,
    .feedback-btn .dislike-count {
        font-size: 12px;
        min-width: 20px;
    }
}

/* Integration with grid controls */
.grid-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--kpromo-spacing-md);
    justify-content: center;
}

@media (min-width: 768px) {
    .grid-controls {
        justify-content: flex-start;
    }
    
    .feedback-controls {
        margin-left: auto;
        flex-shrink: 0;
    }
    
    /* Desktop-specific feedback button styles with high specificity */
    .kpromo-player-grid .feedback-controls .feedback-btn {
        padding: 8px 12px;
        border-radius: 20px;
        font-size: 12px;
        min-width: 60px;
        min-height: auto;
        color: rgba(255, 255, 255, 0.9) !important; /* force visible text/stroke */
    }
    
    .kpromo-player-grid .feedback-controls .feedback-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .kpromo-player-grid .feedback-controls .feedback-btn .like-count,
    .kpromo-player-grid .feedback-controls .feedback-btn .dislike-count {
        font-size: 11px;
        min-width: 16px;
        font-weight: 700;
        color: inherit;
    }
    
    /* High specificity active states for desktop */
    .kpromo-player-grid .feedback-controls .feedback-btn.like-btn.active,
    .kpromo-player-grid .feedback-controls .like-btn.active {
        background: linear-gradient(135deg, #ff6b6b, #ee5a24) !important;
        border-color: #ff6b6b !important;
        color: white !important;
        box-shadow: 0 4px 16px rgba(255, 107, 107, 0.3) !important;
    }
    
    .kpromo-player-grid .feedback-controls .feedback-btn.like-btn.active svg,
    .kpromo-player-grid .feedback-controls .like-btn.active svg {
        fill: white !important;
        stroke: none !important;
        transform: scale(1.1) !important;
    }
    
    .kpromo-player-grid .feedback-controls .feedback-btn.like-btn.active .like-count,
    .kpromo-player-grid .feedback-controls .like-btn.active .like-count {
        color: white !important;
    }
    
    .kpromo-player-grid .feedback-controls .feedback-btn.dislike-btn.active,
    .kpromo-player-grid .feedback-controls .dislike-btn.active {
        background: linear-gradient(135deg, #a55eea, #8854d0) !important;
        border-color: #a55eea !important;
        color: white !important;
        box-shadow: 0 4px 16px rgba(165, 94, 234, 0.3) !important;
    }
    
    .kpromo-player-grid .feedback-controls .feedback-btn.dislike-btn.active svg,
    .kpromo-player-grid .feedback-controls .dislike-btn.active svg {
        fill: white !important;
        stroke: none !important;
        transform: scale(1.1) !important;
    }
    
    .kpromo-player-grid .feedback-controls .feedback-btn.dislike-btn.active .dislike-count,
    .kpromo-player-grid .feedback-controls .dislike-btn.active .dislike-count {
        color: white !important;
    }
    
    /* Non-active states with high specificity */
    .kpromo-player-grid .feedback-controls .feedback-btn.like-btn:not(.active) svg,
    .kpromo-player-grid .feedback-controls .feedback-btn.dislike-btn:not(.active) svg {
        fill: none !important;
        stroke: currentColor !important;
        stroke-width: 2 !important;
    }
    
    .kpromo-player-grid .feedback-controls .feedback-btn.like-btn:not(.active) .like-count,
    .kpromo-player-grid .feedback-controls .feedback-btn.dislike-btn:not(.active) .dislike-count {
        color: rgba(255, 255, 255, 0.8) !important;
        display: inline-block !important; /* ensure visible */
    }
}

/* =============================================
   MINIMAL PLAYER LAYOUT
   ============================================= */
.kpromo-player-minimal {
    background: var(--background-color, var(--kpromo-background));
    color: var(--text-color, var(--kpromo-text));
    border-radius: var(--kpromo-border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.minimal-content {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.minimal-artwork {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.minimal-artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.minimal-info {
    flex: 1;
    min-width: 0;
}

.minimal-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--text-color, var(--kpromo-text));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.minimal-artist {
    font-size: 14px;
    margin: 0;
    color: var(--secondary-color, var(--kpromo-secondary));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.minimal-play-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color, var(--kpromo-primary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--kpromo-transition);
}

.minimal-play-btn:hover {
    transform: scale(1.05);
}

.minimal-play-btn svg {
    width: 20px;
    height: 20px;
}

.minimal-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
}

.progress-bar {
    height: 100%;
    background: var(--primary-color, var(--kpromo-primary));
    width: 0%;
    transition: width 0.1s linear;
}

.minimal-time {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.minimal-progress-bar {
    flex: 1;
    margin: 0 12px;
}

.minimal-progress-bar .progress-track {
    height: var(--progress-bar-height, 4px);
    background: var(--progress-bar-bg-color, rgba(255, 255, 255, 0.1));
    border-radius: calc(var(--progress-bar-height, 4px) / 2);
    cursor: pointer;
    position: relative;
}

.minimal-progress-bar .progress-fill {
    height: 100%;
    background: var(--progress-bar-color, var(--kpromo-primary));
    border-radius: calc(var(--progress-bar-height, 4px) / 2);
    width: 0%;
    transition: width 0.1s linear;
}

.minimal-label {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2px;
}

@media (max-width: 767px) {
    .kpromo-player-minimal {
        padding: 16px;
    }
    
    .minimal-content {
        gap: 12px;
    }
    
    .minimal-artwork {
        width: 50px;
        height: 50px;
    }
    
    .minimal-time {
        display: none; /* Hide on very small screens */
    }
}

/* =============================================
   PLAYER STATES
   ============================================= */
.kpromo-player.is-loading {
    opacity: 0.7;
    pointer-events: none;
}

.kpromo-player.is-playing .icon-play {
    display: none;
}

.kpromo-player.is-playing .icon-pause {
    display: block !important;
}

.kpromo-player:not(.is-playing) .icon-pause {
    display: none;
}

/* Error state */
.kpromo-player-error {
    background: #ff4444;
    color: white;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes kpromo-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes kpromo-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes kpromo-fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.kpromo-player.is-loading .artwork-image {
    animation: kpromo-pulse 2s infinite;
}

/* =============================================
   ACCESSIBILITY
   ============================================= */
@media (prefers-reduced-motion: reduce) {
    .kpromo-player *,
    .kpromo-player *::before,
    .kpromo-player *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .kpromo-player {
        border: 2px solid;
    }
    
    .kpromo-player button {
        border: 1px solid;
    }
}

/* Focus indicators for keyboard navigation */
.kpromo-player button:focus-visible {
    outline: 3px solid var(--kpromo-primary);
    outline-offset: 2px;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =============================================
   PRINT STYLES
   ============================================= */
@media print {
    .kpromo-player {
        break-inside: avoid;
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    .grid-controls,
    .grid-cta,
    .visualizer-overlay,
    .waveform-display {
        display: none !important;
    }
}

/* =============================================
   DYNAMIC VISUALIZER SPACING
   ============================================= */
.kpromo-player[style*="--visualizer-top-spacing"] .visualizer-overlay {
    top: var(--visualizer-top-spacing, 0px);
}

.kpromo-player[style*="--visualizer-bottom-spacing"] .visualizer-overlay {
    bottom: var(--visualizer-bottom-spacing, 0px);
}

/* Aggiorna l'altezza del visualizer per rispettare i margini */
.kpromo-player[style*="--visualizer-top-spacing"][style*="--visualizer-bottom-spacing"] .visualizer-overlay {
    height: calc(100% - var(--visualizer-top-spacing, 0px) - var(--visualizer-bottom-spacing, 0px));
}

/* Opzione per disabilitare completamente i controlli volume */
.kpromo-player .volume-control {
    transition: var(--kpromo-transition-fast);
}

.kpromo-player[data-volume-disabled="true"] .volume-control {
    display: none !important;
} 

/* Hide volume slider globally */
.volume-slider {
    display: none !important;
}

/* Remove extra gap when slider is hidden */
.volume-control {
    gap: 0 !important;
} 

/* Universal active states for feedback buttons (applies to grid & minimal layouts) */
.feedback-btn.like-btn.active {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24) !important;
    border-color: #ff6b6b !important;
    color: white !important;
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.3) !important;
}

.feedback-btn.like-btn.active svg {
    fill: white !important;
    stroke: none !important;
    transform: scale(1.1) !important;
}

.feedback-btn.like-btn.active .like-count {
    color: white !important;
}

.feedback-btn.dislike-btn.active {
    background: linear-gradient(135deg, #a55eea, #8854d0) !important;
    border-color: #a55eea !important;
    color: white !important;
    box-shadow: 0 4px 16px rgba(165, 94, 234, 0.3) !important;
}

.feedback-btn.dislike-btn.active svg {
    fill: white !important;
    stroke: none !important;
    transform: scale(1.1) !important;
}

.feedback-btn.dislike-btn.active .dislike-count {
    color: white !important;
}

/* Non-active counts default color */
.feedback-btn.like-btn:not(.active) .like-count,
.feedback-btn.dislike-btn:not(.active) .dislike-count {
    color: rgba(255, 255, 255, 0.8);
} 

/* === KPromoSender 2.0.89 Custom Color Overrides === */
.kpromo-player .grid-title,
.kpromo-player .minimal-title {
    color: var(--primary-color, var(--kpromo-primary)) !important;
}

/* Feedback buttons use secondary color when active */
.feedback-btn.like-btn.active,
.feedback-btn.dislike-btn.active {
    background: var(--secondary-color, var(--kpromo-secondary)) !important;
    border-color: var(--secondary-color, var(--kpromo-secondary)) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25) !important;
}

.feedback-btn.like-btn.active svg,
.feedback-btn.dislike-btn.active svg {
    fill: #ffffff !important;
    stroke: none !important;
}

.feedback-btn.like-btn.active .like-count,
.feedback-btn.dislike-btn.active .dislike-count {
    color: #ffffff !important;
}

/* Ensure counts are always visible on desktop */
@media (min-width: 768px) {
  .kpromo-player-grid .feedback-controls .feedback-btn .like-count,
  .kpromo-player-grid .feedback-controls .feedback-btn .dislike-count {
      display: inline-block !important;
      opacity: 1 !important;
      visibility: visible !important;
  }
}

/* Volume icon default = text color; muted = secondary color */
.volume-btn .icon-volume {
    fill: var(--text-color, var(--kpromo-text)) !important;
}

.volume-btn.is-muted .icon-volume {
    fill: var(--secondary-color, var(--kpromo-secondary)) !important;
} 

/* === Feedback buttons default style === */
.feedback-btn.like-btn,
.feedback-btn.dislike-btn {
    background: rgba(255,255,255,0.1) !important;
    border-color: var(--text-color, var(--kpromo-text)) !important;
    color: var(--text-color, var(--kpromo-text)) !important;
}

.feedback-btn.like-btn svg,
.feedback-btn.dislike-btn svg {
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
}

.feedback-btn.like-btn .like-count,
.feedback-btn.dislike-btn .dislike-count {
    color: currentColor !important;
    display: inline-block !important;
}

/* Active state already defined with secondary; ensure takes precedence */
.feedback-btn.like-btn.active,
.feedback-btn.dislike-btn.active {
    background: var(--secondary-color, var(--kpromo-secondary)) !important;
    border-color: var(--secondary-color, var(--kpromo-secondary)) !important;
    color: #ffffff !important;
}

.feedback-btn.like-btn.active svg,
.feedback-btn.dislike-btn.active svg {
    fill: #ffffff !important;
    stroke: none !important;
}

.feedback-btn.like-btn.active .like-count,
.feedback-btn.dislike-btn.active .dislike-count {
    color: #ffffff !important;
} 