/* Africa Science Podcast Player - Frontend Styles */
/* All styles are scoped to .asp-podcast-container to prevent conflicts */

.asp-podcast-container {
    max-width: 600px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.asp-podcast-player {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #eaeef3;
}

/* Header with Thumbnail at the top */
.asp-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.asp-thumbnail-wrapper {
    flex-shrink: 0;
}

.asp-cover-image {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    object-fit: cover;
    background: #f0f2f5;
    display: block;
}

.asp-cover-placeholder {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    background: #f0f2f5;
}

.asp-meta {
    flex: 1;
    min-width: 0;
}

.asp-show-name {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #7a8a9e;
    font-weight: 600;
}

.asp-episode-title {
    margin: 4px 0 0;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    color: #1a2332;
}

/* Player Wrapper */
.asp-player-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0 10px;
    background: #f7f9fc;
    border-radius: 12px;
    padding: 6px 10px;
    border: 1px solid #e8ecf2;
}

.asp-player-control {
    flex: 1;
    min-width: 0;
}

.asp-player-control audio {
    width: 100%;
    height: 38px;
    outline: none;
    border-radius: 20px;
}

/* Description */
.asp-description {
    font-size: 14px;
    color: #4a5a6e;
    line-height: 1.5;
    margin: 10px 0 12px;
    padding: 0 4px;
}

/* Controls */
.asp-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e8ecf2;
    flex-wrap: wrap;
}

/* Dropdown */
.asp-dropdown {
    position: relative;
}

.asp-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f0f2f5;
    border: none;
    border-radius: 20px;
    padding: 6px 14px 6px 10px;
    font-size: 12px;
    font-weight: 500;
    color: #1a2332;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}

.asp-dropdown-toggle:hover {
    background: #e4e8ef;
}

.asp-arrow {
    transition: transform 0.25s ease;
}

.asp-dropdown-list {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    min-width: 260px;
    max-height: 300px;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    padding: 6px 0;
    margin: 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.25s ease;
    z-index: 1000;
    border: 1px solid #e8ecf2;
}

.asp-dropdown-list.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.asp-episode-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.15s;
    border-left: 3px solid transparent;
}

.asp-episode-item:hover {
    background: #f5f7fa;
}

.asp-episode-item.active {
    background: #f0f5ff;
    border-left-color: #1a5276;
}

.asp-ep-thumb {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: #e8ecf2;
}

.asp-ep-name {
    flex: 1;
    font-size: 13px;
    line-height: 1.3;
    color: #1a2332;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.asp-playing {
    color: #1a5276;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    animation: asp-pulse 1.5s ease-in-out infinite;
}

@keyframes asp-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Share */
.asp-share {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #7a8a9e;
    flex-wrap: wrap;
}

.asp-share span {
    font-weight: 500;
    letter-spacing: 0.3px;
}

.asp-share a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f0f2f5;
    color: #4a5a6e;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.15s;
}

.asp-share a:hover {
    transform: scale(1.05);
}

.asp-share-twitter:hover {
    background: #000000;
    color: #ffffff;
}

.asp-share-linkedin:hover {
    background: #0a66c2;
    color: #ffffff;
}

/* Placeholder */
.asp-player-placeholder {
    padding: 24px;
    text-align: center;
    background: #f5f7fa;
    border-radius: 12px;
    color: #7a8a9e;
    font-size: 14px;
    max-width: 600px;
    margin: 20px auto;
}

/* Responsive */
@media (max-width: 500px) {
    .asp-podcast-player {
        padding: 16px;
    }
    
    .asp-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .asp-cover-image,
    .asp-cover-placeholder {
        width: 100%;
        max-width: 100px;
        height: auto;
        aspect-ratio: 1/1;
    }
    
    .asp-episode-title {
        font-size: 15px;
    }
    
    .asp-player-wrapper {
        flex-direction: column;
        align-items: stretch;
        padding: 6px;
    }
    
    .asp-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .asp-dropdown {
        width: 100%;
    }
    
    .asp-dropdown-toggle {
        width: 100%;
        justify-content: center;
    }
    
    .asp-dropdown-list {
        min-width: 100%;
        max-height: 220px;
        bottom: calc(100% + 4px);
    }
    
    .asp-share {
        justify-content: center;
    }
}

/* Scrollbar */
.asp-dropdown-list::-webkit-scrollbar {
    width: 5px;
}

.asp-dropdown-list::-webkit-scrollbar-track {
    background: transparent;
}

.asp-dropdown-list::-webkit-scrollbar-thumb {
    background: #d0d7de;
    border-radius: 3px;
}

.asp-dropdown-list::-webkit-scrollbar-thumb:hover {
    background: #b0b8c0;
}