/**
 * WP Secure Audio Stream - Player Styles
 * 
 * @package WP_Secure_Audio_Stream
 */

/* =============================================
   Player Wrapper
   ============================================= */
.wsas-player-wrapper {
    background: linear-gradient(135deg, #F5F1E8 0%, #ffffff 100%);
    border: 1px solid #D4C5A9;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    font-family: Georgia, "Times New Roman", serif;
    transition: box-shadow 0.3s ease;
}

.wsas-player-wrapper:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.wsas-player-wrapper.wsas-locked {
    background: linear-gradient(135deg, #f5f5f5 0%, #ebebeb 100%);
    border-color: #ddd;
}

/* =============================================
   Thumbnail
   ============================================= */
.wsas-player-thumbnail {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.wsas-player-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =============================================
   Content
   ============================================= */
.wsas-player-content {
    flex-grow: 1;
    min-width: 0;
}

.wsas-player-title {
    margin: 0 0 8px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #2C2C2C;
}

.wsas-player-duration {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    color: #4A4A4A;
    margin-bottom: 15px;
}

/* =============================================
   Format Badge
   ============================================= */
.wsas-format-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.wsas-format-badge.wsas-format-court {
    background: #e8f5e9;
    color: #2e7d32;
}

.wsas-format-badge.wsas-format-long {
    background: #e3f2fd;
    color: #1565c0;
}

/* =============================================
   Audio Element
   ============================================= */
.wsas-player {
    margin-top: 10px;
}

.wsas-audio-element {
    width: 100%;
    height: 45px;
    border-radius: 25px;
    outline: none;
}

/* Chrome/Safari custom audio styling */
.wsas-audio-element::-webkit-media-controls-panel {
    background: linear-gradient(135deg, #F5F1E8 0%, #D4C5A9 100%);
}

.wsas-audio-element::-webkit-media-controls-current-time-display,
.wsas-audio-element::-webkit-media-controls-time-remaining-display {
    color: #2C2C2C;
}

/* Player controls */
.wsas-player-controls {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.wsas-btn-refresh-token {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.5;
    transition: opacity 0.2s;
    padding: 5px;
}

.wsas-btn-refresh-token:hover {
    opacity: 1;
}

/* =============================================
   Locked Player
   ============================================= */
.wsas-player-locked {
    position: relative;
}

.wsas-lock-overlay {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    border: 2px dashed #D4C5A9;
}

.wsas-lock-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 10px;
}

.wsas-lock-message {
    color: #4A4A4A;
    margin-bottom: 15px;
}

/* =============================================
   Buttons
   ============================================= */
.wsas-btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
}

.wsas-btn-login {
    background: #2C2C2C;
    color: #ffffff;
}

.wsas-btn-login:hover {
    background: #4A4A4A;
    color: #ffffff;
}

.wsas-btn-purchase {
    background: linear-gradient(135deg, #D4C5A9 0%, #B8A888 100%);
    color: #2C2C2C;
}

.wsas-btn-purchase:hover {
    background: linear-gradient(135deg, #B8A888 0%, #9C8E6E 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* =============================================
   Preview Section
   ============================================= */
.wsas-preview-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.wsas-preview-label {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 8px;
}

.wsas-audio-preview {
    width: 100%;
    height: 35px;
    opacity: 0.8;
}

/* =============================================
   User Podcasts Grid
   ============================================= */
.wsas-user-podcasts {
    padding: 20px 0;
}

.wsas-podcasts-title {
    font-size: 1.5rem;
    margin-bottom: 24px;
    color: #2C2C2C;
}

.wsas-podcasts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* =============================================
   Podcast Card
   ============================================= */
.wsas-podcast-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wsas-podcast-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.wsas-podcast-thumbnail {
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.wsas-podcast-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.wsas-podcast-card:hover .wsas-podcast-thumbnail img {
    transform: scale(1.05);
}

.wsas-podcast-info {
    padding: 16px;
}

.wsas-podcast-title {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    color: #2C2C2C;
    font-weight: 600;
}

.wsas-podcast-meta {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 10px;
}

.wsas-podcast-excerpt {
    font-size: 0.875rem;
    color: #4A4A4A;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wsas-podcast-player {
    padding: 0 16px 16px;
}

.wsas-podcast-player audio {
    width: 100%;
    height: 40px;
}

/* =============================================
   Notices & Errors
   ============================================= */
.wsas-notice {
    padding: 15px 20px;
    background: #f8f9fa;
    border-left: 4px solid #D4C5A9;
    border-radius: 4px;
    color: #4A4A4A;
}

.wsas-notice a {
    color: #B8A888;
    font-weight: 500;
}

.wsas-error {
    padding: 15px 20px;
    background: #fff5f5;
    border-left: 4px solid #e53935;
    border-radius: 4px;
    color: #c62828;
}

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 768px) {
    .wsas-player-wrapper {
        flex-direction: column;
        padding: 15px;
    }
    
    .wsas-player-thumbnail {
        width: 100%;
        height: 200px;
    }
    
    .wsas-podcasts-grid {
        grid-template-columns: 1fr;
    }
    
    .wsas-podcast-meta {
        flex-wrap: wrap;
    }
}

/* =============================================
   Dark Mode Support
   ============================================= */
@media (prefers-color-scheme: dark) {
    .wsas-player-wrapper {
        background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
        border-color: #444;
    }
    
    .wsas-player-title,
    .wsas-podcasts-title,
    .wsas-podcast-title {
        color: #f5f5f5;
    }
    
    .wsas-player-duration,
    .wsas-podcast-meta,
    .wsas-podcast-excerpt {
        color: #aaa;
    }
    
    .wsas-podcast-card {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .wsas-lock-overlay {
        background: rgba(30, 30, 30, 0.95);
    }
    
    .wsas-lock-message {
        color: #ccc;
    }
}

/* =============================================
   Disable Download Attempts
   ============================================= */
audio::-webkit-media-controls-download-button {
    display: none !important;
}

audio::-webkit-media-controls-overflow-menu {
    display: none !important;
}

/* Prevent text selection on player */
.wsas-player-wrapper {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.wsas-player-title,
.wsas-podcast-title {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}
