/**
 * Pôli Podcast - Extended Layouts
 * Version: 2.0.0
 * Layouts: Spotify-like, Carousel, Hero
 */

/* ==========================================================================
   SPOTIFY-LIKE LAYOUT
   Full-width layout with sidebar navigation
   ========================================================================== */
.ps-layout-spotify {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    min-height: 100vh;
    background: var(--ps-bg-primary, #ffffff);
}

/* Sidebar */
.ps-spotify-sidebar {
    background: var(--ps-bg-secondary, #f8fafc);
    border-right: 1px solid var(--ps-border, rgba(0, 0, 0, 0.08));
    padding: 24px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.ps-spotify-logo {
    padding: 0 24px 24px;
    border-bottom: 1px solid var(--ps-border);
    margin-bottom: 24px;
}

.ps-spotify-logo img {
    max-width: 160px;
    height: auto;
}

.ps-spotify-nav {
    padding: 0 12px;
}

.ps-spotify-nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: var(--ps-radius-md, 12px);
    color: var(--ps-text-secondary, #64748b);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.ps-spotify-nav-item:hover {
    background: var(--ps-bg-tertiary, #f1f5f9);
    color: var(--ps-text-primary, #1e293b);
}

.ps-spotify-nav-item.active {
    background: var(--ps-primary, #1DB954);
    color: white;
}

.ps-spotify-nav-item svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Sidebar Sections */
.ps-spotify-section {
    padding: 24px;
    border-top: 1px solid var(--ps-border);
    margin-top: auto;
}

.ps-spotify-section-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ps-text-tertiary, #94a3b8);
    margin-bottom: 16px;
}

/* Podcast Info in Sidebar */
.ps-spotify-podcast-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--ps-bg-glass, rgba(255, 255, 255, 0.7));
    border-radius: var(--ps-radius-md);
}

.ps-spotify-podcast-info img {
    width: 48px;
    height: 48px;
    border-radius: var(--ps-radius-sm, 8px);
    object-fit: cover;
}

.ps-spotify-podcast-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--ps-text-primary);
}

.ps-spotify-podcast-episodes {
    font-size: 12px;
    color: var(--ps-text-tertiary);
}

/* Main Content */
.ps-spotify-main {
    padding: 32px;
    overflow-y: auto;
}

/* Header with Gradient */
.ps-spotify-header {
    background: linear-gradient(180deg, var(--ps-primary, #1DB954) 0%, transparent 100%);
    padding: 48px 32px;
    margin: -32px -32px 32px;
    display: flex;
    align-items: flex-end;
    gap: 32px;
}

.ps-spotify-header-image {
    width: 232px;
    height: 232px;
    border-radius: var(--ps-radius-lg, 16px);
    object-fit: cover;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.ps-spotify-header-content {
    flex: 1;
}

.ps-spotify-header-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.ps-spotify-header-title {
    font-size: 48px;
    font-weight: 800;
    color: white;
    margin: 0 0 16px;
    line-height: 1.1;
}

.ps-spotify-header-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.ps-spotify-header-meta strong {
    color: white;
}

/* Episodes List - Spotify Style */
.ps-spotify-episodes {
    display: flex;
    flex-direction: column;
}

.ps-spotify-episodes-header {
    display: grid;
    grid-template-columns: 48px 1fr 120px 100px;
    gap: 16px;
    padding: 0 16px 12px;
    border-bottom: 1px solid var(--ps-border);
    color: var(--ps-text-tertiary);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ps-spotify-episode-row {
    display: grid;
    grid-template-columns: 48px 1fr 120px 100px;
    gap: 16px;
    padding: 12px 16px;
    align-items: center;
    border-radius: var(--ps-radius-sm);
    transition: background 0.2s ease;
}

.ps-spotify-episode-row:hover {
    background: var(--ps-bg-tertiary);
}

.ps-spotify-episode-play {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--ps-text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ps-spotify-episode-row:hover .ps-spotify-episode-play {
    background: var(--ps-primary);
    color: white;
}

.ps-spotify-episode-play svg {
    width: 20px;
    height: 20px;
}

.ps-spotify-episode-info {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.ps-spotify-episode-image {
    width: 48px;
    height: 48px;
    border-radius: var(--ps-radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.ps-spotify-episode-details {
    min-width: 0;
}

.ps-spotify-episode-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--ps-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0 0 4px;
}

.ps-spotify-episode-desc {
    font-size: 13px;
    color: var(--ps-text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ps-spotify-episode-date {
    color: var(--ps-text-tertiary);
    font-size: 14px;
}

.ps-spotify-episode-duration {
    color: var(--ps-text-tertiary);
    font-size: 14px;
    text-align: right;
}

/* Responsive Spotify Layout */
@media (max-width: 1024px) {
    .ps-layout-spotify {
        grid-template-columns: 1fr;
    }
    
    .ps-spotify-sidebar {
        display: none;
    }
    
    .ps-spotify-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 32px;
    }
    
    .ps-spotify-header-image {
        width: 180px;
        height: 180px;
    }
    
    .ps-spotify-header-title {
        font-size: 32px;
    }
    
    .ps-spotify-episodes-header {
        display: none;
    }
    
    .ps-spotify-episode-row {
        grid-template-columns: 48px 1fr auto;
    }
    
    .ps-spotify-episode-date {
        display: none;
    }
}

/* ==========================================================================
   CAROUSEL LAYOUT
   Horizontal scrolling carousel for episodes
   ========================================================================== */
.ps-layout-carousel {
    position: relative;
    padding: 40px 0;
}

.ps-carousel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 0 24px;
}

.ps-carousel-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--ps-text-primary);
    margin: 0;
}

.ps-carousel-nav {
    display: flex;
    gap: 8px;
}

.ps-carousel-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: var(--ps-bg-glass, rgba(255, 255, 255, 0.7));
    backdrop-filter: blur(10px);
    color: var(--ps-text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: var(--ps-shadow-md);
}

.ps-carousel-btn:hover:not(:disabled) {
    background: var(--ps-primary);
    color: white;
    transform: scale(1.1);
}

.ps-carousel-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ps-carousel-btn svg {
    width: 24px;
    height: 24px;
}

/* Carousel Track */
.ps-carousel-container {
    overflow: hidden;
    margin: 0 -24px;
    padding: 0 24px;
}

.ps-carousel-track {
    display: flex;
    gap: 24px;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: grab;
}

.ps-carousel-track.dragging {
    cursor: grabbing;
    transition: none;
}

/* Carousel Cards */
.ps-carousel-card {
    flex: 0 0 300px;
    background: var(--ps-bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-radius-xl, 24px);
    overflow: hidden;
    transition: all 0.3s ease;
}

.ps-carousel-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--ps-shadow-xl), 0 0 60px var(--ps-primary-glow, rgba(29, 185, 84, 0.2));
}

.ps-carousel-card-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
}

.ps-carousel-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.ps-carousel-card:hover .ps-carousel-card-image img {
    transform: scale(1.1);
}

.ps-carousel-play-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: var(--ps-primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px var(--ps-primary-glow);
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.3s ease;
}

.ps-carousel-card:hover .ps-carousel-play-btn {
    opacity: 1;
    transform: translateY(0);
}

.ps-carousel-play-btn:hover {
    transform: scale(1.1) !important;
}

.ps-carousel-play-btn svg {
    width: 24px;
    height: 24px;
    margin-left: 3px;
}

.ps-carousel-card-content {
    padding: 20px;
}

.ps-carousel-card-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--ps-text-tertiary);
}

.ps-carousel-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--ps-text-primary);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Carousel Dots */
.ps-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.ps-carousel-dot {
    width: 8px;
    height: 8px;
    border: none;
    border-radius: 50%;
    background: var(--ps-border);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.ps-carousel-dot.active {
    width: 24px;
    border-radius: 4px;
    background: var(--ps-primary);
}

/* Responsive Carousel */
@media (max-width: 768px) {
    .ps-carousel-card {
        flex: 0 0 260px;
    }
    
    .ps-carousel-nav {
        display: none;
    }
}

@media (max-width: 480px) {
    .ps-carousel-card {
        flex: 0 0 85vw;
    }
}

/* ==========================================================================
   HERO LAYOUT
   Featured episode with large visual impact
   ========================================================================== */
.ps-layout-hero {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* Background */
.ps-hero-background {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.ps-hero-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(40px);
    transform: scale(1.1);
}

.ps-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.8) 0%,
        rgba(0, 0, 0, 0.4) 50%,
        rgba(0, 0, 0, 0.6) 100%
    );
}

/* Content */
.ps-hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

/* Episode Image */
.ps-hero-image-wrapper {
    position: relative;
}

.ps-hero-image {
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1;
    border-radius: var(--ps-radius-xl);
    object-fit: cover;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.4);
    animation: ps-hero-float 6s ease-in-out infinite;
}

@keyframes ps-hero-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.ps-hero-image-glow {
    position: absolute;
    inset: -20%;
    background: radial-gradient(
        circle at center,
        var(--ps-primary-glow, rgba(29, 185, 84, 0.3)) 0%,
        transparent 70%
    );
    filter: blur(60px);
    z-index: -1;
}

/* Episode Info */
.ps-hero-info {
    color: white;
}

.ps-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--ps-radius-full);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 24px;
}

.ps-hero-badge-dot {
    width: 8px;
    height: 8px;
    background: var(--ps-primary);
    border-radius: 50%;
    animation: ps-pulse-dot 2s ease-in-out infinite;
}

@keyframes ps-pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

.ps-hero-title {
    font-size: 56px;
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 24px;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ps-hero-description {
    font-size: 18px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 32px;
    max-width: 500px;
}

.ps-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 40px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.ps-hero-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ps-hero-meta-item svg {
    width: 18px;
    height: 18px;
    color: var(--ps-primary);
}

/* Hero Actions */
.ps-hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.ps-hero-play-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 36px;
    background: var(--ps-primary);
    color: white;
    border: none;
    border-radius: var(--ps-radius-full);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 32px var(--ps-primary-glow);
    transition: all 0.3s ease;
}

.ps-hero-play-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 40px var(--ps-primary-glow);
}

.ps-hero-play-btn svg {
    width: 24px;
    height: 24px;
}

.ps-hero-secondary-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 36px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--ps-radius-full);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ps-hero-secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

/* Waveform Animation */
.ps-hero-waveform {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 32px;
    margin-left: 16px;
}

.ps-hero-waveform-bar {
    width: 4px;
    background: var(--ps-primary);
    border-radius: 2px;
    animation: ps-hero-wave 1.2s ease-in-out infinite;
}

.ps-hero-waveform-bar:nth-child(1) { height: 30%; animation-delay: 0s; }
.ps-hero-waveform-bar:nth-child(2) { height: 60%; animation-delay: 0.1s; }
.ps-hero-waveform-bar:nth-child(3) { height: 100%; animation-delay: 0.2s; }
.ps-hero-waveform-bar:nth-child(4) { height: 50%; animation-delay: 0.3s; }
.ps-hero-waveform-bar:nth-child(5) { height: 80%; animation-delay: 0.4s; }
.ps-hero-waveform-bar:nth-child(6) { height: 40%; animation-delay: 0.5s; }
.ps-hero-waveform-bar:nth-child(7) { height: 70%; animation-delay: 0.6s; }

@keyframes ps-hero-wave {
    0%, 100% { transform: scaleY(0.5); }
    50% { transform: scaleY(1); }
}

/* Scroll Indicator */
.ps-hero-scroll {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: ps-bounce 2s ease-in-out infinite;
}

@keyframes ps-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}

.ps-hero-scroll svg {
    width: 24px;
    height: 24px;
}

/* Responsive Hero */
@media (max-width: 1024px) {
    .ps-hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 60px 24px;
        gap: 40px;
    }
    
    .ps-hero-image-wrapper {
        order: -1;
    }
    
    .ps-hero-image {
        max-width: 300px;
        margin: 0 auto;
    }
    
    .ps-hero-title {
        font-size: 40px;
    }
    
    .ps-hero-description {
        margin-left: auto;
        margin-right: auto;
    }
    
    .ps-hero-meta {
        justify-content: center;
    }
    
    .ps-hero-actions {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .ps-hero-title {
        font-size: 28px;
    }
    
    .ps-hero-description {
        font-size: 16px;
    }
    
    .ps-hero-play-btn,
    .ps-hero-secondary-btn {
        padding: 14px 24px;
        font-size: 14px;
    }
}

/* ==========================================================================
   COMBINED LAYOUT - Hero + Carousel
   ========================================================================== */
.ps-layout-combined {
    background: var(--ps-bg-primary);
}

.ps-layout-combined .ps-layout-hero {
    min-height: 70vh;
}

.ps-layout-combined .ps-layout-carousel {
    position: relative;
    z-index: 1;
    margin-top: -60px;
}

.ps-layout-combined .ps-carousel-header {
    background: var(--ps-bg-glass-strong);
    backdrop-filter: blur(20px);
    margin: 0 24px 24px;
    padding: 20px 24px;
    border-radius: var(--ps-radius-lg);
    box-shadow: var(--ps-shadow-lg);
}
