/* ================================
   FuelGuard YouTube Gallery Widget
   Modern, Premium Design
   ================================ */

/* Section Header */
.fg-yt-header {
    text-align: center;
    margin-bottom: 28px;
}

.fg-yt-section-title {
    font-size: 22px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 8px;
    position: relative;
    display: inline-block;
    letter-spacing: -0.5px;
}

.fg-yt-section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 3px;
    background: #dc2626;
    border-radius: 2px;
}

.fg-yt-section-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin: 14px auto 0;
    max-width: 480px;
    line-height: 1.6;
}

/* Grid Layout */
.fg-yt-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

/* Card */
.fg-yt-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.fg-yt-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* Thumbnail Container */
.fg-yt-thumb {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 16 / 10;
    border-radius: 12px 12px 0 0;
}

.fg-yt-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.fg-yt-card:hover .fg-yt-thumb img {
    transform: scale(1.06);
}

/* Gradient Overlay */
.fg-yt-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            transparent 40%,
            rgba(0, 0, 0, 0.5) 100%);
    opacity: 0.6;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.fg-yt-card:hover .fg-yt-overlay {
    opacity: 0.8;
}

/* Play Button */
.fg-yt-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 44px;
    height: 44px;
    background: #dc2626;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.4);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        background 0.25s ease;
    z-index: 2;
}

.fg-yt-play-btn svg {
    width: 20px;
    height: 20px;
    margin-left: 2px;
}

.fg-yt-card:hover .fg-yt-play-btn {
    transform: translate(-50%, -50%) scale(1.12);
    box-shadow: 0 8px 32px rgba(220, 38, 38, 0.5);
}

/* Pulsating ring animation */
.fg-yt-play-btn::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    opacity: 0;
    transition: opacity 0.35s ease;
    animation: fg-yt-pulse 2s ease-out infinite;
}

.fg-yt-card:hover .fg-yt-play-btn::before {
    opacity: 1;
}

@keyframes fg-yt-pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Duration Badge */
.fg-yt-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.3px;
    z-index: 2;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Info Section */
.fg-yt-info {
    padding: 10px 12px 12px;
}

.fg-yt-title {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.25s ease;
}

.fg-yt-card:hover .fg-yt-title {
    color: #dc2626;
}

/* ================================
   LIGHTBOX
   ================================ */
.fg-yt-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    visibility: hidden;
    opacity: 0;
    transition: background 0.4s ease,
        backdrop-filter 0.4s ease,
        -webkit-backdrop-filter 0.4s ease,
        visibility 0s 0.4s,
        opacity 0.4s ease;
}

.fg-yt-lightbox.active {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    visibility: visible;
    opacity: 1;
    transition: background 0.4s ease,
        backdrop-filter 0.4s ease,
        -webkit-backdrop-filter 0.4s ease,
        visibility 0s 0s,
        opacity 0.4s ease;
}

.fg-yt-lightbox-inner {
    width: 90%;
    max-width: 960px;
    transform: scale(0.92) translateY(20px);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.4s ease;
}

.fg-yt-lightbox.active .fg-yt-lightbox-inner {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.fg-yt-lightbox-title {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
    padding: 0 4px;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Player Wrapper (16:9) */
.fg-yt-player-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    background: #000;
}

.fg-yt-player-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Close Button */
.fg-yt-close-btn {
    position: absolute;
    top: -48px;
    right: 0;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: background 0.25s ease, transform 0.25s ease;
    z-index: 10;
}

.fg-yt-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

.fg-yt-close-btn svg {
    width: 20px;
    height: 20px;
}

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 1024px) {
    .fg-yt-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .fg-yt-section-title {
        font-size: 20px;
    }
}

@media (max-width: 767px) {
    .fg-yt-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .fg-yt-header {
        margin-bottom: 20px;
    }

    .fg-yt-section-title {
        font-size: 18px;
    }

    .fg-yt-section-subtitle {
        font-size: 12px;
    }

    .fg-yt-play-btn {
        width: 40px;
        height: 40px;
    }

    .fg-yt-play-btn svg {
        width: 18px;
        height: 18px;
    }

    .fg-yt-lightbox-inner {
        width: 94%;
    }

    .fg-yt-player-wrap {
        border-radius: 12px;
    }

    .fg-yt-close-btn {
        top: -44px;
        right: 4px;
    }

    .fg-yt-lightbox-title {
        font-size: 14px;
    }

    .fg-yt-info {
        padding: 8px 10px 10px;
    }

    .fg-yt-title {
        font-size: 12px;
    }
}