/* Video Samples Section */
.video-samples-wrap {
    margin-top: 120px;
    position: relative;
    padding: 0 15px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* gap: 40px; */
    gap: 8px;
    margin-top: 40px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 991px) {
    .video-grid {
        grid-template-columns: 1fr;
        max-width: 480px;
    }
}

@media (max-width: 991px) {
    .video-grid {
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr;
        max-width: 480px;
    }
    
    .video-samples-wrap {
        margin-top: 80px;
    }
}

/* Video Items */
.video-grid .video-item {
    position: relative;
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    background: #1a1a1a;
    /* translate: none;
    rotate: none;
    scale: none;
    transform: translate(-80px, 0px);
    opacity: 0; */
}

.video-grid .video-item .video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 177.77777778%; /* Exactly 9:16 */
    overflow: hidden;
    background: #f5f5f5;
}

/* Force the image to maintain 9:16 ratio */
.video-grid .video-item {
    position: relative;
    width: 100%;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.video-grid .video-item .video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-grid .video-item:hover .video-thumbnail img {
    transform: scale(1.05);
}

.video-grid .video-item .play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(45, 110, 245, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.video-grid .video-item:hover .play-button {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Content styling matching works-item */
.video-grid .video-item .content {
    position: absolute;
    left: 20px;
    bottom: 20px;
    right: 20px;
    padding: 12px 12px 12px 12px;
    border-radius: 24px;
    background: rgba(0, 0, 0, 0.5019607843);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: #fff;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.video-grid .video-item .content .infor {
    flex: 1;
}

.video-grid .video-item .content .sub-heading {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.video-grid .video-item .content .title {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 8px;
    line-height: 1.4;
    letter-spacing: 0.5px;
}

.video-grid .video-item .content .title a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.video-grid .video-item .content .date {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.video-grid .video-item .content .btn-links {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.video-grid .video-item .content .btn-links i {
    font-size: 20px;
    color: #fff;
    transition: transform 0.3s ease;
}

.video-grid .video-item:hover .content .btn-links {
    background: rgba(255, 255, 255, 0.2);
}

.video-grid .video-item:hover .content .btn-links i {
    transform: scale(1.1);
}

/* Hover effects */
.video-grid .video-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    width: 332px;
}

.video-grid .video-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.2);
    z-index: 1;
    transition: background 0.3s ease;
    pointer-events: none; /* This ensures the overlay doesn't block clicks */
}

.video-grid .video-item:hover::before {
    background: rgba(0,0,0,0.4);
}

.video-grid .video-item:hover .content {
    transform: translateY(0);
    background: rgba(0, 0, 0, 0.7);
}

/* Play button adjustment */
.video-grid .video-item .play-button {
    z-index: 3;
    background: rgba(0, 0, 0, 0.7);
    width: 70px;
    height: 70px;
}

/* Video Modal */
.video-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    padding: 48px 16px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.video-modal.active {
    display: flex;
    opacity: 1;
    pointer-events: all;
    align-items: center;
    justify-content: center;
}

.video-modal-content {
    position: relative;
    display: flex;
    gap: 24px;
    max-height: 85vh;
    width: fit-content;
    max-width: 90vw;
    background: rgba(10, 10, 10, 0.95);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.3s ease;
    margin: auto;
}

.video-modal.active .video-modal-content {
    transform: scale(1);
    opacity: 1;
}

.video-modal.active .video-modal-content {
    transform: scale(1);
    opacity: 1;
}

.video-modal-content {
    display: flex;
    gap: 16px;
    max-height: 85vh;
    background: transparent;
}

.video-container-wrapper {
    flex-shrink: 0;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    width: 496px;
    aspect-ratio: 9/16;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.video-info-panel {
    width: 100%;
    max-width: 496px;
    min-width: 300px;
    height: calc(496px * 16/9); /* Match video container height exactly */
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    position: relative;
}

.video-info-panel .info-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.video-info-panel .info-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.video-info-panel .info-close-btn::before,
.video-info-panel .info-close-btn::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 1px;
    background: #fff;
}

.video-info-panel .info-close-btn::before {
    transform: rotate(45deg);
}

.video-info-panel .info-close-btn::after {
    transform: rotate(-45deg);
}

.video-info-panel::-webkit-scrollbar {
    width: 6px;
}

.video-info-panel::-webkit-scrollbar-track {
    background: transparent;
}

.video-info-panel::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Tablet Responsive */
@media (max-width: 1200px) {
    .video-modal-content {
        flex-direction: column;
        align-items: center;
        max-height: 90vh;
        overflow-y: auto;
        width: 90vw;
        padding: 16px;
    }
    
    .video-container-wrapper {
        width: 100%;
        max-width: 496px;
    }
    
    .video-info-panel {
        width: 100%;
        max-width: none;
        height: auto;
        min-height: 200px;
    }

    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 16px;
    }

    .video-modal {
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .video-modal-content {
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: 90vh;
        border-radius: 0;
        margin: auto;
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        background: #000;
        position: relative;
    }

    /* Fix close button in mobile */
    .video-close-btn {
        position: fixed !important;
        top: 16px !important;
        right: 16px !important;
        width: 36px !important;
        height: 36px !important;
        background: rgba(255, 255, 255, 0.1) !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        border-radius: 50% !important;
        z-index: 99999 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        padding: 0 !important;
        outline: none !important;
    }

    .video-close-btn i {
        font-size: 16px !important;
        color: rgba(255, 255, 255, 0.8) !important;
        transition: all 0.3s ease !important;
    }

    .video-close-btn::before,
    .video-close-btn::after {
        display: none; /* Hide default pseudo-elements */
    }

    .video-close-btn:hover {
        background: rgba(255, 255, 255, 0.2) !important;
        transform: rotate(90deg) !important;
    }

    .video-close-btn:hover i {
        color: #fff !important;
    }

    .video-close-btn:active {
        transform: rotate(90deg) scale(0.95) !important;
    }

    .video-close-btn:hover {
        background: rgba(0, 0, 0, 0.9);
    }

.video-container-wrapper {
    width: 90%;
    max-width: 90vw;
    aspect-ratio: 9/16;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Fix for iframe controls size */
.video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    transform: scale(0.99); /* Slightly scale down to ensure controls fit */
    transform-origin: center;
}    .video-modal.active .video-container-wrapper {
        opacity: 1;
    }

    .video-info-panel {
        display: none; /* Hide info panel on mobile */
    }

    .video-close-btn {
        position: absolute;
        top: 16px;
        right: 16px;
        background: rgba(0, 0, 0, 0.5);
        border: none;
        z-index: 100;
    }

    /* Adjust grid items for mobile */
    .video-grid .video-item {
        width: 100%;
    }

    .video-grid .video-item .content {
        left: 12px;
        right: 12px;
        bottom: 12px;
        padding: 10px;
    }

    .video-grid .video-item .content .title {
        font-size: 16px;
        margin-bottom: 4px;
    }
}

/* Landscape Mode */
@media (max-width: 768px) and (orientation: landscape) {
    .video-modal-content {
        flex-direction: row;
        height: 100vh;
        max-height: 100vh;
    }

    .video-container-wrapper {
        width: 100%;
        height: 100vh;
        padding-top: 0; /* Remove aspect ratio padding */
    }

    .video-container-wrapper iframe,
    .video-container-wrapper video {
        position: relative;
        height: 100%;
        width: 100%;
        transform: scale(0.99);
        transform-origin: center;
    }
    
    /* Ensure proper sizing of video container */
    .video-container {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    .video-info-panel {
        display: none;
    }
}

.info-group {
    margin-bottom: 24px;
}

.info-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
}

.info-value {
    color: #fff;
    font-size: 16px;
}

.tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.145);
    color: #fafafa;
    font-size: 14px;
}

.tag img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.video-close-btn {
    position: absolute;
    top: -48px;
    right: 0;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 20px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    outline: none;
}

.video-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: rotate(90deg);
}

.video-close-btn:active {
    transform: rotate(90deg) scale(0.95);
}

.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
}

/* Video controls bar */
.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    display: flex;
    align-items: center;
    gap: 10px;
}

.video-controls button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    transition: all 0.2s ease;
}

.video-controls button:hover {
    opacity: 0.8;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    cursor: pointer;
}

.progress {
    height: 100%;
    background: #fff;
    border-radius: 2px;
    width: 0%;
}