/* ============================================ */
/* BANTU WAVES: MIDNIGHT SESSIONS
   Home Feed Component - Late-Night Content Curation
   Includes: Lo-Fi Beats, Late-Night Podcasts, Acoustic Sets, Neo-Noir Content
/* ============================================ */

/* Section Container */
.bantu-waves-midnight {
    margin-bottom: var(--spacing-2xl, 2rem);
    position: relative;
    border-radius: var(--radius-2xl, 1.25rem);
    transition: all var(--transition-normal, 0.3s ease);
}

/* Midnight Mode Active Styling */
.bantu-waves-midnight.midnight-active {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(29, 78, 216, 0.1));
    padding: var(--spacing-lg, 1.5rem);
    border: 1px solid rgba(245, 158, 11, 0.3);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.1);
}

.bantu-waves-midnight.midnight-inactive {
    opacity: 0.85;
}

/* Section Header */
.bantu-waves-midnight .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg, 1.5rem);
    flex-wrap: wrap;
    gap: var(--spacing-sm, 0.5rem);
}

.bantu-waves-midnight .section-title {
    font-family: 'Orbitron', monospace;
    font-size: var(--font-xl, 1.25rem);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm, 0.5rem);
    background: linear-gradient(135deg, var(--soft-white, #F8FAFC), #8B5CF6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.bantu-waves-midnight .section-title i {
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    color: #8B5CF6;
}

/* Midnight Time Badge */
.midnight-time-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs, 0.5rem);
    padding: 6px 14px;
    background: rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-full, 9999px);
    font-size: var(--font-xs, 0.75rem);
    font-weight: 500;
    color: #A78BFA;
}

.midnight-time-badge.active {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warm-gold, #F59E0B);
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.2); }
    50% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
}

/* Now Playing Button */
.now-playing-btn {
    background: linear-gradient(135deg, #8B5CF6, #6366F1);
    border: none;
    padding: 8px 20px;
    border-radius: var(--radius-full, 9999px);
    color: white;
    font-weight: 600;
    font-size: var(--font-sm, 0.875rem);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-fast, 0.15s ease);
}

.now-playing-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.now-playing-btn i {
    font-size: 12px;
}

/* Midnight Grid */
.midnight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg, 1.5rem);
}

/* Midnight Card */
.midnight-card {
    background: var(--card-bg, rgba(15, 23, 42, 0.6));
    border: 1px solid var(--card-border, rgba(148, 163, 184, 0.2));
    border-radius: var(--radius-xl, 1rem);
    overflow: hidden;
    transition: all var(--transition-normal, 0.3s ease);
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
}

.midnight-card.visible {
    opacity: 1;
    transform: translateY(0);
    animation: fadeInUp 0.4s ease forwards;
}

.midnight-card:hover {
    transform: translateY(-6px);
    border-color: #8B5CF6;
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.3);
}

/* Midnight Mode Active Card Hover */
.bantu-waves-midnight.midnight-active .midnight-card:hover {
    border-color: var(--warm-gold, #F59E0B);
    box-shadow: 0 20px 30px rgba(245, 158, 11, 0.2);
}

/* Thumbnail */
.midnight-thumbnail {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.midnight-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal, 0.3s ease);
}

.midnight-card:hover .midnight-thumbnail img {
    transform: scale(1.05);
}

.thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 40%, rgba(0, 0, 0, 0.7) 100%);
    pointer-events: none;
    z-index: 1;
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal, 0.3s ease);
    z-index: 2;
}

.midnight-card:hover .play-overlay {
    opacity: 1;
}

.play-icon {
    width: 50px;
    height: 50px;
    background: rgba(139, 92, 246, 0.9);
    border-radius: var(--radius-full, 9999px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--icon-lg, 1.5rem);
    transform: scale(0.8);
    transition: transform var(--transition-normal, 0.3s ease);
}

.midnight-card:hover .play-icon {
    transform: scale(1);
}

/* Badges */
.duration-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.8);
    padding: 4px 8px;
    border-radius: var(--radius-sm, 0.375rem);
    font-size: var(--font-xs, 0.75rem);
    z-index: 3;
}

.time-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: var(--radius-full, 9999px);
    font-size: var(--font-xs, 0.75rem);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 3;
}

.time-badge.late-night {
    background: rgba(0, 0, 0, 0.8);
    color: #A78BFA;
}

.time-badge.evening {
    background: rgba(245, 158, 11, 0.9);
    color: var(--deep-black, #0A0E12);
}

.time-badge.midnight-mode {
    background: linear-gradient(135deg, #8B5CF6, #6366F1);
    color: white;
}

.local-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    padding: 4px 10px;
    border-radius: var(--radius-full, 9999px);
    font-size: var(--font-xs, 0.75rem);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 3;
}

/* Content Info */
.midnight-info {
    padding: var(--spacing-md, 1rem);
}

.content-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(139, 92, 246, 0.15);
    padding: 4px 10px;
    border-radius: var(--radius-full, 9999px);
    font-size: var(--font-xs, 0.75rem);
    margin-bottom: var(--spacing-sm, 0.75rem);
    text-transform: capitalize;
    color: #A78BFA;
}

.midnight-title {
    font-size: var(--font-base, 1rem);
    font-weight: 600;
    margin-bottom: var(--spacing-xs, 0.5rem);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--soft-white, #F8FAFC);
}

.midnight-creator {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs, 0.5rem);
    margin-bottom: var(--spacing-sm, 0.75rem);
}

.creator-avatar-small {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full, 9999px);
    background: linear-gradient(135deg, #8B5CF6, #6366F1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: var(--font-xs, 0.75rem);
    font-weight: bold;
    color: white;
}

.creator-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.creator-name {
    font-size: var(--font-sm, 0.875rem);
    color: var(--slate-grey, #94A3B8);
}

/* Mood Tags */
.mood-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--spacing-sm, 0.75rem);
}

.mood-tag {
    background: rgba(139, 92, 246, 0.1);
    padding: 2px 8px;
    border-radius: var(--radius-full, 9999px);
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #A78BFA;
}

.mood-tag i {
    font-size: 8px;
}

/* Stats */
.midnight-stats {
    display: flex;
    gap: var(--spacing-md, 1rem);
    font-size: var(--font-xs, 0.75rem);
    color: var(--slate-grey, #94A3B8);
    margin-bottom: var(--spacing-sm, 0.75rem);
    flex-wrap: wrap;
}

.midnight-stats i {
    margin-right: 4px;
    font-size: 10px;
}

/* Actions */
.midnight-actions {
    display: flex;
    gap: var(--spacing-sm, 0.75rem);
    padding-top: var(--spacing-xs, 0.5rem);
    border-top: 1px solid var(--card-border, rgba(148, 163, 184, 0.2));
}

.midnight-actions .action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-md, 0.5rem);
    color: var(--slate-grey, #94A3B8);
    cursor: pointer;
    transition: all var(--transition-fast, 0.15s ease);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-xs, 0.75rem);
}

.midnight-actions .action-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    color: #A78BFA;
    transform: translateY(-2px);
}

.midnight-actions .listen-now-btn {
    background: linear-gradient(135deg, #8B5CF6, #6366F1);
    color: white;
}

.midnight-actions .listen-now-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.add-queue-btn {
    flex-shrink: 0;
    width: 36px;
    padding: 8px !important;
    justify-content: center;
}

/* Skeleton Loading */
.skeleton-midnight-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-xl, 1rem);
    overflow: hidden;
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

.skeleton-midnight-card .skeleton-thumbnail {
    aspect-ratio: 16 / 9;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
}

.skeleton-midnight-card .skeleton-title {
    height: 20px;
    margin: 12px 12px 8px;
    width: 80%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    border-radius: 4px;
}

.skeleton-midnight-card .skeleton-creator {
    height: 16px;
    margin: 0 12px 8px;
    width: 60%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    border-radius: 4px;
}

.skeleton-midnight-card .skeleton-stats {
    height: 14px;
    margin: 0 12px 12px;
    width: 70%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    border-radius: 4px;
}

@keyframes skeletonPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.3; }
}

/* Empty & Error States */
.empty-state-midnight,
.error-state-midnight {
    text-align: center;
    padding: var(--spacing-3xl, 3rem);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-xl, 1rem);
    grid-column: 1 / -1;
}

.empty-state-midnight i,
.error-state-midnight i {
    font-size: var(--font-3xl, 1.875rem);
    color: var(--slate-grey, #94A3B8);
    margin-bottom: var(--spacing-md, 1rem);
    opacity: 0.5;
}

.empty-state-midnight h3,
.error-state-midnight h3 {
    font-size: var(--font-lg, 1.125rem);
    margin-bottom: var(--spacing-xs, 0.5rem);
}

.retry-btn {
    background: linear-gradient(135deg, #8B5CF6, #6366F1);
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-full, 9999px);
    color: white;
    font-weight: 600;
    margin-top: var(--spacing-md, 1rem);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-fast, 0.15s ease);
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

/* Theme Adjustments */
.theme-light .bantu-waves-midnight.midnight-active {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.05), rgba(99, 102, 241, 0.05));
}

.theme-light .midnight-card {
    background: rgba(255, 255, 255, 0.9);
}

.theme-light .midnight-actions .action-btn {
    background: rgba(0, 0, 0, 0.05);
}

.theme-light .midnight-actions .action-btn:hover {
    background: rgba(139, 92, 246, 0.1);
}

.theme-high-contrast .midnight-card {
    border-width: 2px;
}

.theme-high-contrast .listen-now-btn,
.theme-high-contrast .now-playing-btn {
    border: 2px solid var(--border-color);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .bantu-waves-midnight.midnight-active {
        padding: var(--spacing-md, 1rem);
    }
    
    .midnight-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md, 1rem);
    }
    
    .midnight-info {
        padding: var(--spacing-sm, 0.75rem);
    }
    
    .midnight-stats {
        gap: var(--spacing-sm, 0.75rem);
        flex-wrap: wrap;
    }
    
    .midnight-time-badge {
        font-size: 10px;
        padding: 4px 10px;
    }
    
    .now-playing-btn {
        padding: 6px 14px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .midnight-actions {
        flex-wrap: wrap;
    }
    
    .midnight-actions .action-btn {
        flex: 1;
        justify-content: center;
    }
    
    .add-queue-btn {
        flex: 0 0 auto;
        width: 40px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .midnight-time-badge {
        order: 2;
        margin-top: 8px;
    }
}

/* Animation Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Midnight Mode Special Effects */
.bantu-waves-midnight.midnight-active .midnight-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 30%, rgba(139, 92, 246, 0.1) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Starry Night Effect for Midnight Mode */
.bantu-waves-midnight.midnight-active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: radial-gradient(2px 2px at 20px 30px, #fff, rgba(0,0,0,0)),
                      radial-gradient(1px 1px at 40px 70px, #fff, rgba(0,0,0,0));
    background-size: 200px 200px, 150px 150px;
    background-repeat: no-repeat;
    opacity: 0.3;
    border-radius: inherit;
    z-index: -1;
}
