/* CSS for YouTube Videos Page (2025 Modern Design) */
:root {
    --dpfp-primary: #f2c40c;
    /* National Democratic Party Yellow */
    --dpfp-accent: #ffcc00;
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-border: rgba(255, 255, 255, 0.4);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --glass-blur: blur(12px);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.p-youtube-archive {
    padding: 20px 0;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    /* Fallback to clean sans */
}

/* Filter Dropdown - Floating Pill Design */
.c-filter-container {
    max-width: 320px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.c-select {
    width: 100%;
    padding: 14px 20px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 50px;
    /* Pill shape */
    background-color: #fff;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1.2rem center;
    background-size: 1.2em;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    cursor: pointer;
}

.c-select:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--dpfp-primary);
}

.c-select:focus {
    outline: none;
    border-color: var(--dpfp-primary);
    box-shadow: 0 0 0 4px rgba(242, 196, 12, 0.2);
}

/* Grid Layout */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
    margin-top: 40px;
    padding: 10px;
}

/* Card Design - Glassmorphism & Modern */
.video-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    text-decoration: none !important;
    display: flex;
    flex-direction: column;
    color: #333 !important;
    height: 100%;
    backdrop-filter: var(--glass-blur);
    transform: translateY(0);
    cursor: pointer;
    /* Changed to pointer */
}

/* Hover Effect - Lift & Glow */
.video-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(242, 196, 12, 0.15);
    /* Subtle glow */
    z-index: 2;
}

/* Thumbnail Wrapper */
.video-thumb-wrapper {
    position: relative;
    padding-top: 56.25%;
    /* 16:9 */
    background: #000;
    overflow: hidden;
}

.video-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.video-card:hover .video-thumb {
    transform: scale(1.08);
    /* Slow zoom on hover */
}

/* Play Icon - Modern Frosted Glass */
.video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    opacity: 0.9;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: var(--transition-smooth);
}

.video-card:hover .video-play-icon {
    transform: translate(-50%, -50%) scale(1.1);
    background: var(--dpfp-primary);
    color: #fff;
    /* Black arrow on yellow */
    opacity: 1;
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(242, 196, 12, 0.4);
}

/* Content Area */
.video-content {
    padding: 20px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(to bottom, #fff 0%, #fafafa 100%);
}

/* Title */
.video-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 12px !important;
    color: #1a1a1a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: 0.02em;
    transition: color 0.2s;
}

.video-card:hover .video-title {
    color: #000;
}

/* Meta Data (Date Overlay) */
.video-date {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    z-index: 2;
    pointer-events: none;
}

/* Responsive List Layout for Mobile */
@media (max-width: 768px) {

    /* Main Layout */
    .p-youtube-archive {
        padding: 0;
    }

    /* Grid - 1 Column List Style - FORCE */
    .video-grid {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: 1fr !important;
        /* Fallback override */
        gap: 12px;
        margin-top: 15px;
        padding: 0 10px;
    }

    /* Card - Horizontal Flex */
    .video-card {
        display: flex !important;
        flex-direction: row !important;
        width: 100%;
        height: 100px !important;
        /* Increased from 90px */
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        border: 1px solid rgba(0, 0, 0, 0.1);
        background: #fff !important;
    }

    /* Thumbnail Area - Fixed Left */
    .video-thumb-wrapper {
        width: 154px !important;
        /* Proportional increase (16:9 approx of height) */
        min-width: 154px !important;
        height: 100% !important;
        padding-top: 0 !important;
        position: relative !important;
        background: #000 !important;
        overflow: hidden !important;
    }

    .video-thumb {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
        max-width: none !important;
        /* Prevent WP standard style interference */
        margin: 0 !important;
    }

    /* Content Area */
    .video-content {
        padding: 12px 15px;
        flex: 1;
        display: flex;
        flex-direction: column;
        background: #fff !important;
        /* Ensure white bg */
    }

    /* Typography - FORCE COLORS */
    .video-title {
        font-size: 14px !important;
        /* Slightly larger for readability */
        line-height: 1.4 !important;
        margin-bottom: 0 !important;
        font-weight: 700;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        height: auto;
        color: #222 !important;
        max-height: 3.0em !important;
        /* Increased to avoid cut-off */
    }

    /* Meta Info - Keep Overlay on Mobile too, just resize slightly if needed */
    .video-date {
        font-size: 10px;
        bottom: 5px;
        right: 5px;
        padding: 2px 4px;
    }

    /* Load More Button Adjustment */
    #load-more {
        width: 90%;
        padding: 12px;
        font-size: 14px;
    }
}

/* Page Header (Copied/Adapted from Policies) */
.dpfp-page-header {
    background: linear-gradient(135deg, #f0f4f8 0%, #ffffff 100%);
    padding: 60px 0 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 40px;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: #004ecc;
    /* DPFP Blue */
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
}

.page-desc {
    color: #666;
    font-weight: 500;
    position: relative;
    z-index: 2;
}

/* Load More Button - Modern Pill */
#load-more {
    display: inline-block;
    padding: 16px 48px;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--dpfp-primary) 0%, var(--dpfp-accent) 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    border: none;
    box-shadow: 0 4px 15px rgba(242, 196, 12, 0.4);
    transition: all 0.3s ease;
    cursor: pointer;
    letter-spacing: 0.1em;
}

#load-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(242, 196, 12, 0.6);
}

#load-more:active {
    transform: translateY(1px);
}

/* --- Modal Styles --- */
.video-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
    display: flex;
    /* Changed from none to flex via JS */
    align-items: center;
    justify-content: center;
    visibility: hidden;
    /* Use visibility + opacity for transition */
}

.video-modal-overlay.is-active {
    visibility: visible;
    opacity: 1;
}

.video-modal-container {
    width: 90%;
    max-width: 960px;
    aspect-ratio: 16/9;
    background: #000;
    position: relative;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.video-modal-overlay.is-active .video-modal-container {
    transform: scale(1);
}

.video-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: transform 0.2s;
    z-index: 10000;
}

.video-modal-close:hover {
    transform: scale(1.1);
    color: var(--dpfp-primary);
}

.video-modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
}

@media (max-width: 768px) {
    .video-modal-container {
        width: 100%;
        border-radius: 0;
    }

    .video-modal-iframe {
        border-radius: 0;
    }

    .video-modal-close {
        top: 10px;
        right: 10px;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 50%;
        width: 36px;
        height: 36px;
        font-size: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Powered By Section */
.powered-by-section {
    text-align: center;
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #999;
    font-size: 0.9rem;
}

.powered-by-section a {
    color: #777;
    text-decoration: underline;
    transition: color 0.2s;
}

.powered-by-section a:hover {
    color: var(--dpfp-primary);
}