/**
 * Based Social Feed - Frontend Styles
 *
 * Uses VfL Wolfsburg brand colors:
 * --based-green: #40a639
 * --based-dark-green: #1b5125
 */

/* Container */
.based-social-feed {
    width: 100%;
    box-sizing: border-box;
}

/* Empty state */
.based-social-feed-empty {
    text-align: center;
    padding: 40px 20px;
}

.based-no-posts {
    color: #666;
    font-size: 1rem;
}

/* Grid Layout */
.based-social-feed-grid {
    display: grid;
    gap: 16px;
}

.based-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.based-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.based-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Feed Item */
.based-social-feed-item {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    text-decoration: none;
    background-color: #f0f0f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.based-social-feed-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* YouTube items - 16:9 aspect ratio to show full thumbnail */
.based-social-feed-item.based-platform-youtube {
    aspect-ratio: 16 / 9;
}

/* Image container */
.based-feed-item-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.based-feed-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.based-social-feed-item:hover .based-feed-item-image img {
    transform: scale(1.05);
}

/* Play icon for videos */
.based-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background 0.3s ease;
    z-index: 2;
}

.based-play-icon svg {
    width: 28px;
    height: 28px;
    color: #40a639;
    margin-left: 4px;
}

.based-social-feed-item:hover .based-play-icon {
    transform: translate(-50%, -50%) scale(1.1);
    background: #40a639;
}

.based-social-feed-item:hover .based-play-icon svg {
    color: #fff;
}

/* Carousel icon */
.based-carousel-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.based-carousel-icon svg {
    width: 18px;
    height: 18px;
    color: #333;
}

/* Overlay */
.based-feed-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px;
    box-sizing: border-box;
    z-index: 3;
}

.based-social-feed-item:hover .based-feed-item-overlay {
    opacity: 1;
}

/* Platform badge */
.based-platform-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 4;
}

.based-platform-badge svg {
    width: 18px;
    height: 18px;
}

/* Instagram badge color */
.based-platform-instagram .based-platform-badge svg {
    color: #E4405F;
}

/* YouTube badge color */
.based-platform-youtube .based-platform-badge svg {
    color: #FF0000;
}

/* Content in overlay */
.based-feed-item-content {
    color: #fff;
    background: rgba(0, 0, 0, 0.75);
    padding: 10px 12px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
}

.based-feed-item-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #fff !important;
}

.based-feed-item-caption {
    font-size: 0.85rem;
    margin: 0 0 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0.9;
    color: #fff !important;
}

.based-feed-item-date {
    font-size: 0.75rem;
    opacity: 0.8;
    color: #fff !important;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .based-columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .based-columns-4,
    .based-columns-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .based-social-feed-grid {
        gap: 12px;
    }

    .based-play-icon {
        width: 48px;
        height: 48px;
    }

    .based-play-icon svg {
        width: 22px;
        height: 22px;
    }

    .based-feed-item-overlay {
        padding: 12px;
    }

    .based-feed-item-title {
        font-size: 0.85rem;
    }

    .based-feed-item-caption {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .based-columns-4,
    .based-columns-3,
    .based-columns-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .based-social-feed-grid {
        gap: 8px;
    }

    .based-platform-badge {
        width: 28px;
        height: 28px;
        top: 8px;
        left: 8px;
    }

    .based-platform-badge svg {
        width: 14px;
        height: 14px;
    }

    .based-play-icon {
        width: 40px;
        height: 40px;
    }

    .based-play-icon svg {
        width: 18px;
        height: 18px;
    }
}

/* Match VfL theme button style for potential "load more" button */
.based-social-feed-load-more {
    display: inline-block;
    background: #40a639;
    color: white;
    padding: 16px 48px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    margin-top: 2rem;
}

.based-social-feed-load-more:hover {
    background: #359030;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(101, 179, 46, 0.3);
    color: white;
}

/* Skeleton loading state */
.based-social-feed-loading .based-social-feed-item {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: based-skeleton-loading 1.5s infinite;
}

@keyframes based-skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .based-social-feed-item {
        background-color: #2a2a2a;
    }

    .based-no-posts {
        color: #aaa;
    }

    .based-platform-badge {
        background: rgba(255, 255, 255, 0.95);
    }

    .based-play-icon {
        background: rgba(30, 30, 30, 0.9);
    }

    .based-play-icon svg {
        color: #40a639;
    }

    .based-social-feed-item:hover .based-play-icon svg {
        color: #fff;
    }

    .based-feed-item-content,
    .based-feed-item-title,
    .based-feed-item-caption,
    .based-feed-item-date {
        color: #fff;
    }
}
