/**
 * FoxDoo YouTube Feed - Public Styles
 */

/* CSS Variables */
:root {
    --fyt-cols: 3;
    --fyt-cols-tablet: 2;
    --fyt-cols-mobile: 1;
    --fyt-gap: 10px;
    --fyt-bg-color: transparent;
    --fyt-text-color: #1d1d1d;
    --fyt-title-color: inherit;
    --fyt-title-size: 14px;
    --fyt-desc-color: #606060;
    --fyt-date-color: #606060;
    --fyt-views-color: #606060;
    --fyt-likes-color: #606060;
    --fyt-duration-color: #ffffff;
    --fyt-meta-color: #606060;
    --fyt-button-color: #ff0000;
    --fyt-button-text: #ffffff;
    --fyt-loadmore-color: #ff0000;
    --fyt-border-radius: 0px;
    --fyt-text-align: left;
}

/* Feed Container */
.fyt-feed {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background-color: var(--fyt-bg-color);
    color: var(--fyt-text-color);
}

.fyt-feed *,
.fyt-feed *::before,
.fyt-feed *::after {
    box-sizing: border-box;
}

/* Header */
.fyt-header {
    padding: 20px;
    margin-bottom: 20px;
    background: #f9f9f9;
    border-radius: var(--fyt-border-radius);
}

.fyt-header-banner {
    margin: -20px -20px 20px;
    height: 150px;
    overflow: hidden;
}

.fyt-header-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fyt-header-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.fyt-header-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.fyt-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fyt-header-info {
    flex: 1;
    min-width: 200px;
}

.fyt-header-title {
    margin: 0 0 5px;
    font-size: 20px;
    font-weight: 600;
}

.fyt-header-title a {
    color: inherit;
    text-decoration: none;
}

.fyt-header-title a:hover {
    text-decoration: underline;
}

.fyt-header-subscribers {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--fyt-meta-color);
}

.fyt-header-bio {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.fyt-header-actions {
    flex-shrink: 0;
}

.fyt-subscribe-btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--fyt-button-color);
    color: var(--fyt-button-text);
    text-decoration: none;
    font-weight: 500;
    border-radius: 4px;
    transition: opacity 0.2s;
}

.fyt-subscribe-btn:hover {
    opacity: 0.9;
    color: var(--fyt-button-text);
}

/* Grid Layout */
.fyt-items {
    display: grid;
    grid-template-columns: repeat(var(--fyt-cols), 1fr);
    gap: var(--fyt-gap);
}

.fyt-layout-list .fyt-items {
    grid-template-columns: 1fr;
}

/* Item */
.fyt-item {
    background: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
}

.fyt-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Thumbnail */
.fyt-item-thumbnail {
    position: relative;
    overflow: hidden;
    border-radius: var(--fyt-border-radius);
}

.fyt-item-thumbnail a {
    display: block;
    position: relative;
}

.fyt-item-thumbnail img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.fyt-item:hover .fyt-item-thumbnail img {
    transform: scale(1.05);
}

/* Play Icon */
.fyt-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.9;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}

.fyt-item:hover .fyt-play-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Duration Badge */
.fyt-item-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    padding: 3px 6px;
    background: rgba(0, 0, 0, 0.8);
    color: var(--fyt-duration-color);
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
}

/* Live Badge */
.fyt-item-live {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 8px;
    background: #ff0000;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
}

/* Content */
.fyt-item-content {
    padding: 12px;
    text-align: var(--fyt-text-align);
}

.fyt-item-title {
    margin: 0 0 8px;
    font-size: var(--fyt-title-size);
    font-weight: 500;
    line-height: 1.4;
    color: var(--fyt-title-color);
}

.fyt-item-title a {
    color: inherit;
    text-decoration: none;
}

.fyt-item-title a:hover {
    color: var(--fyt-button-color);
}

.fyt-item-description {
    margin: 0 0 8px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--fyt-desc-color);
}

.fyt-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: var(--fyt-meta-color);
    justify-content: var(--fyt-text-align);
}

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

.fyt-item-date {
    color: var(--fyt-date-color);
}

.fyt-item-views {
    color: var(--fyt-views-color);
}

.fyt-item-likes {
    color: var(--fyt-likes-color);
}

/* List Layout */
.fyt-layout-list .fyt-item {
    display: flex;
    gap: 15px;
}

.fyt-layout-list .fyt-item-thumbnail {
    width: 300px;
    flex-shrink: 0;
}

.fyt-layout-list .fyt-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.fyt-layout-list .fyt-item-title {
    font-size: 16px;
}

/* Gallery Layout */
.fyt-layout-gallery .fyt-featured {
    margin-bottom: var(--fyt-gap);
}

.fyt-layout-gallery .fyt-featured .fyt-item {
    display: block;
}

.fyt-layout-gallery .fyt-featured .fyt-item-thumbnail {
    width: 100%;
}

.fyt-layout-gallery .fyt-featured .fyt-item-content {
    display: none;
}

/* Carousel Layout */
.fyt-layout-carousel .fyt-items {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: var(--fyt-gap);
    padding-bottom: 10px;
}

.fyt-layout-carousel .fyt-items::-webkit-scrollbar {
    display: none;
}

.fyt-layout-carousel .fyt-item {
    flex: 0 0 calc((100% - var(--fyt-gap) * (var(--fyt-cols) - 1)) / var(--fyt-cols));
    scroll-snap-align: start;
}

.fyt-carousel-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.fyt-carousel-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.fyt-carousel-btn:hover {
    background: #e0e0e0;
}

.fyt-carousel-btn svg {
    width: 20px;
    height: 20px;
}

/* Inline Player */
.fyt-item-player {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.fyt-item-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Load More */
.fyt-load-more {
    text-align: center;
    margin-top: 20px;
}

.fyt-load-more-btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--fyt-loadmore-color, var(--fyt-button-color));
    color: var(--fyt-button-text);
    border: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.fyt-load-more-btn:hover {
    opacity: 0.9;
}

.fyt-load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.fyt-load-more-btn.loading {
    pointer-events: none;
}

/* Lightbox */
.fyt-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.fyt-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.fyt-lightbox-content {
    width: 90%;
    max-width: 1200px;
    position: relative;
}

.fyt-lightbox-player {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    background: #000;
}

.fyt-lightbox-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.fyt-lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #fff;
    font-size: 30px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.fyt-lightbox-close:hover {
    opacity: 1;
}

.fyt-lightbox-info {
    color: #fff;
    padding: 15px 0;
}

.fyt-lightbox-title {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 500;
}

.fyt-lightbox-meta {
    font-size: 14px;
    color: #aaa;
}

/* GDPR Notice */
.fyt-gdpr-notice {
    padding: 40px 20px;
    background: #f5f5f5;
    border-radius: var(--fyt-border-radius);
    text-align: center;
}

.fyt-gdpr-icon {
    margin-bottom: 15px;
    color: #ccc;
}

.fyt-gdpr-message {
    margin: 0 0 15px;
    font-size: 14px;
    color: #666;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.fyt-gdpr-button {
    display: inline-block;
    padding: 12px 30px;
    background: var(--fyt-button-color);
    color: var(--fyt-button-text);
    border: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.fyt-gdpr-button:hover {
    opacity: 0.9;
}

.fyt-gdpr-link {
    margin-top: 15px;
    font-size: 12px;
}

.fyt-gdpr-link a {
    color: #666;
}

/* Error & Empty States */
.fyt-error,
.fyt-empty {
    padding: 40px 20px;
    text-align: center;
    background: #f9f9f9;
    border-radius: var(--fyt-border-radius);
}

.fyt-error {
    background: #fee;
    color: #c00;
}

/* Responsive */
@media (max-width: 1024px) {
    .fyt-items {
        grid-template-columns: repeat(var(--fyt-cols-tablet), 1fr);
    }

    .fyt-layout-carousel .fyt-item {
        flex: 0 0 calc((100% - var(--fyt-gap) * (var(--fyt-cols-tablet) - 1)) / var(--fyt-cols-tablet));
    }

    .fyt-layout-list .fyt-item-thumbnail {
        width: 250px;
    }

}

@media (max-width: 768px) {
    .fyt-items {
        grid-template-columns: repeat(var(--fyt-cols-mobile), 1fr);
    }

    .fyt-layout-carousel .fyt-item {
        flex: 0 0 calc((100% - var(--fyt-gap) * (var(--fyt-cols-mobile) - 1)) / var(--fyt-cols-mobile));
    }

    .fyt-layout-list .fyt-item {
        flex-direction: column;
    }

    .fyt-layout-list .fyt-item-thumbnail {
        width: 100%;
    }

    .fyt-header-content {
        flex-direction: column;
        text-align: center;
    }

    .fyt-header-info {
        min-width: 100%;
    }

    .fyt-lightbox-content {
        width: 95%;
    }

    .fyt-lightbox-close {
        top: -40px;
        right: -10px;
    }
}

/* Box Shadow Option */
.fyt-boxshadow .fyt-item {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.fyt-boxshadow .fyt-item:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Hover Effects */
.fyt-hover-zoom .fyt-item-thumbnail img {
    transition: transform 0.4s ease;
}

.fyt-hover-zoom .fyt-item:hover .fyt-item-thumbnail img {
    transform: scale(1.1);
}

.fyt-hover-fade .fyt-item-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s;
}

.fyt-hover-fade .fyt-item:hover .fyt-item-thumbnail::after {
    background: rgba(0, 0, 0, 0.3);
}
