/* General Styles */
:root {
    --primary-gradient: linear-gradient(135deg, var(--bs-primary), #6610f2);
    --card-border-radius: 16px;
    --header-border-radius: 0 0 30px 30px;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Main layout and styling */
.episode-header {
    background: var(--primary-gradient);
    padding: 3rem 0;
    color: white;
    border-radius: var(--header-border-radius);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.episode-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
    z-index: 1;
    border-radius: 50%;
}

.episode-header::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 70%);
    z-index: 1;
    border-radius: 50%;
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    margin-right: 1rem;
    font-weight: 500;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.episode-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 2.25rem;
}

.episode-meta {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
}

.episode-meta .dot-separator {
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    margin: 0 0.75rem;
    opacity: 0.7;
}

.episode-meta .badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Content sections */
.content-section {
    margin-bottom: 2.5rem;
}

.section-title {
    position: relative;
    font-weight: 600;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    font-size: 1.25rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.section-title:hover::after {
    width: 100px;
}

.description-card {
    border-radius: var(--card-border-radius);
    background-color: #fff;
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    border: none;
    line-height: 1.6;
}

/* Audio Player */
.audio-player {
    background: #fff;
    border-radius: var(--card-border-radius);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-container {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: height 0.2s ease;
}

.progress-container:hover {
    height: 10px;
}

.progress-bar {
    background: var(--primary-gradient);
    height: 100%;
    border-radius: 8px;
    width: 0%;
    position: relative;
}

.time-display {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

.control-button {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    box-shadow: 0 4px 10px rgba(var(--bs-primary-rgb), 0.3);
}

.control-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(var(--bs-primary-rgb), 0.4);
}

.small-control {
    width: 40px;
    height: 40px;
    background: #f8f9fa;
    color: #495057;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s;
}

.small-control:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.volume-container {
    height: 4px;
    background-color: #e9ecef;
    border-radius: 4px;
    cursor: pointer;
    width: 80px;
    position: relative;
    transition: height 0.2s ease;
}

.volume-container:hover {
    height: 6px;
}

.volume-bar {
    background-color: var(--bs-primary);
    height: 100%;
    border-radius: 4px;
    width: 80%;
}

/* Podcast Info Card */
.podcast-info {
    border-radius: var(--card-border-radius) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.podcast-info:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.podcast-cover {
    overflow: hidden;
    border-radius: 12px;
}

.podcast-cover img {
    transition: transform 0.3s ease;
}

.podcast-info:hover .podcast-cover img {
    transform: scale(1.05);
}

.host-link {
    color: var(--bs-primary);
    transition: color 0.2s ease;
}

.host-link:hover {
    color: #6610f2;
}

/* More Episodes Section */
.more-episodes {
    border-radius: var(--card-border-radius) !important;
}

.episode-item {
    transition: background-color 0.2s ease;
    border-radius: 0;
}

.episode-item:first-child {
    border-top-left-radius: var(--card-border-radius);
    border-top-right-radius: var(--card-border-radius);
}

.episode-item:last-child {
    border-bottom-left-radius: var(--card-border-radius);
    border-bottom-right-radius: var(--card-border-radius);
}

.episode-item:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.03);
}

.episode-item .play-icon {
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.episode-item:hover .play-icon {
    opacity: 1;
    transform: scale(1.2);
}

.episode-number {
    min-width: 70px;
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.favorite-active {
    color: #dc3545;
}

.favorite-active i {
    animation: pulse 0.5s ease;
}

/* Toast Notifications */
#toast-container .toast {
    border-radius: 10px;
}

/* Collapsible Transcript */
#transcriptCollapse {
    max-height: 400px;
    overflow-y: auto;
}

.btn-link i {
    transition: transform 0.3s ease;
}

.btn-link:not(.collapsed) i {
    transform: rotate(180deg);
}

/* Dark Mode Adjustments */
@media (prefers-color-scheme: dark) {

    .description-card,
    .audio-player {
        background-color: rgba(255, 255, 255, 0.05);
        color: rgba(255, 255, 255, 0.9);
    }

    .small-control {
        background: rgba(255, 255, 255, 0.1);
        color: rgba(255, 255, 255, 0.8);
    }

    .small-control:hover {
        background: rgba(255, 255, 255, 0.15);
    }

    .time-display {
        color: rgba(255, 255, 255, 0.7);
    }

    .progress-container,
    .volume-container {
        background-color: rgba(255, 255, 255, 0.2);
    }

    .episode-item:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .episode-header {
        padding: 2rem 0;
    }

    .episode-title {
        font-size: 1.75rem;
    }

    .back-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .control-button {
        width: 48px;
        height: 48px;
    }

    .small-control {
        width: 36px;
        height: 36px;
    }

    .volume-container {
        width: 60px;
    }
}