/* =========================================== */
/* VIDEO FEED PERSONALIZER - MAIN FEED STYLES */
/* =========================================== */

#vfp-main-feed {
    padding: 12px 0;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    width: 100%;
}

/* Grid system */
.vfp-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    align-items: start;
    max-width: 1400px;
    margin: 0 auto;
}

@media (min-width: 800px) {
    .vfp-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1400px) {
    .vfp-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Video item */
.vfp-item {
    border-radius: 10px;
    overflow: hidden;
    background: transparent;
    transition: transform 0.25s ease;
    position: relative;
}

.vfp-item:hover {
    transform: translateY(-2px);
}

/* Link */
.vfp-link {
    display: block;
    text-decoration: none;
    color: inherit;
    outline: none;
}

/* Thumbnail wrapper */
.vfp-thumb-wrapper {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 8px;
    display: block;
    position: relative;
    background: #f8f9fa;
}

/* Thumbnail image */
.vfp-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
    background: #f8f9fa;
}

.vfp-item:hover .vfp-thumb {
    transform: scale(1.03);
}

/* Duration badge */
.vfp-duration {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 12px;
    padding: 3px 6px;
    border-radius: 4px;
    z-index: 5;
    font-weight: 500;
    line-height: 1;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* Video metadata */
.vfp-meta {
    margin-top: 8px;
    text-align: left;
    padding: 0 6px 10px;
}

/* Video title */
.vfp-title {
    font-size: 13px;
    line-height: 1.2;
    margin: 0;
    font-weight: 600;
    color: inherit;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

/* Loading indicator */
.vfp-loading {
    text-align: center;
    padding: 12px;
    color: #666;
    font-size: 13px;
    grid-column: 1 / -1;
}

/* Error state */
.vfp-error {
    text-align: center;
    padding: 20px;
    color: #dc2626;
    font-size: 14px;
    grid-column: 1 / -1;
    background: #fef2f2;
    border-radius: 8px;
    margin: 10px;
}

/* Empty state */
.vfp-empty {
    text-align: center;
    padding: 30px;
    color: #6b7280;
    font-size: 14px;
    grid-column: 1 / -1;
}

/* =========================================== */
/* DARK THEME SUPPORT */
/* =========================================== */

/* Theme-aware variables */
:root {
    --vfp-bg-color: transparent;
    --vfp-thumb-bg: #f8f9fa;
    --vfp-text-color: inherit;
    --vfp-title-color: #2d3748;
    --vfp-loading-color: #666;
    --vfp-duration-bg: rgba(0, 0, 0, 0.7);
    --vfp-duration-color: #fff;
    --vfp-hover-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Dark theme variables */
[data-theme="dark"],
.theme-dark,
body.dark-mode,
.dark-theme {
    --vfp-bg-color: transparent;
    --vfp-thumb-bg: #2d3748;
    --vfp-text-color: #e2e8f0;
    --vfp-title-color: #e2e8f0;
    --vfp-loading-color: #a0aec0;
    --vfp-duration-bg: rgba(0, 0, 0, 0.8);
    --vfp-duration-color: #fff;
    --vfp-hover-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Apply theme variables */
.vfp-item {
    background: var(--vfp-bg-color);
}

.vfp-thumb-wrapper {
    background: var(--vfp-thumb-bg);
}

.vfp-thumb {
    background: var(--vfp-thumb-bg);
}

.vfp-title {
    color: var(--vfp-title-color);
}

.vfp-loading {
    color: var(--vfp-loading-color);
}

.vfp-duration {
    background: var(--vfp-duration-bg);
    color: var(--vfp-duration-color);
}

.vfp-item:hover {
    box-shadow: var(--vfp-hover-shadow);
}

/* =========================================== */
/* SPECIFIC THEME OVERRIDES */
/* =========================================== */

/* Astra Theme */
.ast-container .vfp-list {
    max-width: 100%;
}

/* GeneratePress Theme */
.site-main .vfp-list {
    max-width: 100%;
}

/* OceanWP Theme */
.container .vfp-list {
    max-width: 100%;
}

/* Twenty Twenty+ Themes */
.entry-content .vfp-list {
    max-width: 100%;
}

/* =========================================== */
/* ACCESSIBILITY & PERFORMANCE */
/* =========================================== */

/* Focus styles for accessibility */
.vfp-link:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 8px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .vfp-item,
    .vfp-thumb,
    .vfp-item:hover .vfp-thumb {
        transition: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .vfp-duration {
        background: #000;
        color: #fff;
    }
}

/* Print styles */
@media print {
    .vfp-list {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    
    .vfp-duration {
        display: none;
    }
    
    .vfp-item:hover {
        transform: none !important;
        box-shadow: none !important;
    }
}