/* ============================================
   WAVELETS - Short-form Content Module
   (Formerly Quick Bits - Renamed for better brand alignment)
   ============================================ */

/* Section Container */
#wavelets-section {
    margin-bottom: calc(2.5rem * var(--ui-scale));
}

/* Wavelets Container - Horizontal Scroll */
.wavelets-container {
    display: flex;
    gap: calc(1rem * var(--ui-scale));
    overflow-x: auto;
    padding: calc(1.25rem * var(--ui-scale)) calc(0.625rem * var(--ui-scale));
    scrollbar-width: thin;
    scrollbar-color: var(--warm-gold) var(--card-bg);
    -webkit-overflow-scrolling: touch;
}

.wavelets-container::-webkit-scrollbar {
    height: 6px;
}

.wavelets-container::-webkit-scrollbar-track {
    background: var(--card-bg);
    border-radius: 10px;
}

.wavelets-container::-webkit-scrollbar-thumb {
    background: var(--warm-gold);
    border-radius: 10px;
}

/* Wavelet Card */
.wavelet-card {
    flex: 0 0 auto;
    width: calc(11.25rem * var(--ui-scale));
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: calc(1.25rem * var(--ui-scale));
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    position: relative;
}

.wavelet-card:hover {
    transform: translateY(calc(-0.5rem * var(--ui-scale)));
    border-color: var(--warm-gold);
    box-shadow: 0 calc(0.75rem * var(--ui-scale)) calc(1.5rem * var(--ui-scale)) rgba(0, 0, 0, 0.3);
}

/* Wavelet Thumbnail */
.wavelet-thumbnail {
    position: relative;
    height: calc(18.75rem * var(--ui-scale));
    overflow: hidden;
}

.wavelet-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

/* Wavelet Overlay */
.wavelet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wavelet-card:hover .wavelet-overlay {
    opacity: 1;
}

.wavelet-overlay i {
    color: white;
    font-size: calc(2.5rem * var(--ui-scale));
    text-shadow: 0 0 calc(0.625rem * var(--ui-scale)) rgba(0, 0, 0, 0.5);
}

/* Wavelet Badge */
.wavelet-badge {
    position: absolute;
    top: var(--spacing-xs);
    left: var(--spacing-xs);
    background: linear-gradient(135deg, var(--bantu-blue), var(--warm-gold));
    color: white;
    padding: calc(0.25rem * var(--ui-scale)) calc(0.625rem * var(--ui-scale));
    border-radius: calc(0.75rem * var(--ui-scale));
    font-size: calc(0.625rem * var(--ui-scale));
    font-weight: 600;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 4px;
}

.wavelet-badge i {
    font-size: 8px;
}

/* Duration Badge for Wavelets */
.wavelet-duration {
    position: absolute;
    bottom: var(--spacing-xs);
    right: var(--spacing-xs);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    color: var(--soft-white);
    font-size: var(--font-xs);
    padding: calc(0.125rem * var(--ui-scale)) calc(0.375rem * var(--ui-scale));
    border-radius: calc(0.25rem * var(--ui-scale));
    z-index: 4;
    font-weight: 500;
}

/* View Count Badge */
.wavelet-views {
    position: absolute;
    bottom: var(--spacing-xs);
    left: var(--spacing-xs);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    color: var(--warm-gold);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 12px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 4px;
}

.wavelet-views i {
    font-size: 8px;
}

/* Wavelet Info */
.wavelet-info {
    padding: var(--spacing-sm);
}

.wavelet-title {
    font-size: var(--font-sm);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--soft-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wavelet-creator {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: var(--spacing-xs);
}

.wavelet-creator-avatar {
    width: calc(1.5rem * var(--ui-scale));
    height: calc(1.5rem * var(--ui-scale));
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bantu-blue), var(--warm-gold));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.wavelet-creator-name {
    font-size: var(--font-xs);
    color: var(--slate-grey);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wavelet-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    color: var(--slate-grey);
}

.wavelet-stats i {
    font-size: 8px;
}

.wavelet-connectors {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--warm-gold);
}

/* Wavelet Animation */
@keyframes waveletPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

.wavelet-card.pulsing {
    animation: waveletPulse 0.5s ease;
}

/* Loading State */
.wavelets-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: calc(2rem * var(--ui-scale));
    color: var(--slate-grey);
}

.wavelets-loading .spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(245, 158, 11, 0.2);
    border-top-color: var(--warm-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Empty State */
.wavelets-empty {
    text-align: center;
    padding: calc(2rem * var(--ui-scale));
    color: var(--slate-grey);
}

.wavelets-empty i {
    font-size: calc(2.5rem * var(--ui-scale));
    margin-bottom: var(--spacing-sm);
    opacity: 0.5;
}

.wavelets-empty p {
    font-size: var(--font-sm);
}

/* Skeleton Loading */
.wavelet-skeleton {
    flex: 0 0 auto;
    width: calc(11.25rem * var(--ui-scale));
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: calc(1.25rem * var(--ui-scale));
    overflow: hidden;
}

.wavelet-skeleton-thumbnail {
    height: calc(18.75rem * var(--ui-scale));
    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%;
    animation: skeletonWave 1.5s infinite;
}

@keyframes skeletonWave {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.wavelet-skeleton-title {
    height: 14px;
    margin: 12px 12px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    width: 80%;
}

.wavelet-skeleton-creator {
    height: 10px;
    margin: 0 12px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    width: 60%;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .wavelet-card {
        width: calc(9rem * var(--ui-scale));
    }
    
    .wavelet-thumbnail {
        height: calc(15rem * var(--ui-scale));
    }
    
    .wavelet-title {
        font-size: calc(0.6875rem * var(--ui-scale));
    }
    
    .wavelet-creator-name {
        font-size: 9px;
    }
    
    .wavelet-stats {
        font-size: 8px;
    }
    
    .wavelet-overlay i {
        font-size: calc(1.5rem * var(--ui-scale));
    }
}

@media (max-width: 480px) {
    .wavelet-card {
        width: calc(7.5rem * var(--ui-scale));
    }
    
    .wavelet-thumbnail {
        height: calc(12rem * var(--ui-scale));
    }
    
    .wavelet-badge {
        font-size: 8px;
        padding: 2px 6px;
    }
    
    .wavelet-views {
        font-size: 8px;
    }
    
    .wavelet-connectors {
        font-size: 8px;
    }
}

/* Light Theme */
.theme-light .wavelet-card {
    background: rgba(255, 255, 255, 0.95);
}

.theme-light .wavelet-title {
    color: #1a1a1a;
}

.theme-light .wavelet-views,
.theme-light .wavelet-duration {
    background: rgba(0, 0, 0, 0.8);
    color: white;
}

/* High Contrast Theme */
.theme-high-contrast .wavelet-card {
    border-width: 2px;
}

.theme-high-contrast .wavelet-card:hover {
    border-color: var(--warm-gold);
}

.theme-high-contrast .wavelet-overlay {
    background: rgba(0, 0, 0, 0.7);
}

/* Wavelet Play Icon Animation */
@keyframes playPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

.wavelet-card:hover .wavelet-overlay i {
    animation: playPulse 1s infinite;
}

/* Scroll Indicator */
.wavelets-scroll-indicator {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(90deg, transparent, var(--card-bg));
    padding: 20px 30px 20px 60px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wavelets-container.scrollable + .wavelets-scroll-indicator {
    opacity: 1;
}

.wavelets-scroll-indicator i {
    color: var(--warm-gold);
    font-size: 20px;
    animation: scrollBounce 1.5s infinite;
}

@keyframes scrollBounce {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(5px);
    }
}
