/*
* REVAMPED Stylesheet for Video Pages
* A modern, clean, and professional UI
*/

/* ==========================================================================
   FILTER BUTTON LIGHT-GLOW RIPPLE EFFECT (on click)
   ========================================================================== */


/* ==========================================================================
   TONED-DOWN ACTIVE FILTER BUTTON (primary-btn)
   ========================================================================== */

/* Base button (shared) */
.video-filters .btn {
    background: #1a1a1a;
    color: #ccc;
    border: 1px solid #333;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

/* Active/Selected Filter – Toned Down */
.video-filters .btn.primary-btn {
    background: #4f4a4a;
    color: #ffffff;
    border-color: #ffffff;
    box-shadow: 0 0 12px rgb(186 188 193 / 30%);
    font-weight: 600;
}

/* Hover on active button – subtle lift */
/* .video-filters .btn.primary-btn:hover {
    background: #2a5d9e;
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px); 
} */

/* Non-active button hover */
.video-filters .btn.secondary-btn:hover {
    background: #252525;
    color: #fff;
    border-color: #555;
}

/* Ripple light effect
.video-filters .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    z-index: -1;
    transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
} */

.video-filters .btn.loading::before {
    width: 280px;
    height: 280px;
    opacity: 1;
}

/* ==========================================================================
   HTMX LOADING SPINNER (centered under filters)
   ========================================================================== */

.htmx-indicator {
    display: none;
    text-align: center;
    margin: 2rem 0;
    color: #aaa;
    font-size: 1rem;
    font-weight: 500;
}

.htmx-request .htmx-indicator {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.htmx-indicator i {
    margin-right: 8px;
    font-size: 1.1rem;
    animation: spin 1s linear infinite;
}

/* Fade-in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Spinner rotation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.htmx-request #blog-list-container,
.htmx-request #video-list-container {
    opacity: 0.7;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* --- Common Page Layout --- */
.video-list-page,
.video-detail-page {
    padding: 140px 0 80px;
    background: linear-gradient(180deg, #121212 0%, #000000 100%);
}

.page-title {
    font-family: 'Playfair Display', sans-serif;
    font-size: 4.5rem;
    text-align: center;
    margin-bottom: 2rem;
    color: #f0f0f0;
}

.section-description {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 80px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* --- Filter Buttons --- */
.video-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 80px;
}

/* --- NEW: Video Grid --- */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
}

/* --- NEW: Modern Video Card --- */
.video-card {
    background: linear-gradient(145deg, #1e1e1e, #141414);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.video-card:hover {
    transform: translateY(-10px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.video-thumbnail {
    position: relative;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.05);
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    font-size: 1.5rem;
    color: white;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.video-card:hover .play-icon {
    transform: translate(-50%, -50%) scale(1.1);
    background-color: rgba(245, 246, 247, 0.473);
}

.video-card-content {
    padding: 25px;
}

.video-category-badge {
    display: inline-block;
    background-color: #acafb1;
    color: #000;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.video-title {
    font-size: 1.35rem;
    margin-bottom: 10px;
}

.video-title a {
    color: #f0f0f0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.video-title a:hover {
    /* color: var(--secondary-color); */
    color: #778b8f;
}

.video-excerpt {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* --- NEW: Video Detail Page --- */
.video-detail-page .container {
    max-width: 1100px;
}

.video-player-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 40px;
    background: #000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

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

.video-content-area {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.video-main-title {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #fff;
    line-height: 1.3;
}

.video-meta {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.video-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.back-to-videos {
    text-align: center;
    margin-top: 60px;
}

.no-content p {
    color: var(--text-secondary);
    text-align: center;
    font-size: 1.2rem;
    padding: 40px 0;
}

/* --- NEW: Pagination --- */
.pagination-nav {
    margin-top: 60px;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    gap: 10px;
}

.page-item .page-link {
    color: var(--text-secondary);
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.page-item .page-link:hover {
    background-color: #696464;
    color: #000;
    /* border-color: var(--secondary-color); */
}

.page-item.active .page-link {
    background-color: #696464;
    color: #000;
    /* border-color: var(--secondary-color); */
    cursor: default;
}

.htmx-request #blog-content,
.htmx-request #video-content {
    opacity: 0.6;
    pointer-events: none;
}

.htmx-indicator {
    display: none;
    color: #666;
    font-size: 0.9em;
    margin-top: 1rem;
}

.htmx-request .htmx-indicator {
    display: block;
}


/* ==========================================================================
   Responsive Styles
   ========================================================================== */

/* --- Tablets and Smaller Desktops (<= 1024px) --- */
@media (max-width: 1024px) {
    .page-title {
        font-size: 3.5rem;
    }

    .video-list-page,
    .video-detail-page {
        padding: 120px 40px 60px;
        /* Add side padding */
    }
}

/* --- Mobile Devices and Tablets (<= 768px) --- */
@media (max-width: 768px) {


    .video-list-page,
    .video-detail-page {
        padding: 100px 20px 60px;
    }

    .page-title {
        font-size: 2.7rem;
        line-height: 1.2;
        margin-bottom: 2rem;
    }

    .section-description {

        margin: 0 auto 60px;
        font-size: 1rem;
    }

    .video-filters .btn {
        padding: 8px 10px;
        border-radius: 50px;
        font-size: 0.8rem;
        font-weight: 400;
        letter-spacing: 0.4px;
    }

    .video-filters {
        gap: .7rem;
        margin-bottom: 70px;
    }

    .video-category-badge {
        padding: 5px 10px;
        font-size: 0.7rem;
        font-weight: 600;
    }

    .video-title a {
        font-size: 20px;
    }

    .video-excerpt {
        font-size: .9rem;
        line-height: 1.5;
    }

    .videos-grid {
        grid-template-columns: 1fr;
        /* Single column on mobile */
        gap: 2rem;
    }

    .video-main-title {
        font-size: 2rem;
    }

    .video-meta {
        flex-direction: column;
        gap: 10px;
    }

    .video-description {
        font-size: 1rem;
        line-height: 1.5;
        text-align: justify;
    }

    .secondary-btn {
        font-size: 1rem;
    }
    .back-to-videos {
    margin-top: 35px;
}
}

/* --- Small Mobile Devices (<= 480px) --- */
@media (max-width: 480px) {
    .page-title {
        font-size: 2rem;
        margin-bottom: 1.3rem;
    }


    .video-filters {
        gap: .6rem;
        margin-bottom: 60px;
    }

    .video-filters .btn {
        padding: 6px 7.5px;
        font-size: 0.6rem;
    }

    .video-filters .btn.primary-btn {
        font-weight: 500;
    }

    .section-description {

        margin: 0 auto 40px;
        font-size: .9rem;
    }

    .video-category-badge {
        padding: 4px 8px;
        font-size: 0.6rem;
        margin-bottom: 13px;
        letter-spacing: 0.4px;
    }

    .video-title a {
        font-size: .9rem;

    }

    .video-title {
        line-height: 1;
    }

    .video-excerpt {
        font-size: .9rem;
        line-height: 18px;
    }

    .video-description {
        font-size: .8rem;
        line-height: 1.2;

    }

    .video-main-title {
        font-size: 1rem;
    }

    .play-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .page-item .page-link {
        padding: 8px 12px;
        font-size: 15px;
    }

    .video-meta {
        gap: 2px;
        font-size: .9rem;
        margin-bottom: 1.4rem;
    }

    .secondary-btn {
        font-size: .8rem;
    }
}



/* ==========================================================================
   HTMX LOADING SPINNER (centered under filters)
   ========================================================================== */

.htmx-indicator {
    display: none;
    text-align: center;
    margin: 2rem 0;
    color: #aaa;
    font-size: 1rem;
    font-weight: 500;
}

.htmx-request .htmx-indicator {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.htmx-indicator i {
    margin-right: 8px;
    font-size: 1.1rem;
    animation: spin 1s linear infinite;
}

/* Fade-in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Spinner rotation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Optional: dim content while loading */
.htmx-request #blog-list-container,
.htmx-request #video-list-container {
    opacity: 0.7;
    pointer-events: none;
    transition: opacity 0.2s ease;
}