/* 
 * Potkasts Public Podcast Components
 * Podcast cards, player, and library specific styles
 */

/* ===== PODCAST CARD COMPONENTS ===== */

.podcast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.podcast-card {
    background: var(--color-bg-glass);
    border: 1px solid var(--color-border-primary);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px var(--color-shadow-light);
    position: relative;
    overflow: hidden;
}

.podcast-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-brand-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.podcast-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px var(--color-shadow-primary);
    border-color: var(--color-brand-primary);
}

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

.podcast-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.podcast-card-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--color-bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--color-brand-primary);
    border: 2px solid var(--color-border-primary);
}

.podcast-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.podcast-card-info {
    flex: 1;
    min-width: 0;
}

.podcast-card-title {
    font-size: var(--font-size-h5);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
    line-height: var(--line-height-tight);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.podcast-card-description {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    line-height: var(--line-height-normal);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
}

.podcast-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.podcast-card-meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.podcast-card-meta-item i {
    color: var(--color-brand-primary);
}

.podcast-card-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.podcast-card-actions .btn {
    flex: 1;
    justify-content: center;
    min-height: 40px;
    font-size: var(--font-size-sm);
    padding: 8px 16px;
}

.podcast-card-actions .btn-secondary {
    flex: 0 0 auto;
    padding: 8px 12px;
    min-width: 40px;
}

/* ===== PODCAST PLAYER COMPONENTS ===== */

.podcast-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-bg-glass);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--color-border-primary);
    padding: 1rem;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.podcast-player.active {
    transform: translateY(0);
}

.podcast-player-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.podcast-player-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.podcast-player-image {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--color-bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--color-brand-primary);
    flex-shrink: 0;
}

.podcast-player-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.podcast-player-details {
    flex: 1;
    min-width: 0;
}

.podcast-player-title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.podcast-player-subtitle {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.podcast-player-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.podcast-player-control {
    background: none;
    border: none;
    color: var(--color-text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.podcast-player-control:hover {
    background: var(--color-brand-purple-alpha);
    color: var(--color-brand-primary);
}

.podcast-player-control.play-pause {
    background: var(--color-brand-primary);
    color: white;
    font-size: 1.5rem;
}

.podcast-player-control.play-pause:hover {
    background: var(--color-brand-purple-light);
}

.podcast-player-control.skip-backward,
.podcast-player-control.skip-forward {
    font-size: 1rem;
    opacity: 0.8;
    position: relative;
}

.podcast-player-control.skip-backward:hover,
.podcast-player-control.skip-forward:hover {
    opacity: 1;
    background: var(--color-brand-purple-alpha);
    color: var(--color-brand-primary);
    transform: scale(1.1);
}

.podcast-player-control.skip-backward::after,
.podcast-player-control.skip-forward::after {
    content: '10s';
    position: absolute;
    bottom: -2px;
    right: -2px;
    font-size: 0.6rem;
    opacity: 0.7;
    font-weight: 500;
}

.podcast-player-progress {
    flex: 1;
    margin: 0 1rem;
    min-width: 100px;
}

.podcast-player-progress-bar {
    width: 100%;
    height: 4px;
    background: var(--color-border-muted);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
    margin-bottom: 0.25rem;
}

.podcast-player-progress-fill {
    height: 100%;
    background: var(--color-brand-primary);
    transition: width 0.1s ease;
}

.podcast-player-time {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.podcast-player-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.podcast-player-close:hover {
    background: var(--color-danger);
    color: white;
}

/* ===== PODCAST LIBRARY COMPONENTS ===== */

.podcast-library {
    padding: 2rem 0;
}

.podcast-library-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.podcast-library-title {
    font-size: var(--font-size-h2);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.podcast-library-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.podcast-search {
    position: relative;
    min-width: 280px;
}

.podcast-search input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    background: var(--color-bg-glass);
    border: 1px solid var(--color-border-muted);
    border-radius: 8px;
    color: var(--color-text-primary);
    font-size: var(--font-size-sm);
    transition: all 0.3s ease;
}

.podcast-search input:focus {
    outline: none;
    border-color: var(--color-brand-primary);
    box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.podcast-search input::placeholder {
    color: var(--color-text-muted);
}

.podcast-search i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.podcast-filter {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.podcast-filter-item {
    background: var(--color-bg-glass);
    border: 1px solid var(--color-border-muted);
    border-radius: 20px;
    padding: 8px 16px;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.podcast-filter-item:hover {
    background: var(--color-brand-purple-alpha);
    color: var(--color-brand-primary);
    border-color: var(--color-brand-primary);
}

.podcast-filter-item.active {
    background: var(--color-brand-primary);
    color: white;
    border-color: var(--color-brand-primary);
}

.podcast-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--color-text-muted);
}

.podcast-empty i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--color-brand-primary);
}

.podcast-empty h3 {
    font-size: var(--font-size-h4);
    margin-bottom: 1rem;
    color: var(--color-text-primary);
}

.podcast-loading {
    text-align: center;
    padding: 4rem 2rem;
}

.podcast-loading i {
    font-size: 2rem;
    color: var(--color-brand-primary);
    animation: spin 1s linear infinite;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {
    .podcast-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .podcast-card {
        padding: 1rem;
    }
    
    .podcast-card-header {
        flex-direction: column;
        text-align: center;
    }
    
    .podcast-card-image {
        width: 100px;
        height: 100px;
        margin: 0 auto;
    }
    
    .podcast-card-actions {
        flex-direction: column;
    }
    
    .podcast-card-actions .btn {
        flex: none;
        width: 100%;
    }
    
    .podcast-library-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .podcast-library-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .podcast-search {
        min-width: auto;
    }
    
    .podcast-filter {
        justify-content: center;
    }
    
    .podcast-player-container {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .podcast-player-info {
        order: 2;
    }
    
    .podcast-player-controls {
        order: 1;
        justify-content: center;
    }
    
    .podcast-player-progress {
        order: 3;
        margin: 0;
    }
    
    .podcast-player-close {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
    }
}

@media (max-width: 480px) {
    .podcast-card-image {
        width: 80px;
        height: 80px;
    }
    
    .podcast-card-header {
        flex-direction: row;
        text-align: left;
    }
    
    .podcast-player {
        padding: 0.75rem;
    }
    
    .podcast-player-container {
        gap: 0.5rem;
    }
    
    .podcast-player-control {
        min-height: 40px;
        min-width: 40px;
        padding: 0.25rem;
    }
    
    .podcast-player-progress {
        margin: 0.5rem 0;
    }
}

/* ===== PODCAST SPECIFIC UTILITIES ===== */

.podcast-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 4px 8px;
    background: var(--color-brand-purple-alpha);
    color: var(--color-brand-primary);
    border-radius: 12px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
}

.podcast-badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--color-success);
}

.podcast-badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

.podcast-badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
}

.podcast-badge-info {
    background: rgba(6, 182, 212, 0.1);
    color: var(--color-info);
}

.podcast-duration {
    font-variant-numeric: tabular-nums;
    font-weight: var(--font-weight-medium);
}

.podcast-category {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
}

/* ===== ANIMATIONS ===== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease-out;
}

.animate-slideUp {
    animation: slideUp 0.3s ease-out;
}

/* Staggered animation for podcast cards */
.podcast-card:nth-child(1) { animation-delay: 0.1s; }
.podcast-card:nth-child(2) { animation-delay: 0.2s; }
.podcast-card:nth-child(3) { animation-delay: 0.3s; }
.podcast-card:nth-child(4) { animation-delay: 0.4s; }
.podcast-card:nth-child(5) { animation-delay: 0.5s; }
.podcast-card:nth-child(6) { animation-delay: 0.6s; }
.podcast-card:nth-child(7) { animation-delay: 0.7s; }
.podcast-card:nth-child(8) { animation-delay: 0.8s; }
.podcast-card:nth-child(9) { animation-delay: 0.9s; }