:root {
    --primary-color: #738b94;
    --dark-bg: #141414;
    --light-text: #e5e5e5;
    --dark-text: #666;
    --secondary-bg: #222;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--dark-bg);
    color: var(--light-text);
    line-height: 1.6;
}



header {
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo a {
    color: var(--primary-color);
    font-size: 28px;
    font-weight: bold;
    text-decoration: none;
    letter-spacing: 1px;
}

h1 {
    margin: 40px 0 20px;
    font-size: 32px;
}

/* Audiobooks Grid */
.audiobooks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
    margin-top:30px;
}

.audiobook-card {
    transition: transform 0.3s ease;
    overflow: hidden;
    border-radius: 5px;
}

.audiobook-card:hover {
    transform: scale(1.05);
}

.audiobook-card a {
    text-decoration: none;
    color: var(--light-text);
}

.audiobook-cover {
    position: relative;
    overflow: hidden;
    border-radius: 5px;
    aspect-ratio: 2/3;
}

.audiobook-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.audiobook-card:hover .audiobook-cover img {
    transform: scale(1.05);
}

.audiobook-title {
    padding: 10px 0;
    font-weight: bold;
   
}

/* Audiobook Detail Page */
.audiobook-banner {
    height: 40vh;
    background-size: cover;
    background-position: center;
    position: relative;
    margin-bottom: 20px;
}

.audiobook-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(20,20,20,0.1), var(--dark-bg));
}

.banner-content {
    position: absolute;
    bottom: 30px;
    left: 30px;
    right: 30px;
}

.banner-content h1 {
    font-size: 42px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    margin-bottom: 0;
}

/* Video Banner Styles */
.video-banner {
    position: relative;
    height: 40vh;
    overflow: hidden;
    margin-bottom: 20px;
}

.video-banner video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

.video-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(20,20,20,0.1), var(--dark-bg));
    z-index: 1;
}

.video-banner .banner-content {
    position: absolute;
    bottom: 30px;
    left: 30px;
    right: 30px;
    z-index: 2;
}

.audiobook-info {
    display: flex;
    gap: 30px;
    margin-bottom: 50px;
    
}

.audiobook-cover-large {
    flex: 0 0 250px;
}

.audiobook-cover-large img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.audiobook-details {
    flex: 1;
    
}



.audiobook-description {
    max-width: 700px;
    margin-top: 15px;
    font-size: 16px;
    line-height: 1.6;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
    color:#aaa;
}

.episodes-list {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.episode-item {
    cursor: pointer;
}

.episode-cover {
    position: relative;
    border-radius: 5px;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.episode-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-button {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-button span {
    font-size: 48px;
    color: white;
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.episode-cover:hover .play-button {
    opacity: 1;
}

.episode-info {
    padding: 10px 0;
   
}

.episode-info h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

.episode-description {
    font-size: 14px;
    color: #aaa;
    margin-top: 5px;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Base Audio Player - Fixed at bottom */
.audio-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #222;
    padding: 10px 0;
    z-index: 100;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
}

.audio-player.active {
    transform: translateY(0);
}

/* Lightbox Audio Player */
.lightbox .audio-player {
    position: relative;
    transform: none;
    background-color: #222;
    margin-top: 15px;
    border-radius: 5px;
    box-shadow: none;
}

/* Player Layout */
.player-content {
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.lightbox .player-content {
    flex-direction: column;
    padding: 15px;
}

/* Now Playing Info */
.now-playing {
    flex: 1;
    margin-right: 20px;
    color: var(--light-text);
}

.lightbox .now-playing {
    width: 100%;
    margin-right: 0;
    margin-bottom: 15px;
    text-align: center;
}

/* Controls */
.player-controls {
    flex: 2;
}

.lightbox .player-controls {
    width: 100%;
}

/* Dark-themed audio element - this is the key part */
audio {
    width: 100%;
    filter: invert(1); /* This inverts the white controls to make them dark */
    background-color: transparent !important; /* Override any browser defaults */
}

/* Close button */
.close-player {
    font-size: 24px;
    cursor: pointer;
    padding: 0 10px;
    color: var(--light-text);
}

.lightbox .close-player {
    position: absolute;
    top: 5px;
    right: 5px;
}

/* Lightbox Styling */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.lightbox-container {
    background-color: var(--secondary-bg);
    border-radius: 8px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
    position: relative;
}

footer {
    padding: 30px 0;
    margin-top: 50px;
    background-color: var(--secondary-bg);
    text-align: center;
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .audiobook-info {
        flex-direction: column;
    }
    
    .audiobook-cover-large {
        max-width: 200px;
        margin: 0 auto;
    }
    
    .banner-content h1 {
        font-size: 32px;
    }
}
