/* ==========================================
   CORE VARIABLES & RESET
========================================== */
:root {
    --bg-color: #0F0C29; 
    --bg-gradient: linear-gradient(to right, #0F0C29, #302B63, #24243E);
    --card-bg: #1E1A3D; 
    --text-main: #FFFFFF; 
    --text-muted: #A09DB0; 
    --accent: #FF4081;
}

body { 
    margin: 0; 
    font-family: 'Inter', sans-serif; 
    background: var(--bg-color); 
    color: var(--text-main); 
    line-height: 1.6; 
}

/* Optional: Only apply the 90px padding when the player is actually visible */
body.player-active {
    padding-bottom: 90px; 
}

a { 
    color: var(--text-main); 
    text-decoration: none; 
    transition: all 0.2s; 
}

a:hover { 
    color: var(--accent); 
}

.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 20px; 
    min-height: 70vh; /* Pushes footer to the bottom on short pages */
}

/* ==========================================
   HEADER & NAVBAR
========================================== */
.navbar { 
    background: var(--bg-gradient); 
    padding: 15px 0; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.5); 
}

.nav-container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 20px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    flex-wrap: wrap; 
    gap: 15px; 
}

.logo { 
    font-size: 24px; 
    font-weight: 800; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

.logo i { color: var(--accent); font-size: 32px; }

.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-links a { font-weight: 600; font-size: 15px; }

.search-form { 
    display: flex; 
    background: rgba(255,255,255,0.1); 
    border-radius: 25px; 
    padding: 5px 15px; 
    margin-left: 20px;
}

.search-form input { 
    background: transparent; 
    border: none; 
    color: #FFF; 
    outline: none; 
    padding: 8px; 
    width: 200px; 
    font-size: 14px; 
}

.search-form button { 
    background: transparent; 
    border: none; 
    color: var(--accent); 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
}

/* ==========================================
   DYNAMIC ADMIN CONTENT BLOCKS
========================================== */
.banner-container { 
    margin: 30px 0; 
    display: flex; 
    justify-content: center; 
    width: 100%;
    overflow: hidden;
}

.content-box { 
    background: var(--card-bg); 
    padding: 25px; 
    margin-bottom: 30px; 
    border-radius: 12px; 
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); 
    color: var(--text-muted);
}

.content-box p { margin-top: 0; color: var(--text-main); }

/* ==========================================
   FIXED CATEGORY CHIPS SYSTEM (Wrap-Down)
========================================== */
.category-scroll { 
    width: 100%; 
    overflow: visible !important; 
    padding: 25px 0 15px 0; 
}

.category-chips { 
    display: flex; 
    flex-wrap: wrap; 
    align-items: center; 
    justify-content: center; 
    gap: 12px; 
    width: 100%;
}

.category-chips .chip-all-anchor {
    margin-right: auto;
}

.chip { 
    display: inline-flex; 
    align-items: center; 
    gap: 6px; 
    background: rgba(255,255,255,0.05); 
    border: 1px solid rgba(255,255,255,0.1); 
    padding: 10px 20px; 
    border-radius: 30px; 
    font-weight: 600; 
    font-size: 14px; 
    white-space: nowrap; 
    color: #FFF; 
    transition: all 0.2s ease-in-out;
}

.chip i { color: var(--accent); font-size: 18px; }

.chip:hover { 
    background: var(--card-bg); 
    border-color: var(--accent); 
    transform: translateY(-3px); 
    box-shadow: 0 5px 15px rgba(255, 64, 129, 0.15); 
}

.chip.active, .chip-all { 
    background: rgba(255, 64, 129, 0.1); 
    border-color: rgba(255, 64, 129, 0.3); 
}

/* ==========================================
   PODCAST & GENRE GRIDS
========================================== */
.section-title { 
    font-size: 24px; 
    font-weight: 600; 
    margin: 40px 0 20px; 
    padding-bottom: 10px; 
    border-bottom: 1px solid rgba(255,255,255,0.1); 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

.section-title i { color: var(--accent); }

/* Genre Grid */
.genre-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); 
    gap: 20px; 
    margin-bottom: 40px; 
}

.genre-card { 
    background: var(--card-bg); 
    padding: 25px 20px; 
    border-radius: 12px; 
    text-align: center; 
    border: 1px solid rgba(255,255,255,0.05); 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 15px; 
}

.genre-card:hover { 
    transform: translateY(-5px); 
    background: #2A2550; 
    border-color: var(--accent); 
    box-shadow: 0 8px 20px rgba(255, 64, 129, 0.15); 
}

.genre-card i { font-size: 48px; color: var(--accent); }
.genre-card h3 { margin: 0; font-size: 18px; }

/* Podcast Grid */
.podcast-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); 
    gap: 25px; 
    margin-bottom: 30px; 
}

.pod-card { 
    background: var(--card-bg); 
    border-radius: 12px; 
    overflow: hidden; 
    transition: transform 0.3s; 
    border: 1px solid rgba(255,255,255,0.05); 
}

.pod-card:hover { 
    transform: translateY(-8px); 
    box-shadow: 0 12px 24px rgba(255, 64, 129, 0.15); 
}

.pod-image-wrapper { 
    position: relative; 
    width: 100%; 
    padding-top: 100%; 
    overflow: hidden; 
    background: #2A2550; 
}

.pod-image-wrapper img { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; 
}

.overlay { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(15,12,41,0.7); 
    display: flex; align-items: center; justify-content: center; 
    opacity: 0; transition: opacity 0.3s; 
}

.overlay i { font-size: 48px; color: var(--accent); }
.pod-card:hover .overlay { opacity: 1; }

.pod-info { padding: 15px; }
.pod-title { font-size: 15px; font-weight: 600; margin: 0 0 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pod-author { font-size: 13px; color: var(--text-muted); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ==========================================
   PODCAST DETAILS PAGE (Hero Layout)
========================================== */
.podcast-hero {
    display: flex;
    flex-direction: row; 
    align-items: flex-start; 
    gap: 40px; 
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 40px;
    margin-top: 30px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.hero-image {
    flex: 0 0 240px; 
    max-width: 240px;
}

.hero-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
}

.hero-details {
    flex: 1; 
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Action Links */
.pod-actions { 
    display: flex; 
    gap: 12px; 
    margin: 20px 0; 
    flex-wrap: wrap;
}

.pod-actions a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    transition: opacity 0.2s ease;
}

.pod-actions a:hover {
    opacity: 0.9;
}

.btn-apple { background-color: #d1324a; color: #fff !important; }
.btn-amazon { background-color: #ff9900; color: #000 !important; }

/* Share Modules */
.share-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.share-title {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 12px;
}

.share-buttons { 
    display: flex; 
    gap: 10px; 
    flex-wrap: wrap;
}

.share-buttons a {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    transition: transform 0.1s ease;
}

.share-buttons a:active { transform: scale(0.97); }

.share-btn.fb { background: #1877f2; }
.share-btn.tw { background: #1da1f2; }
.share-btn.wa { background: #25d366; }

/* ==========================================
   EPISODE LIST & AUDIO PLAYER
========================================== */
.ep-list { display: flex; flex-direction: column; gap: 15px; margin-bottom: 40px; }

.ep-card { 
    background: var(--card-bg); border-radius: 10px; padding: 20px; 
    display: flex; gap: 20px; align-items: center; 
    transition: background 0.2s; border: 1px solid rgba(255,255,255,0.05); 
}

.ep-card:hover { background: rgba(255,255,255,0.05); }

.play-btn { 
    background: var(--accent); color: #fff; border: none; width: 50px; height: 50px; 
    border-radius: 50%; cursor: pointer; display: flex; align-items: center; 
    justify-content: center; transition: transform 0.2s, background 0.2s; flex-shrink: 0; 
}

.play-btn:hover { background: #FF79A8; transform: scale(1.1); }
.play-btn i { font-size: 28px; }

.ep-info { flex-grow: 1; }
.ep-title { margin: 0 0 5px; font-size: 18px; font-weight: 600; }
.ep-meta { font-size: 13px; color: var(--text-muted); margin: 0 0 10px; display: flex; gap: 15px; }
.ep-desc { font-size: 14px; color: #CCC; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.player-bar { 
    position: fixed; bottom: 0; left: 0; width: 100%; background: #080614; 
    border-top: 1px solid rgba(255,255,255,0.1); padding: 15px 0; z-index: 1000; display: none; 
}

.player-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; gap: 20px; align-items: center; }
.now-playing-art { width: 50px; height: 50px; border-radius: 6px; }
.now-playing-info { flex-grow: 1; overflow: hidden; }
.now-playing-title { margin: 0; font-size: 14px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.now-playing-show { margin: 0; font-size: 12px; color: var(--text-muted); }
audio { flex-grow: 2; height: 40px; outline: none; }

/* ==========================================
   PAGINATION & FOOTER
========================================== */
.pagination { 
    display: flex; align-items: center; justify-content: center; gap: 20px; margin: 40px 0; 
}

.page-btn { 
    display: inline-flex; align-items: center; gap: 5px; 
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); 
    padding: 8px 20px; border-radius: 20px; font-size: 14px; font-weight: 600; cursor: pointer; color: #FFF;
    transition: all 0.2s;
}

.page-btn:not(.disabled):hover { 
    background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(255, 64, 129, 0.3); 
}

.page-btn i { font-size: 18px; }
.page-btn.disabled { opacity: 0.4; cursor: not-allowed; }
.page-info { font-size: 14px; color: var(--text-muted); font-weight: 600; }

footer { 
    background: #080614; 
    padding: 15px 0; 
    text-align: center; 
    color: var(--text-muted); 
    font-size: 14px; 
    margin-top: 40px; 
    border-top: 1px solid rgba(255,255,255,0.05); 
}

/* ==========================================
   FORMS & ALERTS
========================================== */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 8px; color: var(--text-muted); }

.form-control { 
    width: 100%; box-sizing: border-box; background: rgba(255,255,255,0.05); 
    border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 12px 16px; 
    color: var(--text-main); font-size: 15px; outline: none; font-family: inherit; 
    transition: border-color 0.2s, background 0.2s; 
}

.form-control:focus { border-color: var(--accent); background: rgba(255,255,255,0.1); }
textarea.form-control { resize: vertical; min-height: 140px; }

.btn { 
    background: var(--accent); color: #FFF; font-weight: 700; border: none; padding: 14px 28px; 
    border-radius: 6px; cursor: pointer; font-size: 15px; width: 100%; transition: background 0.2s, transform 0.2s; 
}

.btn:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(255, 64, 129, 0.4); }

.alert { padding: 15px; border-radius: 6px; font-weight: 500; font-size: 14px; margin-bottom: 25px; }
.alert-success { background: rgba(40, 167, 69, 0.15); color: #4ade80; border: 1px solid rgba(40, 167, 69, 0.3); }
.alert-danger { background: rgba(220, 53, 69, 0.15); color: #f87171; border: 1px solid rgba(220, 53, 69, 0.3); }

/* ==========================================
   RESPONSIVE DESIGN SYSTEM
========================================== */
@media (max-width: 768px) {
    .nav-container { flex-direction: column; align-items: stretch; }
    .nav-links { flex-direction: column; gap: 10px; }
    
    .search-form { margin-left: 0; width: 100%; box-sizing: border-box; }
    .search-form input { width: 100%; }
    
    .podcast-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 15px; }
    
    .ep-card { flex-direction: column; text-align: center; }
    
    .player-container { flex-wrap: wrap; justify-content: center; text-align: center; }
    audio { width: 100%; }

    .podcast-hero { 
        flex-direction: column; 
        padding: 20px; 
        gap: 25px; 
        align-items: center;
        text-align: center;
    }
    
    .hero-image { 
        flex: 0 0 auto; 
        width: 100%; 
        max-width: 200px; 
        margin: 0 auto; 
    }
    
    .pod-actions, .share-buttons { justify-content: center; }

    /* Category Mobile Adaptability Rules */
    .category-chips { justify-content: center; gap: 8px; }
    .category-chips .chip-all-anchor { 
        width: auto; 
        display: inline-flex; 
        margin-right: 0;
        justify-content: center;
    }
}