/* ==================== Video Block Styles ==================== */

/* Container and Layout */
.video-block-container {
    width: 100%;
    padding: 0;
    margin: 0;
}

.video-block-content {
    display: block;
}

/* Header Section */
.video-block-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.video-block-title {
    margin: 0 0 0.5rem 0;
    font-weight: 600;
    line-height: 1.3;
}

.video-block-description {
    margin: 0;
    opacity: 0.7;
    line-height: 1.5;
}

/* Grid Layout */
.video-grid {
    display: grid;
    gap: 1rem;
    width: 100%;
    margin-bottom: 2rem;
}

.video-grid.grid-col-1 {
    grid-template-columns: repeat(1, 1fr);
}

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

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

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

.video-grid.grid-col-5 {
    grid-template-columns: repeat(5, 1fr);
}

.video-grid.grid-col-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* Video Item */
.video-item {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

/* Video Wrapper */
.video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
    cursor: pointer;
}

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

/* Play Button */
.video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: #123779;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(18, 55, 121, 0.3);
}

.video-play-button i {
    color: white;
}

.video-play-button:focus {
    outline: 3px solid #123779;
    outline-offset: 3px;
    background-color: #123779;
}

.video-play-button:active {
    transform: translate(-50%, -50%) scale(0.95);
}

/* Thumbnail Image */
.video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* Loading State */
.video-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

.video-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(18, 55, 121, 0.2);
    border-top-color: #123779;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error States */
.video-error-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2rem;
    text-align: center;
    flex-direction: column;
    gap: 1rem;
}

.video-error-icon {
    font-size: 48px;
    color: #dc3545;
    opacity: 0.7;
}

.video-error-message {
    margin: 0;
    color: #dc3545;
    font-weight: 600;
    word-break: break-word;
}

.video-error-details {
    margin: 0;
    color: #666;
    font-size: 0.875rem;
    line-height: 1.5;
    opacity: 0.8;
}

/* Video Meta/Info */
.video-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.video-info-title {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.video-info-description {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    opacity: 0.7;
    flex-grow: 1;
}

/* Slider Layout */
.video-slider {
    width: 100%;
    margin-bottom: 2rem;
}

.video-slider .slick-slide {
    padding: 0 15px;
}

.video-slider .slick-slide > div {
    height: auto;
}

/* Slider Navigation */
.video-slider-nav {
    position: relative;
    margin-top: 1rem;
}

.video-slider-nav button {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    background: white;
    color: #123779;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.video-slider-nav button:hover {
    background: #123779;
    color: white;
    border-color: #123779;
}

.video-slider-nav .slick-prev {
    margin-right: 0.5rem;
}

.video-slider-nav .slick-next {
    margin-left: 0.5rem;
}

/* Modal Styles */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    padding: 1rem;
}

.video-modal.show {
    display: flex;
}

.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    aspect-ratio: 16 / 9;
    background: black;
    border-radius: 8px;
    overflow: hidden;
}

.video-modal iframe,
.video-modal video {
    width: 100%;
    height: 100%;
    border: none;
}

.video-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    font-size: 28px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1051;
    transition: all 0.3s ease;
}

.video-modal-close:hover {
    background: rgba(255, 255, 255, 0.4);
}

.video-modal-close:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Responsive Grid */
@media (max-width: 1200px) {
    .video-grid.grid-col-6 {
        grid-template-columns: repeat(3, 1fr);
    }
    .video-grid.grid-col-5 {
        grid-template-columns: repeat(3, 1fr);
    }
    .video-grid.grid-col-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .video-grid {
        gap: 1.5rem;
    }

    .video-grid.grid-col-2,
    .video-grid.grid-col-3,
    .video-grid.grid-col-4,
    .video-grid.grid-col-5,
    .video-grid.grid-col-6 {
        grid-template-columns: repeat(1, 1fr);
    }

    .video-play-button {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .video-modal-content {
        max-width: 100%;
        width: 100%;
    }

    .video-slider .slick-slide {
        padding: 0 10px;
    }

    .video-info {
        padding: 1rem;
    }

    .video-slider-nav button {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

@media (max-width: 576px) {
    .video-block-header {
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }

    .video-block-title {
        font-size: 1.125rem;
    }

    .video-block-description {
        font-size: 0.875rem;
    }

    .video-grid {
        gap: 1rem;
    }

    .video-play-button {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }

    .video-info-title {
        font-size: 0.95rem;
    }

    .video-modal {
        padding: 0.5rem;
    }

    .video-modal-content {
        aspect-ratio: auto;
        max-height: 70vh;
    }
}

/* Text Alignment Utilities */
.video-block-center {
    text-align: center;
}

.video-block-left {
    text-align: left;
}

.video-block-right {
    text-align: right;
}

/* Variant: Inline Video (No Modal) */
.video-item-inline .video-wrapper {
    display: block;
}

.video-item-inline .video-content {
    display: none;
}

/* Variant: Modal-Only Video (Thumbnail + Play Button) */
.video-item-modal .video-wrapper {
    display: block;
}

.video-item-modal .video-content {
    display: none;
}

/* Accessibility */
.video-play-button:focus-visible {
    outline: 3px solid #123779;
    outline-offset: 3px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Print Styles */
@media print {
    .video-modal,
    .video-play-button {
        display: none;
    }

    .video-wrapper {
        padding-bottom: 0;
    }
}
