/**
 * =====================================================
 * Videoclips Module - CSS Improvements
 * =====================================================
 * File: videoclips-improvements.css
 * Mục đích: Tối ưu UX với transitions, animations và responsive
 * Ngày tạo: 2026-02-08
 * =====================================================
 */

/* =====================================================
 * 1. LAZY LOADING VIDEO STYLES
 * ===================================================== */

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

.video-thumbnail-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* Aspect ratio 16:9 */
    overflow: hidden;
    background-color: #000;
}

.video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hover effect cho thumbnail */
.video-lazy-container:hover .video-thumbnail {
    transform: scale(1.05);
    opacity: 0.8;
}

/* Play overlay button */
.video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s ease;
    z-index: 2;
}

.video-lazy-container:hover .video-play-overlay {
    background-color: rgba(0, 0, 0, 0.5);
}

.play-button-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: rgba(255, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.video-lazy-container:hover .play-button-circle {
    transform: scale(1.15);
    background-color: rgba(255, 0, 0, 0.95);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.4);
}

.play-button-circle i {
    color: #fff;
    font-size: 32px;
    margin-left: 5px;
    /* Điều chỉnh vị trí icon play */
    transition: font-size 0.3s ease;
}

.video-lazy-container:hover .play-button-circle i {
    font-size: 36px;
}

/* Loading spinner */
.video-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    z-index: 3;
}

.video-loading-spinner i {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* =====================================================
 * 2. VIDEO LIST TRANSITIONS
 * ===================================================== */

/* Smooth transitions cho danh sách video */
.column-margin-left {
    list-style: none;
    padding: 0;
    margin: 0;
}

.column-margin-left li {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
    background-color: transparent;
}

.column-margin-left li:hover {
    background-color: #f5f5f5;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.column-margin-left li:last-child {
    margin-bottom: 0;
}

/* Hover effect cho thumbnail trong list */
.column-margin-left li img {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.column-margin-left li:hover img {
    border-color: #337ab7;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Hover effect cho link */
.column-margin-left li a {
    text-decoration: none;
    transition: color 0.3s ease;
}

.column-margin-left li:hover a {
    color: #337ab7 !important;
}

/* Icon video camera animation */
.column-margin-left li .fa-video-camera {
    transition: all 0.3s ease;
}

.column-margin-left li:hover .fa-video-camera {
    color: #d9534f;
    transform: scale(1.1);
}

/* =====================================================
 * 3. PANEL IMPROVEMENTS
 * ===================================================== */

#hot-news .panel {
    transition: box-shadow 0.3s ease;
}

#hot-news .panel:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* =====================================================
 * 4. RESPONSIVE BREAKPOINTS
 * ===================================================== */

/* Tablets and below (max-width: 1024px) */
@media (max-width: 1024px) {
    .play-button-circle {
        width: 70px;
        height: 70px;
    }

    .play-button-circle i {
        font-size: 28px;
    }

    .video-lazy-container:hover .play-button-circle i {
        font-size: 32px;
    }
}

/* Mobile devices (max-width: 768px) */
@media (max-width: 768px) {

    /* Stack layout - video full width, list below */
    #hot-news .col-md-14,
    #hot-news .col-md-10 {
        width: 100% !important;
        float: none !important;
    }

    /* Margin between video and list */
    #hot-news .col-md-10 {
        margin-top: 20px;
    }

    /* Adjust column margin */
    .column-margin-left {
        margin-left: 0 !important;
    }

    /* Smaller play button on mobile */
    .play-button-circle {
        width: 60px;
        height: 60px;
    }

    .play-button-circle i {
        font-size: 24px;
    }

    .video-lazy-container:hover .play-button-circle i {
        font-size: 28px;
    }

    /* List items padding */
    .column-margin-left li {
        padding: 8px;
    }

    /* Disable translateX on mobile (looks weird on touch) */
    .column-margin-left li:hover {
        transform: none;
    }
}

/* Small mobile devices (max-width: 480px) */
@media (max-width: 480px) {

    /* Even smaller play button */
    .play-button-circle {
        width: 50px;
        height: 50px;
    }

    .play-button-circle i {
        font-size: 20px;
    }

    /* Adjust thumbnail size in list */
    .column-margin-left li img {
        width: 50px !important;
    }

    /* Smaller font for titles */
    .column-margin-left li a {
        font-size: 14px;
    }
}

/* Large screens (min-width: 1366px) */
@media (min-width: 1366px) {

    /* Allow larger video max-width já definido no JS (800px) */
    .video-lazy-container {
        max-width: 800px;
        margin: 0 auto;
    }
}

/* =====================================================
 * 5. ACCESSIBILITY IMPROVEMENTS
 * ===================================================== */

/* Focus states cho keyboard navigation */
.video-lazy-container:focus {
    outline: 2px solid #337ab7;
    outline-offset: 2px;
}

.column-margin-left li a:focus {
    outline: 2px solid #337ab7;
    outline-offset: 2px;
}

/* =====================================================
 * 6. ANIMATIONS
 * ===================================================== */

/* Fade in animation cho video list items */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.column-margin-left li {
    animation: fadeInUp 0.5s ease forwards;
}

/* Stagger animation delay */
.column-margin-left li:nth-child(1) {
    animation-delay: 0.1s;
}

.column-margin-left li:nth-child(2) {
    animation-delay: 0.2s;
}

.column-margin-left li:nth-child(3) {
    animation-delay: 0.3s;
}

.column-margin-left li:nth-child(4) {
    animation-delay: 0.4s;
}

.column-margin-long li:nth-child(5) {
    animation-delay: 0.5s;
}

/* Spinner rotation (fallback nếu FA spinner không hoạt động) */
@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* =====================================================
 * 7. DARK MODE SUPPORT (Optional)
 * ===================================================== */

/* Nếu website có dark mode */
@media (prefers-color-scheme: dark) {
    .column-margin-left li:hover {
        background-color: #2a2a2a;
    }

    .column-margin-left li:hover img {
        border-color: #5b9dd9;
    }
}

/* =====================================================
 * 9. VIDEO DESCRIPTION BLOCK
 * ===================================================== */

.video-description-block {
    margin-top: 15px;
    padding: 15px;
    background-color: #f9f9f9;
    border-left: 4px solid #337ab7;
    border-radius: 4px;
}

.video-title-main {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.video-hometext {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    text-align: justify;
}

/* Mobile responsive cho description */
@media (max-width: 768px) {
    .video-description-block {
        padding: 12px;
        margin-top: 12px;
    }

    .video-title-main {
        font-size: 16px;
    }

    .video-hometext {
        font-size: 13px;
    }
}

/* =====================================================
 * 10. HIGH QUALITY THUMBNAIL RENDERING
 * ===================================================== */

/* Minimal CSS - để browser render ảnh gốc tốt nhất */
.video-thumbnail-hq {
    /* Chỉ dùng auto - không can thiệp vào rendering */
    image-rendering: auto;
    -ms-interpolation-mode: bicubic;
}

/* Container wrapper - giữ aspect ratio 16:9 */
.video-thumbnail-wrapper {
    background-color: #000;
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    overflow: hidden;
}

/* Thumbnail - đơn giản nhất, không effect gì */
.video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Tối ưu cho màn hình Retina / High DPI */
@media only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (min--moz-device-pixel-ratio: 2),
only screen and (-o-min-device-pixel-ratio: 2/1),
only screen and (min-device-pixel-ratio: 2),
only screen and (min-resolution: 192dpi),
only screen and (min-resolution: 2dppx) {
    .video-thumbnail-hq {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* =====================================================
 * 8. PRINT STYLES
 * ===================================================== */

@media print {

    .video-play-overlay,
    .video-loading-spinner {
        display: none !important;
    }

    .video-lazy-container {
        cursor: default;
    }

    /* Hiển thị thumbnail khi print */
    .video-thumbnail-wrapper {
        display: block !important;
    }
}