/**
 * Facebook Videos Widget - Frontend Styles
 * Minimal and Modern Design
 */

/* Container */
.fbv-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header */
.fbv-header {
    text-align: center;
    margin-bottom: 32px;
}

.fbv-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    letter-spacing: -0.02em;
}

.fbv-subtitle {
    font-size: 14px;
    color: #666;
    font-weight: 400;
    margin: 8px 0 0 0;
}

/* Grid */
.fbv-videos-grid {
    display: grid;
    gap: 24px;
    margin-bottom: 40px;
}

/* Grid columns based on data attributes */
.fbv-videos-grid[data-columns-desktop="1"] {
    grid-template-columns: 1fr;
}

.fbv-videos-grid[data-columns-desktop="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.fbv-videos-grid[data-columns-desktop="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.fbv-videos-grid[data-columns-desktop="4"] {
    grid-template-columns: repeat(4, 1fr);
}

/* Video Card */
.fbv-video-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    animation: fbvFadeInUp 0.6s ease forwards;
    opacity: 0;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.fbv-video-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    border-color: rgba(0, 0, 0, 0.08);
}

/* Thumbnail */
.fbv-video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.fbv-video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fbv-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Overlay */
.fbv-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fbv-video-card:hover .fbv-video-overlay {
    opacity: 1;
}

/* Play Button */
.fbv-play-button {
    width: 64px;
    height: 64px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    position: relative;
}

.fbv-video-card:hover .fbv-play-button {
    transform: scale(1);
}

.fbv-play-button::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 16px solid #1877f2;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    margin-left: 4px;
}

/* Duration Badge */
.fbv-duration {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* Facebook Badge */
.fbv-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    color: #1877f2;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.fbv-video-card:hover .fbv-badge {
    opacity: 1;
}

.fbv-icon {
    width: 12px;
    height: 12px;
    fill: #1877f2;
}

/* Video Info */
.fbv-video-info {
    padding: 20px;
}

.fbv-video-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Meta */
.fbv-video-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}

.fbv-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.fbv-meta-icon {
    width: 16px;
    height: 16px;
    opacity: 0.6;
}

/* Stats */
.fbv-video-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.fbv-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
    white-space: nowrap;
}

.fbv-stat-icon {
    font-size: 16px;
    flex-shrink: 0;
}

/* Lightbox */
.fbv-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

.fbv-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
}

.fbv-lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.fbv-lightbox-close {
    position: fixed;
    top: 60px;
    right: 20px;
    background: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    color: #333;
}

.fbv-lightbox-close:hover {
    transform: scale(1.1);
    background: #f5f5f5;
}

.fbv-video-wrapper {
    max-width: 1200px;
    width: 100%;
    aspect-ratio: 16/9;
}

#fbv-video-player {
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

/* Animations */
@keyframes fbvFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Error & Empty States */
.fbv-error,
.fbv-empty {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
}

.fbv-empty {
    background: #e7f3ff;
    border-color: #2196f3;
    color: #0c5ba0;
}

/* Tablet Styles */
@media (max-width: 991px) {
    .fbv-videos-grid[data-columns-tablet="1"] {
        grid-template-columns: 1fr;
    }
    
    .fbv-videos-grid[data-columns-tablet="2"] {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .fbv-videos-grid[data-columns-tablet="3"] {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .fbv-title {
        font-size: 24px;
    }
    
    .fbv-container {
        padding: 30px 16px;
    }
}

/* Mobile Styles */
@media (max-width: 767px) {
    .fbv-videos-grid[data-columns-mobile="1"] {
        grid-template-columns: 1fr;
    }
    
    .fbv-videos-grid[data-columns-mobile="2"] {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .fbv-videos-grid {
        gap: 16px;
    }
    
    .fbv-title {
        font-size: 20px;
    }
    
    .fbv-subtitle {
        font-size: 13px;
    }
    
    .fbv-container {
        padding: 20px 12px;
    }
    
    .fbv-header {
        margin-bottom: 24px;
    }
    
    .fbv-video-card {
        border-radius: 10px;
    }
    
    .fbv-video-info {
        padding: 12px;
    }
    
    .fbv-video-title {
        font-size: 14px;
        line-height: 1.3;
        -webkit-line-clamp: 2;
        margin-bottom: 6px;
    }
    
    .fbv-video-meta {
        font-size: 11px;
        margin-bottom: 8px;
        gap: 8px;
    }
    
    .fbv-meta-icon {
        width: 14px;
        height: 14px;
    }
    
    .fbv-video-stats {
        gap: 10px;
        padding-top: 8px;
        flex-wrap: wrap;
    }
    
    .fbv-stat-item {
        font-size: 11px;
        gap: 4px;
    }
    
    .fbv-stat-icon {
        font-size: 13px;
    }
    
    .fbv-play-button {
        width: 56px;
        height: 56px;
    }
    
    .fbv-play-button::after {
        border-left-width: 14px;
        border-top-width: 9px;
        border-bottom-width: 9px;
    }
    
    .fbv-duration {
        font-size: 11px;
        padding: 3px 6px;
        bottom: 8px;
        right: 8px;
    }
    
    .fbv-badge {
        font-size: 10px;
        padding: 4px 8px;
        top: 8px;
        left: 8px;
    }
    
    .fbv-icon {
        width: 12px;
        height: 12px;
    }
    
    .fbv-lightbox-content {
        padding: 16px;
    }
    
    .fbv-video-wrapper {
        max-width: 100%;
    }
    
    .fbv-lightbox-close {
        top: max(50px, env(safe-area-inset-top, 20px) + 30px);
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 24px;
        background: rgba(255, 255, 255, 0.95);
    }
}

/* Extra small devices (iPhone SE, etc) */
@media (max-width: 375px) {
    .fbv-container {
        padding: 16px 10px;
    }
    
    .fbv-videos-grid {
        gap: 12px;
    }
    
    .fbv-video-title {
        font-size: 13px;
    }
    
    .fbv-video-info {
        padding: 10px;
    }
    
    .fbv-stat-item {
        font-size: 10px;
    }
}

/* Print Styles */
@media print {
    .fbv-video-overlay,
    .fbv-play-button,
    .fbv-lightbox {
        display: none !important;
    }
}
