/* ============================================
   PODCAST CARDS - ENHANCED VISUAL DESIGN
   Modern glassmorphism + audio wave effects
   ============================================ */

/* Base Card Styling */
.podcast-card {
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden !important;
    isolation: isolate;
    min-height: 320px;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.95)) !important;
    border: 1px solid rgba(139, 92, 246, 0.15) !important;
    box-shadow:
        0 4px 24px -4px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.podcast-card:hover {
    transform: translateY(-8px);
    border-color: rgba(139, 92, 246, 0.4) !important;
    box-shadow:
        0 20px 40px -12px rgba(139, 92, 246, 0.35),
        0 8px 16px -8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Ambient Glow Effect */
.podcast-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
}

.podcast-card:hover::before {
    opacity: 1;
}

/* ============================================
   AUDIO VISUAL HEADER SECTION
   ============================================ */

.podcast-card > div:first-child {
    height: 140px !important;
    min-height: 140px !important;
    max-height: 140px !important;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%) !important;
    position: relative;
    overflow: hidden;
}

/* Animated Audio Wave Background */
.podcast-card > div:first-child::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background:
        linear-gradient(90deg,
            transparent 0%,
            rgba(250, 204, 21, 0.1) 10%,
            transparent 20%,
            rgba(139, 92, 246, 0.15) 30%,
            transparent 40%,
            rgba(250, 204, 21, 0.1) 50%,
            transparent 60%,
            rgba(139, 92, 246, 0.15) 70%,
            transparent 80%,
            rgba(250, 204, 21, 0.1) 90%,
            transparent 100%
        );
    animation: waveMove 3s linear infinite;
    opacity: 0.6;
}

@keyframes waveMove {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Sound Wave Bars Animation */
.podcast-card > div:first-child::after {
    content: '';
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 40px;
    background:
        linear-gradient(to bottom, rgba(250, 204, 21, 0.6), rgba(250, 204, 21, 0.2)) 0 100% / 4px 60% no-repeat,
        linear-gradient(to bottom, rgba(139, 92, 246, 0.6), rgba(139, 92, 246, 0.2)) 10px 100% / 4px 80% no-repeat,
        linear-gradient(to bottom, rgba(250, 204, 21, 0.6), rgba(250, 204, 21, 0.2)) 20px 100% / 4px 45% no-repeat,
        linear-gradient(to bottom, rgba(139, 92, 246, 0.6), rgba(139, 92, 246, 0.2)) 30px 100% / 4px 90% no-repeat,
        linear-gradient(to bottom, rgba(250, 204, 21, 0.6), rgba(250, 204, 21, 0.2)) 40px 100% / 4px 55% no-repeat,
        linear-gradient(to bottom, rgba(139, 92, 246, 0.6), rgba(139, 92, 246, 0.2)) 50px 100% / 4px 70% no-repeat,
        linear-gradient(to bottom, rgba(250, 204, 21, 0.6), rgba(250, 204, 21, 0.2)) 60px 100% / 4px 40% no-repeat,
        linear-gradient(to bottom, rgba(139, 92, 246, 0.6), rgba(139, 92, 246, 0.2)) 70px 100% / 4px 85% no-repeat;
    animation: soundBars 1.2s ease-in-out infinite alternate;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.podcast-card:hover > div:first-child::after {
    opacity: 1;
}

@keyframes soundBars {
    0% {
        background-size:
            4px 60%, 4px 80%, 4px 45%, 4px 90%,
            4px 55%, 4px 70%, 4px 40%, 4px 85%;
    }
    100% {
        background-size:
            4px 85%, 4px 50%, 4px 75%, 4px 45%,
            4px 90%, 4px 55%, 4px 80%, 4px 35%;
    }
}

/* Hide original image, show icon instead */
.podcast-card > div:first-child img {
    display: none !important;
}

/* Center music icon container */
.podcast-card > div:first-child > div:first-child {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Style the music icon */
.podcast-card > div:first-child > div:first-child i.ph-music-notes {
    font-size: 3.5rem !important;
    color: rgba(250, 204, 21, 0.4) !important;
    text-shadow: 0 0 30px rgba(250, 204, 21, 0.3);
    transition: all 0.4s ease;
}

.podcast-card:hover > div:first-child > div:first-child i.ph-music-notes {
    color: rgba(250, 204, 21, 0.7) !important;
    transform: scale(1.1);
    text-shadow: 0 0 40px rgba(250, 204, 21, 0.5);
}

/* ============================================
   PLAY BUTTON - ENHANCED
   ============================================ */

.podcast-card .play-episode-btn {
    transform: scale(0.9) !important;
    opacity: 0.95 !important;
    width: 72px !important;
    height: 72px !important;
    background: linear-gradient(135deg, #facc15 0%, #eab308 100%) !important;
    box-shadow:
        0 8px 24px -4px rgba(250, 204, 21, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.3) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: 3px solid rgba(255, 255, 255, 0.2) !important;
}

.podcast-card:hover .play-episode-btn {
    transform: scale(1.05) !important;
    box-shadow:
        0 12px 32px -4px rgba(250, 204, 21, 0.6),
        0 0 0 8px rgba(250, 204, 21, 0.15),
        inset 0 2px 0 rgba(255, 255, 255, 0.3) !important;
}

.podcast-card .play-episode-btn:hover {
    background: linear-gradient(135deg, #fde047 0%, #facc15 100%) !important;
}

.podcast-card .play-episode-btn i {
    font-size: 1.75rem !important;
    margin-left: 4px;
}

/* Overlay for play button */
.podcast-card > div:first-child > div[class*="absolute"][class*="inset-0"] {
    opacity: 1 !important;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.3) 100%) !important;
}

/* ============================================
   PROGRESS INDICATOR - ENHANCED
   ============================================ */

.podcast-card .progress-indicator {
    height: 4px !important;
    background: rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(4px);
}

.podcast-card .progress-fill {
    background: linear-gradient(90deg, #8b5cf6 0%, #a78bfa 50%, #c4b5fd 100%) !important;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.6);
    position: relative;
}

.podcast-card .progress-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: #c4b5fd;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(196, 181, 253, 0.8);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.podcast-card:hover .progress-fill::after {
    opacity: 1;
}

/* ============================================
   BADGES - ENHANCED
   ============================================ */

/* New badge - pulsing glow */
.podcast-card .absolute.top-4.left-4 span[class*="bg-red-500"] {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    box-shadow:
        0 4px 12px -2px rgba(239, 68, 68, 0.5),
        0 0 0 2px rgba(239, 68, 68, 0.2);
    animation: pulseGlow 2s ease-in-out infinite;
    font-size: 0.65rem !important;
    letter-spacing: 0.1em;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 4px 12px -2px rgba(239, 68, 68, 0.5), 0 0 0 2px rgba(239, 68, 68, 0.2); }
    50% { box-shadow: 0 4px 20px -2px rgba(239, 68, 68, 0.7), 0 0 0 4px rgba(239, 68, 68, 0.3); }
}

/* BD Badge */
.podcast-card .absolute.top-4.left-4 span[class*="text-yellow-electric"] {
    background: linear-gradient(135deg, rgba(30, 27, 75, 0.9) 0%, rgba(49, 46, 129, 0.9) 100%) !important;
    border: 1px solid rgba(250, 204, 21, 0.3) !important;
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.3);
}

/* Formation Badge */
.podcast-card .absolute.top-4.left-4 span[class*="text-blue-400"] {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.9) 0%, rgba(29, 78, 216, 0.9) 100%) !important;
    border: 1px solid rgba(96, 165, 250, 0.3) !important;
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.3);
}

/* Played indicator */
.podcast-card .played-indicator {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
    box-shadow: 0 4px 12px -2px rgba(34, 197, 94, 0.5) !important;
    font-size: 0.65rem !important;
}

/* ============================================
   CONTENT SECTION - ENHANCED
   ============================================ */

.podcast-card .p-6 {
    position: relative;
    z-index: 2;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.3) 0%, rgba(15, 23, 42, 0.6) 100%);
    backdrop-filter: blur(12px);
    isolation: isolate;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1.5rem 1.5rem !important;
    border-top: 1px solid rgba(139, 92, 246, 0.1);
}

/* Decorative corner accent */
.podcast-card .p-6::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, transparent 50%, rgba(139, 92, 246, 0.05) 50%);
    pointer-events: none;
}

/* Title styling */
.podcast-card h3 {
    position: relative;
    z-index: 3;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.35 !important;
    word-wrap: break-word;
    word-break: break-word;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em;
    min-height: 3rem;
}

.podcast-card h3 a {
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
}

.podcast-card:hover h3 a {
    background: linear-gradient(135deg, #facc15 0%, #fde047 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Excerpt styling */
.podcast-card p {
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.6 !important;
    word-wrap: break-word;
    word-break: break-word;
    color: #94a3b8 !important;
    font-size: 0.875rem !important;
}

/* ============================================
   FOOTER / META SECTION
   ============================================ */

.podcast-card .border-t {
    border-color: rgba(139, 92, 246, 0.15) !important;
    padding-top: 1rem !important;
    margin-top: auto !important;
}

/* Date and duration */
.podcast-card .text-gray-500 {
    color: #64748b !important;
    font-size: 0.8rem !important;
}

.podcast-card .text-gray-500 i {
    color: rgba(139, 92, 246, 0.6) !important;
}

/* Duration display special styling */
.podcast-card .duration-display {
    background: rgba(139, 92, 246, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

/* Action buttons */
.podcast-card .flex.gap-2 button,
.podcast-card .flex.gap-2 a {
    width: 32px;
    height: 32px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(51, 65, 85, 0.5);
    transition: all 0.2s ease;
}

.podcast-card .flex.gap-2 button:hover,
.podcast-card .flex.gap-2 a:hover {
    background: rgba(139, 92, 246, 0.2);
    transform: translateY(-2px);
}

/* Queue button hover */
.podcast-card .add-to-queue-btn:hover {
    color: #a78bfa !important;
}

/* Favorite button */
.podcast-card .favorite-btn.is-favorite i {
    color: #f43f5e !important;
}

/* Share button hover */
.podcast-card .share-btn:hover {
    color: #60a5fa !important;
}

/* External link hover */
.podcast-card .flex.gap-2 a:hover {
    color: #facc15 !important;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .podcast-card {
        min-height: 300px;
    }

    .podcast-card > div:first-child {
        height: 120px !important;
        min-height: 120px !important;
        max-height: 120px !important;
    }

    .podcast-card .play-episode-btn {
        width: 60px !important;
        height: 60px !important;
    }

    .podcast-card h3 {
        font-size: 1rem !important;
    }

    .podcast-card p {
        -webkit-line-clamp: 2 !important;
    }
}

@media (max-width: 480px) {
    .podcast-card > div:first-child {
        height: 100px !important;
        min-height: 100px !important;
        max-height: 100px !important;
    }

    .podcast-card .p-6 {
        padding: 1rem !important;
    }

    .podcast-card .flex.gap-2 button,
    .podcast-card .flex.gap-2 a {
        width: 28px;
        height: 28px;
    }
}

/* ============================================
   ANIMATION FOR PLAYING STATE
   ============================================ */

.podcast-card.is-playing {
    border-color: rgba(250, 204, 21, 0.5) !important;
    box-shadow:
        0 0 0 1px rgba(250, 204, 21, 0.2),
        0 20px 40px -12px rgba(250, 204, 21, 0.25),
        0 8px 16px -8px rgba(0, 0, 0, 0.4);
}

.podcast-card.is-playing > div:first-child::after {
    opacity: 1 !important;
    animation: soundBars 0.8s ease-in-out infinite alternate;
}

.podcast-card.is-playing .play-episode-btn {
    animation: playingPulse 1.5s ease-in-out infinite;
}

@keyframes playingPulse {
    0%, 100% { box-shadow: 0 8px 24px -4px rgba(250, 204, 21, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.3); }
    50% { box-shadow: 0 8px 32px -4px rgba(250, 204, 21, 0.7), 0 0 0 12px rgba(250, 204, 21, 0.1), inset 0 2px 0 rgba(255, 255, 255, 0.3); }
}
