:root {
    --video-max-width: 1280px;
    --video-aspect-ratio: 16/9;
    --cabinet-card-size: 100px;
    --grid-gap: 10px;
    --page-margin: 50px;
    --content-min-height: 600px;
}

.montazh-page {
    background-color: var(--secondary-dark);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Main Container */
.montazh-main-container {
    padding: 0 var(--page-margin);
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Cabinet Selector Section - بالای صفحه */
.cabinet-selector-section {
    background-color: var(--primary-dark);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-lg);
    margin-bottom: var(--grid-gap);
    width: 100%;
    box-sizing: border-box;
}

.cabinet-selector-title {
    color: var(--green);
    font-size: 22px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(0, 231, 173, 0.2);
    text-align: center;
}

.cabinet-selector-container {
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--green) var(--secondary-dark);
    -webkit-overflow-scrolling: touch;
}

.cabinet-selector-container::-webkit-scrollbar {
    height: 8px;
}

.cabinet-selector-container::-webkit-scrollbar-track {
    background: var(--secondary-dark);
    border-radius: 10px;
}

.cabinet-selector-container::-webkit-scrollbar-thumb {
    background-color: var(--cyan);
    border-radius: 10px;
}

.cabinet-selector-grid {
    display: flex;
    gap: 15px;
    min-width: min-content;
    padding: 5px;
}

.cabinet-selector-card {
    flex: 0 0 auto;
    width: var(--cabinet-card-size);
    background-color: var(--secondary-dark);
    border-radius: 5px;
    overflow: hidden;
    transition: all var(--transition-normal);
    border: 2px solid transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cabinet-selector-card:hover {
    transform: translateY(-5px);
    border-color: var(--green);
    box-shadow: 0 10px 20px rgba(0, 231, 173, 0.1);
}

.cabinet-selector-card.active {
    border-color: var(--yellow);
    background-color: rgba(255, 200, 0, 0.05);
}

.cabinet-selector-thumbnail {
    width: var(--cabinet-card-size);
    height: var(--cabinet-card-size);
    object-fit: cover;
    aspect-ratio: 1/1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cabinet-selector-name {
    color: #fbcda7;
    font-size: 14px;
    padding: 8px 5px;
    margin: 0;
    text-align: center;
    line-height: 1.4;
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Video Content Layout - دو بخش اصلی */
.video-content-layout {
    display: grid;
    grid-template-columns: 2fr 1fr; /* پلیر ۲ قسمت، توضیحات ۱ قسمت */
    gap: var(--grid-gap);
    width: 100%;
    box-sizing: border-box;
    min-height: var(--content-min-height);
}

/* Video Player Container - سمت چپ (از نظر کاربر فارسی) */
.video-player-container {
    background-color: var(--primary-dark);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}

.video-player-title {
    color: var(--light-orange);
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
    flex-shrink: 0;
}

.main-video-wrapper {
    position: relative;
    width: 100%;
    max-width: var(--video-max-width);
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    background-color: #000;
    border-radius: 4px;
    overflow: hidden;
}

#mainVideo {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover; /* حذف کامل نوار سیاه */
    background-color: #000;
}

/* Video Description Container - سمت راست (از نظر کاربر فارسی) */
.video-description-container {
    background-color: var(--primary-dark);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.video-description-title {
    color: var(--cyan);
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(0, 255, 255, 0.2);
    flex-shrink: 0;
}

.video-description-text {
    color: #ffffff;
    font-size: 14px;
    line-height: 1.8;
    flex-grow: 1;
    overflow-y: auto;
}

.video-description-text p {
    margin-bottom: 14px;
}

/* Loading State */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 300px;
    color: var(--cyan);
    font-size: 18px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 15px;
}

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

/* Large Desktop */
@media (min-width: 1400px) {
    :root {
        --cabinet-card-size: 140px;
    }
    
    .video-content-layout {
        min-height: 700px;
    }
}

/* Tablet Responsive (992px و کمتر) */
@media (max-width: 992px) {
    .video-content-layout {
        display: flex;
        flex-direction: column;
        gap: var(--grid-gap);
        min-height: auto;
    }
    
    .video-player-container {
        width: 100%;
        height: auto;
        min-height: 500px;
        order: 1;
    }
    
    .main-video-wrapper {
        max-width: 100%;
        width: 100%;
        aspect-ratio: 16/9;
    }
    
    .video-description-container {
        width: 100%;
        height: auto;
        /* max-height: 500px; */
        order: 2;
    }
    
    .cabinet-selector-card {
        width: 100px;
    }
    
    .cabinet-selector-name {
        font-size: 12px;
        height: 40px;
    }
}

/* Mobile Responsive (768px و کمتر) */
@media (max-width: 768px) {
    :root {
        --cabinet-card-size: 90px;
        --grid-gap: 15px;
        --page-margin: 8px;
    }
    
    .montazh-main-container {
        padding: 0 var(--page-margin);
    }
    
    .cabinet-selector-section {
        padding: 15px;
        margin-bottom: var(--grid-gap);
    }
    
    .cabinet-selector-title {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .cabinet-selector-grid {
        gap: 10px;
    }
    
    .video-player-title {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .video-description-title {
        font-size: 18px;
    }
    
    .video-description-text {
        font-size: 14px;
    }
    
    .video-player-container {
        padding: 15px;
        min-height: 400px;
    }
    
    .video-description-container {
        padding: 15px;
        /* max-height: 400px; */
    }
    
}

/* Small Mobile (576px و کمتر) */
@media (max-width: 576px) {
    :root {
        --cabinet-card-size: 80px;
        --page-margin: 6px;
    }
    
    .montazh-main-container {
        padding: 0 var(--page-margin);
    }
    
    .cabinet-selector-card {
        width: 80px;
    }
    
    .cabinet-selector-name {
        font-size: 11px;
        height: 35px;
        padding: 5px 3px;
    }
    
    .video-player-title {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .video-player-container {
        min-height: 350px;
    }
    
    /* .video-description-container {
        max-height: 350px;
    } */
}

/* Very Small Mobile (400px و کمتر) */
@media (max-width: 400px) {
    :root {
        --cabinet-card-size: 70px;
    }
    
    .cabinet-selector-card {
        width: 70px;
    }
    
    .cabinet-selector-name {
        font-size: 10px;
        height: 30px;
    }
    
    .video-player-container {
        min-height: 300px;
    }
    
    .main-video-wrapper {
        min-height: 200px;
    }
}

/* Height adjustments for very tall screens */
@media (min-height: 800px) and (min-width: 993px) {
    .video-content-layout {
        min-height: 700px;
    }
}

@media (min-height: 1000px) and (min-width: 993px) {
    .video-content-layout {
        min-height: 800px;
    }
}