/* Audio Samples Section Styles */
.audio-samples-section {
    background: var(--bg-light);
    color: var(--text-dark);
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.audio-samples-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="music-pattern" x="0" y="0" width="30" height="30" patternUnits="userSpaceOnUse"><circle cx="15" cy="15" r="1.5" fill="rgba(99,102,241,0.08)"/><circle cx="5" cy="5" r="1" fill="rgba(99,102,241,0.05)"/><circle cx="25" cy="8" r="0.8" fill="rgba(99,102,241,0.06)"/></pattern></defs><rect width="100" height="100" fill="url(%23music-pattern)"/></svg>');
    opacity: 1;
    pointer-events: none;
}

.audio-samples-section .container {
    position: relative;
    z-index: 1;
}

.audio-samples-section h2 {
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 1rem;
    font-size: 2.5rem;
}

.audio-samples-section .section-subtitle {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 1.2rem;
    color: var(--text-light);
}

.samples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.sample-card {
    background: var(--bg-white);
    border-radius: 20px;
    padding: 2rem;
    color: var(--text-dark);
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.sample-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: var(--progress, 0%);
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    transition: width 0.1s ease;
    border-radius: 2px;
}

.sample-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.15);
}

.sample-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.sample-play-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
    flex-shrink: 0;
}

.sample-play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.35);
}

.sample-play-btn.playing {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25); }
    50% { box-shadow: 0 8px 30px rgba(99, 102, 241, 0.45); }
    100% { box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25); }
}

.play-icon {
    font-size: 1.5rem;
    color: white;
}

.sample-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.3rem;
    color: var(--text-dark);
}

.sample-meta {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
}

.sample-description {
    margin: 1rem 0;
    color: var(--text-light);
    line-height: 1.6;
    font-style: italic;
}

.sample-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.sample-tag {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.audio-player {
    margin-top: 1rem;
    border-radius: 10px;
    overflow: hidden;
    min-height: 60px;
}

/* Plyr Audio Player - Complete Redesign */
.plyr {
    border-radius: 12px;
    /* overflow: hidden; */
    font-family: inherit;
    width: 100%;
}

.plyr__progress__buffer {
    display: none;
}

.plyr--audio .plyr__controls {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    /* gap: 12px; */
    min-height: 60px;
    flex-wrap: nowrap;
    width: 100%;
    box-sizing: border-box;
}

/* Remove overlay controls */
.plyr__control--overlaid {
    display: none !important;
}

/* Play/Pause button */
.plyr__control[data-plyr="play"] {
    color: var(--text-dark) !important;
    background: transparent !important;
    border: none !important;
    border-radius: 50% !important;
    padding: 8px !important;
    margin: 0 !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.plyr__control[data-plyr="play"]:hover {
    background: var(--primary-color) !important;
    color: white !important;
    transform: scale(1.1);
}

.plyr__control[data-plyr="play"] svg {
    width: 20px !important;
    height: 20px !important;
}

/* Time displays */
.plyr__time {
    color: var(--text-light) !important;
    font-weight: 500 !important;
    font-size: 0.85rem !important;
    flex-shrink: 0;
    min-width: auto !important;
    padding: 0 4px !important;
}

.plyr__time--current {
    order: 1;
    display: none;
}

.plyr__time--duration {
    order: 3;
    display: none;
}

.plyr__time + .plyr__time::before {
    content: ' / ';
    color: var(--text-light);
}

/* Progress Bar - Completely Redesigned */
.plyr__progress {
    flex: 1 !important;
    margin: 0 8px !important;
    min-width: 100px !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    order: 2;
    height: 20px !important; 
    margin-left: 0px !important;
    padding-left: 0px !important;
}

.plyr__progress input[type="range"] {
    width: 100% !important;
    height: 20px !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    cursor: pointer !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    z-index: 2 !important;
}

/* Create custom track background */
.plyr__progress::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    transform: translateY(-50%);
    z-index: 1;
    pointer-events: none;
}

/* Create progress fill effect */
.plyr__progress::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: var(--plyr-progress, 0%);
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
    transform: translateY(-50%);
    z-index: 1;
    pointer-events: none;
    transition: width 0.1s ease;
}

/* Webkit browsers (Chrome, Safari, Edge) */
.plyr__progress input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 16px !important;
    height: 16px !important;
    background: var(--primary-color) !important;
    border-radius: 50% !important;
    border: 2px solid white !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 3 !important;
    margin-top: -6px !important;
}

.plyr__progress input[type="range"]::-webkit-slider-runnable-track {
    width: 100% !important;
    height: 4px !important;
    background: transparent !important;
    border-radius: 2px !important;
    border: none !important;
    cursor: pointer !important;
}

/* Additional webkit support */
.plyr__progress input[type="range"]:focus::-webkit-slider-thumb {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3), 0 2px 4px rgba(0,0,0,0.2) !important;
}

/* Firefox */
.plyr__progress input[type="range"]::-moz-range-thumb {
    width: 16px !important;
    height: 16px !important;
    background: var(--primary-color) !important;
    border-radius: 50% !important;
    border: 2px solid white !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 3 !important;
}

.plyr__progress input[type="range"]::-moz-range-track {
    width: 100% !important;
    height: 4px !important;
    background: transparent !important;
    border-radius: 2px !important;
    border: none !important;
}

.plyr__progress input[type="range"]::-moz-range-progress {
    height: 4px !important;
    background: var(--primary-color) !important;
    border-radius: 2px !important;
}

/* Volume control */
.plyr__volume {
    display: flex !important;
    align-items: center !important;
    max-width: 100px !important;
    flex-shrink: 0;
    order: 4;
    gap: 4px !important;
}

.plyr__control[data-plyr="mute"] {
    color: var(--text-dark) !important;
    background: transparent !important;
    border: none !important;
    border-radius: 50% !important;
    padding: 6px !important;
    margin: 0 !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.plyr__control[data-plyr="mute"]:hover {
    background: var(--primary-color) !important;
    color: white !important;
}

.plyr__control[data-plyr="mute"] svg {
    width: 16px !important;
    height: 16px !important;
}

/* Volume slider styling */
.plyr__volume input[type="range"] {
    width: 60px !important;
    height: 20px !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    cursor: pointer !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    z-index: 2 !important;
}

/* Create custom volume track */
.plyr__volume {
    position: relative !important;
}

.plyr__volume::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 0;
    width: 60px;
    height: 3px;
    background: var(--border-color);
    border-radius: 1.5px;
    transform: translateY(-50%);
    z-index: 1;
    pointer-events: none;
}

/* Volume progress fill */
.plyr__volume::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    margin-left: 35px;
    width: calc(60px * var(--plyr-volume, 1));
    height: 3px;
    background: var(--primary-color);
    border-radius: 1.5px;
    transform: translateY(-50%);
    z-index: 1;
    pointer-events: none;
    transition: width 0.1s ease;
}

.plyr__volume input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 12px !important;
    height: 12px !important;
    background: var(--primary-color) !important;
    border-radius: 50% !important;
    border: 1px solid white !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 2 !important;
    margin-top: -4.5px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2) !important;
}

.plyr__volume input[type="range"]::-webkit-slider-runnable-track {
    height: 3px !important;
    background: transparent !important;
    border-radius: 1.5px !important;
    border: none !important;
    cursor: pointer !important;
}

.plyr__volume input[type="range"]:focus::-webkit-slider-thumb {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3), 0 1px 3px rgba(0,0,0,0.2) !important;
}

/* Firefox volume slider */
.plyr__volume input[type="range"]::-moz-range-thumb {
    width: 12px !important;
    height: 12px !important;
    background: var(--primary-color) !important;
    border-radius: 50% !important;
    border: 1px solid white !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 2 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2) !important;
}

.plyr__volume input[type="range"]::-moz-range-track {
    height: 3px !important;
    background: transparent !important;
    border-radius: 1.5px !important;
    border: none !important;
}

.plyr__volume input[type="range"]::-moz-range-thumb {
    width: 12px !important;
    height: 12px !important;
    background: var(--primary-color) !important;
    border-radius: 50% !important;
    border: 1px solid white !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 2 !important;
}

.plyr__volume input[type="range"]::-moz-range-track {
    height: 3px !important;
    background: transparent !important;
    border-radius: 1.5px !important;
    border: none !important;
}

/* Better mobile controls */
@media (max-width: 768px) {
    .plyr--audio .plyr__controls {
        padding: 8px 12px;
        gap: 8px;
        min-height: 50px;
    }
    
    .plyr__volume {
        max-width: 70px !important;
    }
    
    .plyr__volume input[type="range"] {
        width: 40px !important;
        min-width: 40px !important;
    }
    
    .plyr__volume::before {
        width: 40px;
    }
    
    .plyr__volume::after {
        width: calc(40px * var(--plyr-volume, 1));
        margin-left: 30px;
    }
    
    .plyr__control[data-plyr="play"] {
        width: 36px !important;
        height: 36px !important;
    }
    
    .plyr__control[data-plyr="play"] svg {
        width: 18px !important;
        height: 18px !important;
    }
    
    .plyr__control[data-plyr="mute"] {
        width: 28px !important;
        height: 28px !important;
    }
    
    .plyr__control[data-plyr="mute"] svg {
        width: 14px !important;
        height: 14px !important;
    }
    
    .plyr__time {
        font-size: 0.8rem !important;
    }
}

/* Chrome-specific fixes */
@supports (-webkit-appearance: none) {
    .plyr__progress input[type="range"] {
        background: transparent !important;
        -webkit-appearance: none !important;
        appearance: none !important;
    }
    
    .plyr__volume input[type="range"] {
        background: transparent !important;
        -webkit-appearance: none !important;
        appearance: none !important;
    }
    
    /* Ensure proper stacking for webkit */
    .plyr__progress input[type="range"]::-webkit-slider-thumb {
        position: relative !important;
        z-index: 10 !important;
    }
    
    .plyr__volume input[type="range"]::-webkit-slider-thumb {
        position: relative !important;
        z-index: 10 !important;
    }
}

/* Force Chrome to respect our custom styling */
.plyr input[type="range"] {
    -webkit-appearance: none !important;
    appearance: none !important;
}

.plyr input[type="range"]::-webkit-slider-track {
    background: transparent !important;
    border: none !important;
}

.plyr input[type="range"]::-webkit-slider-runnable-track {
    background: transparent !important;
    border: none !important;
}



.cta-section {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
}

.cta-section h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.cta-section p {
    margin-bottom: 2rem;
    color: var(--text-light);
}

.btn-white {
    background: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

.btn-white:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.35);
    color: white;
    text-decoration: none;
}

/* Responsive design */
@media (max-width: 768px) {
    .audio-samples-section {
        padding: 3rem 0;
    }
    
    .audio-samples-section h2 {
        font-size: 2rem;
    }
    
    .samples-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .sample-card {
        padding: 1.5rem;
    }
    
    .sample-play-btn {
        width: 50px;
        height: 50px;
    }
    
    .play-icon {
        font-size: 1.2rem;
    }
}

/* Loading states */
.sample-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.sample-card.loading .sample-play-btn {
    animation: spin 1s linear infinite;
}

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

/* Visual enhancements */
.audio-samples-section {
    background-attachment: fixed;
}

.sample-card {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.sample-card:hover .sample-info {
    transform: translateZ(10px);
}

.sample-card:active {
    transform: translateY(-2px) scale(0.98);
}

/* Success animations */
@keyframes success-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.sample-card.just-played {
    animation: success-pulse 0.6s ease;
}

.sample-card.currently-playing {
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.25);
    border: 2px solid rgba(99, 102, 241, 0.2);
}

.sample-card.currently-playing::before {
    animation: progress-glow 2s ease-in-out infinite;
}

@keyframes progress-glow {
    0%, 100% { box-shadow: 0 0 8px rgba(99, 102, 241, 0.4); }
    50% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.6); }
}

/* Audio error handling */
.audio-error-message {
    animation: slideInFromRight 0.3s ease;
}

@keyframes slideInFromRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Focus states for accessibility */
.sample-card:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.sample-play-btn:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Enhanced mobile experience */
@media (max-width: 640px) {
    .audio-samples-section {
        padding: 2rem 0;
    }
    
    .sample-card {
        padding: 1rem;
        border-radius: 15px;
    }
    
    .sample-header {
        margin-bottom: 1rem;
    }
    
    .sample-play-btn {
        width: 45px;
        height: 45px;
        margin-right: 0.75rem;
    }
    
    .play-icon {
        font-size: 1rem;
    }
    
    .sample-info h3 {
        font-size: 1.1rem;
    }
    
    .sample-meta {
        font-size: 0.8rem;
    }
    
    .sample-tags {
        gap: 0.25rem;
    }
    
    .sample-tag {
        padding: 0.2rem 0.5rem;
        font-size: 0.7rem;
    }
}

/* Print styles */
@media print {
    .audio-samples-section {
        display: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .sample-card {
        border: 2px solid #000;
        background: #fff;
    }
    
    .sample-play-btn {
        border: 2px solid #000;
    }
    
    .sample-tag {
        border: 1px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .sample-card,
    .sample-play-btn,
    .play-icon {
        transition: none;
        animation: none;
    }
    
    .sample-card:hover {
        transform: none;
    }
    
    .sample-play-btn:hover {
        transform: none;
    }
}

/* Dark mode support - keep light theme even in dark mode preference */
@media (prefers-color-scheme: dark) {
    .audio-samples-section {
        background: var(--bg-light);
        color: var(--text-dark);
    }
    
    .sample-card {
        background: var(--bg-white);
        color: var(--text-dark);
        border: 1px solid var(--border-color);
    }
    
    .sample-info h3 {
        color: var(--text-dark);
    }
    
    .sample-meta,
    .sample-description {
        color: var(--text-light);
    }
    
    .plyr--audio .plyr__controls {
        background: var(--bg-white);
        border: 1px solid var(--border-color);
    }
    
    .cta-section h3 {
        color: var(--text-dark);
    }
    
    .cta-section p {
        color: var(--text-light);
    }
}

/* Loading state improvements */
.sample-card.loading .sample-play-btn .play-icon {
    animation: spin 1s linear infinite;
}

.sample-card.loading .sample-info {
    opacity: 0.6;
}

.sample-card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    pointer-events: none;
}

/* Tooltip enhancements */
.sample-play-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 0.8rem;
    z-index: 1000;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.plyr__controls .plyr__controls__item.plyr__progress__container {
    padding-left: 0px !important;
}

.plyr__controls .plyr__controls__item {
    margin-left: 0px !important;
}

/* Additional Chrome compatibility fixes */
.plyr--audio .plyr__controls {
    align-items: center !important;
    justify-content: space-between !important;
}

.plyr__progress {
    position: relative !important;
    overflow: visible !important;
}

.plyr__volume {
    position: relative !important;
    overflow: visible !important;
}

/* Ensure webkit sliders are properly positioned */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .plyr__progress input[type="range"] {
        margin: 0 !important;
        padding: 0 !important;
        vertical-align: middle !important;
    }
    
    .plyr__volume input[type="range"] {
        margin: 0 !important;
        padding: 0 !important;
        vertical-align: middle !important;
    }
}