/**
 * Audio Preview for WooCommerce - Modern Frontend Styles
 * Neutral color scheme that works with any theme
 * 
 * @package    Wc_Audio_Preview
 * @subpackage Wc_Audio_Preview/public
 */

/*--------------------------------------------------------------
# Audio Preview Container
--------------------------------------------------------------*/
.wcap-audio-preview-container {
    margin: 20px 0;
    padding: 20px !important;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.wcap-preview-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px 0;
    font-size: 1.1em;
    font-weight: 600;
    color: inherit;
}

.wcap-icon {
    opacity: 0.6;
}

/*--------------------------------------------------------------
# Preview List
--------------------------------------------------------------*/
.wcap-preview-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/*--------------------------------------------------------------
# Preview Item
--------------------------------------------------------------*/
.wcap-preview-item {
    position: relative;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.wcap-preview-item:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.15);
}

.wcap-preview-item.playing {
    background: rgba(255, 255, 255, 1);
    border-color: currentColor;
}

/*--------------------------------------------------------------
# Preview Button
--------------------------------------------------------------*/
.wcap-preview-button {
    width: 100%;
    padding: 14px 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s ease;
    text-align: left;
    color: inherit;
    border: 0 !important;
}

.wcap-preview-button:hover,
.wcap-preview-button:focus {
    color: inherit !important;
    background: rgba(0, 0, 0, 0.02) !important;
}

.wcap-preview-button:focus {
    outline: 2px solid currentColor;
    outline-offset: -2px;
}

.wcap-button-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

/*--------------------------------------------------------------
# Icons
--------------------------------------------------------------*/
.wcap-play-icon,
.wcap-pause-icon,
.wcap-loading-spinner,
.wcap-icon-wrap {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: currentColor;
    color: inherit;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.wcap-play-icon svg,
.wcap-pause-icon svg {
    width: 18px;
    height: 18px;
    fill: white;
}

.wcap-preview-button:hover .wcap-play-icon,
.wcap-preview-button:hover .wcap-pause-icon {
    transform: scale(1.1);
}

/*--------------------------------------------------------------
# Loading Spinner
--------------------------------------------------------------*/
.wcap-spinner {
    animation: spin 1s linear infinite;
}

.wcap-spinner-circle {
    stroke: white;
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes dash {
    0% {
        stroke-dashoffset: 50;
    }
    50% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: -50;
    }
}

/*--------------------------------------------------------------
# Preview Info
--------------------------------------------------------------*/
.wcap-preview-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    position: relative;
    z-index: 0;
}

.wcap-preview-name {
    font-size: 1em;
    font-weight: 500;
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wcap-preview-badge {
    flex-shrink: 0;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
    opacity: 0.7;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: auto;
}

/*--------------------------------------------------------------
# Progress Container
--------------------------------------------------------------*/
.wcap-progress-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 48px;
}

.wcap-progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.wcap-progress-fill {
    height: 100%;
    background: currentColor;
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s ease;
}

.wcap-progress-bar:hover {
    height: 6px;
}

.wcap-time {
    flex-shrink: 0;
    font-size: 0.85em;
    opacity: 0.6;
    font-variant-numeric: tabular-nums;
    min-width: 80px;
    text-align: right;
}

/*--------------------------------------------------------------
# Audio Element (Hidden)
--------------------------------------------------------------*/
.wcap-audio-element {
    display: none;
}

/*--------------------------------------------------------------
# States
--------------------------------------------------------------*/
.wcap-preview-item.loading .wcap-preview-button {
    pointer-events: none;
    opacity: 0.7;
}

.wcap-preview-item.error .wcap-preview-button {
    background: rgba(255, 0, 0, 0.05);
}

.wcap-preview-item.error .wcap-preview-name {
    color: #dc3545;
}

/*--------------------------------------------------------------
# Single Audio Preview Style
--------------------------------------------------------------*/
/* .wcap-preview-list:has(.wcap-preview-item:only-child) {
    gap: 0;
}

.wcap-preview-list:has(.wcap-preview-item:only-child) .wcap-preview-item {
    border: none;
    background: transparent;
}

.wcap-preview-list:has(.wcap-preview-item:only-child) .wcap-preview-button {
    background: currentColor;
    border-radius: 6px;
    padding: 12px 18px;
}

.wcap-preview-list:has(.wcap-preview-item:only-child) .wcap-preview-name {
    color: white;
    mix-blend-mode: difference;
}

.wcap-preview-list:has(.wcap-preview-item:only-child) .wcap-play-icon,
.wcap-preview-list:has(.wcap-preview-item:only-child) .wcap-pause-icon {
    background: rgba(255, 255, 255, 0.2);
}

.wcap-preview-list:has(.wcap-preview-item:only-child) .wcap-time {
    color: white;
    mix-blend-mode: difference;
    opacity: 0.8;
}

.wcap-preview-list:has(.wcap-preview-item:only-child) .wcap-progress-bar {
    background: rgba(255, 255, 255, 0.2);
}

.wcap-preview-list:has(.wcap-preview-item:only-child) .wcap-progress-fill {
    background: white;
}

.wcap-preview-list:has(.wcap-preview-item:only-child) .wcap-preview-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
} */

/*--------------------------------------------------------------
# Theme Compatibility
--------------------------------------------------------------*/
.wcap-audio-preview-container * {
    box-sizing: border-box;
}

.wcap-audio-preview-container button {
    width: 100%;
    font-family: inherit;
    font-size: inherit;
    line-height: 1.4;
}

/*--------------------------------------------------------------
# Responsive Design
--------------------------------------------------------------*/
@media (max-width: 768px) {
    .wcap-audio-preview-container {
        padding: 15px;
        margin: 15px 0;
    }
    
    .wcap-preview-title {
        font-size: 1em;
        margin-bottom: 15px;
    }
    
    .wcap-preview-button {
        padding: 12px 14px;
    }
    
    .wcap-play-icon,
    .wcap-pause-icon,
    .wcap-loading-spinner {
        width: 32px;
        height: 32px;
    }
    
    .wcap-play-icon svg,
    .wcap-pause-icon svg {
        width: 16px;
        height: 16px;
    }
    
    .wcap-preview-name {
        font-size: 0.95em;
    }
    
    .wcap-progress-container {
        padding: 0 44px;
    }
    
    .wcap-time {
        font-size: 0.8em;
        min-width: 70px;
    }
}

@media (max-width: 480px) {
    .wcap-preview-badge {
        display: none;
    }
    
    .wcap-progress-container {
        flex-wrap: wrap;
        padding: 0;
    }
    
    .wcap-progress-bar {
        order: 2;
        width: 100%;
    }
    
    .wcap-time {
        order: 1;
        width: 100%;
        text-align: left;
        margin-bottom: 8px;
    }
}

/*--------------------------------------------------------------
# Print Styles
--------------------------------------------------------------*/
@media print {
    .wcap-audio-preview-container {
        display: none;
    }
}

.inactive {
    display: none !important;
}
/* .custom-artwork-size{
    width: 10% !important;
    height: 10% !important;
} */