/**
 * Article Podcast Player - Frontend Styles
 * Styling for inline and sticky podcast players
 *
 * @package SportPersonalities
 * @since 1.0.0
 */

/* ============================================
   INLINE PLAYER
   ============================================ */

.sp-podcast-player-inline {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border: 1px solid #dbeafe;
    border-radius: 16px;
    padding: 20px;
    margin: 30px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.sp-podcast-player-inline:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Header */
.sp-podcast-player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.sp-podcast-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sp-podcast-icon {
    font-size: 20px;
}

.sp-podcast-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.sp-podcast-duration-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #6B7280;
    background: white;
    padding: 4px 12px;
    border-radius: 20px;
}

.sp-podcast-time-icon {
    font-size: 14px;
}

/* Controls */
.sp-podcast-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.sp-podcast-play-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #b60f0a;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    color: white;
}

.sp-podcast-play-btn:hover {
    background: #9e0c08;
    transform: scale(1.05);
}

.sp-podcast-play-btn:active {
    transform: scale(0.98);
}

.sp-podcast-play-btn.playing .sp-play-icon {
    display: none;
}

.sp-podcast-play-btn.playing .sp-pause-icon {
    display: block !important;
}

/* Progress Bar */
.sp-podcast-progress-container {
    flex: 1;
    display: flex;
    align-items: center;
}

.sp-podcast-progress-bar {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    transition: height 0.2s ease;
}

.sp-podcast-progress-bar:hover {
    height: 8px;
}

.sp-podcast-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #b60f0a 0%, #d63638 100%);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s ease;
    position: relative;
}

.sp-podcast-progress-handle {
    width: 16px;
    height: 16px;
    background: #b60f0a;
    border: 3px solid white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    left: 0%;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.sp-podcast-progress-bar:hover .sp-podcast-progress-handle {
    opacity: 1;
}

/* Time Display */
.sp-podcast-time-display {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #4b5563;
    white-space: nowrap;
    min-width: 100px;
    text-align: center;
}

.sp-time-separator {
    margin: 0 2px;
}

/* Speed Button */
.sp-podcast-speed-btn {
    width: 48px;
    height: 32px;
    background: white;
    border: 1px solid #dbeafe;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
}

.sp-podcast-speed-btn:hover {
    background: #f0f4ff;
    border-color: #b60f0a;
}

/* Speed Menu */
.sp-podcast-speed-menu {
    position: absolute;
    background: white;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 4px;
    z-index: 100;
    margin-top: 4px;
}

.sp-speed-option {
    display: block;
    width: 100%;
    padding: 8px 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.sp-speed-option:hover {
    background: #f0f4ff;
}

.sp-speed-option.active {
    background: #b60f0a;
    color: white;
}

/* Volume Controls */
.sp-podcast-volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sp-podcast-volume-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #4b5563;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-podcast-volume-btn:hover {
    color: #b60f0a;
}

.sp-podcast-volume-btn.muted .sp-volume-icon {
    display: none;
}

.sp-podcast-volume-btn.muted .sp-mute-icon {
    display: block !important;
}

.sp-podcast-volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #e9ecef;
    border-radius: 2px;
    outline: none;
}

.sp-podcast-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #b60f0a;
    border-radius: 50%;
    cursor: pointer;
}

.sp-podcast-volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #b60f0a;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Download Button */
.sp-podcast-download-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #4b5563;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.sp-podcast-download-btn:hover {
    color: #b60f0a;
}

/* Footer */
.sp-podcast-footer {
    margin-top: 12px;
}

.sp-podcast-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    background: rgba(255, 243, 205, 0.5);
    border-left: 3px solid #f59e0b;
    padding: 10px 12px;
    border-radius: 6px;
}

.sp-info-icon {
    flex-shrink: 0;
    margin-top: 2px;
    color: #f59e0b;
}

.sp-podcast-disclaimer small {
    font-size: 11px;
    color: #78716c;
    line-height: 1.5;
}

/* ============================================
   STICKY PLAYER
   ============================================ */

.sp-podcast-player-sticky {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 400px;
    background: #111827;
    color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 100 !important;
    padding: 16px;
    animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sp-podcast-sticky-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sp-podcast-sticky-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
}

.sp-podcast-sticky-title {
    font-size: 13px;
    font-weight: 600;
}

/* Sticky Controls */
.sp-podcast-sticky-controls {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sp-podcast-play-btn-sticky {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #b60f0a;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    color: white;
}

.sp-podcast-play-btn-sticky:hover {
    background: #9e0c08;
    transform: scale(1.05);
}

.sp-podcast-play-btn-sticky.playing .sp-play-icon {
    display: none;
}

.sp-podcast-play-btn-sticky.playing .sp-pause-icon {
    display: block !important;
}

.sp-podcast-sticky-progress {
    flex: 1;
}

.sp-podcast-progress-bar-sticky {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
    margin-bottom: 4px;
}

.sp-podcast-progress-fill-sticky {
    height: 100%;
    background: #b60f0a;
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s ease;
}

.sp-podcast-time-display-sticky {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
}

.sp-podcast-speed-btn-sticky,
.sp-podcast-volume-btn-sticky {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-podcast-speed-btn-sticky:hover,
.sp-podcast-volume-btn-sticky:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sp-speed-text-sticky {
    font-size: 11px;
    font-weight: 600;
}

.sp-podcast-volume-btn-sticky.muted .sp-volume-icon {
    display: none;
}

.sp-podcast-volume-btn-sticky.muted .sp-mute-icon {
    display: block !important;
}

.sp-podcast-close-sticky {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sp-podcast-close-sticky:hover {
    color: white;
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

/* Tablet */
@media screen and (max-width: 768px) {
    .sp-podcast-player-inline {
        padding: 15px;
    }

    .sp-podcast-controls {
        flex-wrap: wrap;
        gap: 10px;
    }

    .sp-podcast-volume-slider {
        width: 60px;
    }

    .sp-podcast-player-sticky {
        width: calc(100% - 20px);
        left: 10px;
        right: 10px;
        bottom: 10px;
    }
}

/* Mobile */
@media screen and (max-width: 480px) {
    .sp-podcast-player-inline {
        padding: 12px;
        border-radius: 12px;
    }

    .sp-podcast-title h3 {
        font-size: 14px;
    }

    .sp-podcast-play-btn {
        width: 44px;
        height: 44px;
    }

    .sp-podcast-controls {
        gap: 8px;
    }

    .sp-podcast-time-display {
        font-size: 12px;
        min-width: 80px;
    }

    .sp-podcast-volume-container {
        display: none; /* Hide volume on mobile, use system volume */
    }

    .sp-podcast-download-btn {
        width: 28px;
        height: 28px;
    }

    .sp-podcast-disclaimer {
        padding: 8px 10px;
    }

    .sp-podcast-disclaimer small {
        font-size: 10px;
    }

    .sp-podcast-player-sticky {
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 12px 12px 0 0;
        padding: 12px;
    }

    .sp-podcast-sticky-content {
        flex-direction: column;
        gap: 8px;
    }

    .sp-podcast-sticky-info {
        width: 100%;
        justify-content: center;
    }

    .sp-podcast-sticky-controls {
        width: 100%;
    }

    .sp-podcast-close-sticky {
        position: absolute;
        top: 8px;
        right: 8px;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus indicators for keyboard navigation */
.sp-podcast-play-btn:focus,
.sp-podcast-speed-btn:focus,
.sp-podcast-volume-btn:focus,
.sp-podcast-download-btn:focus,
.sp-podcast-play-btn-sticky:focus,
.sp-podcast-speed-btn-sticky:focus,
.sp-podcast-volume-btn-sticky:focus,
.sp-podcast-close-sticky:focus {
    outline: 2px solid #b60f0a;
    outline-offset: 2px;
}

.sp-podcast-progress-bar:focus,
.sp-podcast-volume-slider:focus {
    outline: 2px solid #b60f0a;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .sp-podcast-player-inline {
        border: 2px solid #000;
    }

    .sp-podcast-play-btn {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .sp-podcast-play-btn,
    .sp-podcast-play-btn-sticky,
    .sp-podcast-speed-btn,
    .sp-podcast-volume-btn,
    .sp-podcast-download-btn {
        transition: none;
    }

    .sp-podcast-player-sticky {
        animation: none;
    }
}
