/* Video CV Fullscreen Overlay Styles */

.video-cv-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    animation: fadeIn 0.3s ease-out;
    transition: background-color 0.3s ease;
}

/* Light theme support */
html:not([data-theme="dark"]) .video-cv-fullscreen-overlay,
html[data-theme="light"] .video-cv-fullscreen-overlay,
.light-theme .video-cv-fullscreen-overlay {
    background: rgba(255, 255, 255, 0.98);
}

.video-cv-fullscreen-overlay.active {
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.overlay-header {
    padding: 15px 30px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

/* Light theme header */
html:not([data-theme="dark"]) .overlay-header,
html[data-theme="light"] .overlay-header,
.light-theme .overlay-header {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.overlay-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: inherit;
}

.overlay-close {
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: inherit;
    padding: 0;
    line-height: 1;
    transition: opacity 0.2s ease;
}

.overlay-close:hover {
    opacity: 0.7;
}

/* Container adjustments for fullscreen */
.video-cv-fullscreen-overlay .container.row {
    height: calc(100vh - 70px);
    min-height: calc(100vh - 70px);
    max-height: calc(100vh - 70px);
    margin: 0 auto;
    padding: 20px;
    flex: 1;
    display: flex;
    max-width: 1400px; /* Максимальная ширина контейнера */
    width: 100%;
    justify-content: center;
    align-items: flex-start;
    gap: 20px; /* Разрыв между плеером и плейлистом */
    box-sizing: border-box;
}

.video-cv-fullscreen-overlay .col.col-sm-12.left {
    background: #000;
    flex: 0 0 65%; /* Плеер занимает 65% ширины */
    border-radius: 8px;
    overflow: hidden;
    height: 100%;
    min-height: 0; /* Позволяет сжиматься меньше содержимого */
    display: flex;
    flex-direction: column;
}

/* Light theme player */
html:not([data-theme="dark"]) .video-cv-fullscreen-overlay .col.col-sm-12.left,
html[data-theme="light"] .video-cv-fullscreen-overlay .col.col-sm-12.left,
.light-theme .video-cv-fullscreen-overlay .col.col-sm-12.left {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.video-cv-fullscreen-overlay .col-sm-12.right {
    background: #1e2328;
    border: 1px solid #394455;
    border-radius: 8px;
    flex: 0 0 32%; /* Плейлист занимает 32% ширины */
    height: 100%;
    min-height: 0; /* Позволяет сжиматься меньше содержимого */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Убираем overflow-y: auto отсюда, добавим в wrapper */
}

/* Light theme playlist */
html:not([data-theme="dark"]) .video-cv-fullscreen-overlay .col-sm-12.right,
html[data-theme="light"] .video-cv-fullscreen-overlay .col-sm-12.right,
.light-theme .video-cv-fullscreen-overlay .col-sm-12.right {
    background: #ffffff;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Player adjustments */
.video-cv-fullscreen-overlay .player_container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.video-cv-fullscreen-overlay .player_text {
    padding: 15px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    text-decoration: none;
    display: block;
}

/* Light theme player text */
html:not([data-theme="dark"]) .video-cv-fullscreen-overlay .player_text,
html[data-theme="light"] .video-cv-fullscreen-overlay .player_text,
.light-theme .video-cv-fullscreen-overlay .player_text {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.video-cv-fullscreen-overlay .text_title {
    display: block;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.video-cv-fullscreen-overlay .text_group {
    display: block;
    font-size: 14px;
    opacity: 0.8;
}

.video-cv-fullscreen-overlay .plyr__video-embed {
    width: 100%;
    flex: 1;
    min-height: 450px;
}

.video-cv-fullscreen-overlay .plyr__video-embed iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0;
}

/* Playlist styling for dark theme */
.video-cv-fullscreen-overlay .playlist-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 15px;
    min-height: 0; /* Важно для flex-shrink */
}

/* Custom scrollbar */
.video-cv-fullscreen-overlay .playlist-wrapper::-webkit-scrollbar {
    width: 6px;
}

.video-cv-fullscreen-overlay .playlist-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.video-cv-fullscreen-overlay .playlist-wrapper::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 3px;
}

/* Light theme scrollbar */
html:not([data-theme="dark"]) .video-cv-fullscreen-overlay .playlist-wrapper::-webkit-scrollbar-thumb,
html[data-theme="light"] .video-cv-fullscreen-overlay .playlist-wrapper::-webkit-scrollbar-thumb,
.light-theme .video-cv-fullscreen-overlay .playlist-wrapper::-webkit-scrollbar-thumb {
    background: #dee2e6;
}

html:not([data-theme="dark"]) .video-cv-fullscreen-overlay .playlist-wrapper::-webkit-scrollbar-thumb:hover,
html[data-theme="light"] .video-cv-fullscreen-overlay .playlist-wrapper::-webkit-scrollbar-thumb:hover,
.light-theme .video-cv-fullscreen-overlay .playlist-wrapper::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* Playlist header */
.video-cv-fullscreen-overlay .playlist-header {
    padding: 15px;
    border-bottom: 1px solid #394455;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1e2328; /* Добавляем фон для темной темы */
    transition: all 0.3s ease;
}

.video-cv-fullscreen-overlay .playlist-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #e1e8f0;
}

.video-cv-fullscreen-overlay .video-count {
    font-size: 12px;
    color: #7f8fa4;
    background: rgba(127, 143, 164, 0.15);
    padding: 4px 8px;
    border-radius: 12px;
}

/* Light theme playlist header */
html:not([data-theme="dark"]) .video-cv-fullscreen-overlay .playlist-header,
html[data-theme="light"] .video-cv-fullscreen-overlay .playlist-header,
.light-theme .video-cv-fullscreen-overlay .playlist-header {
    background: #ffffff !important; /* Белый фон для светлой темы */
    border-bottom: 1px solid #e9ecef;
}

html:not([data-theme="dark"]) .video-cv-fullscreen-overlay .playlist-header h4,
html[data-theme="light"] .video-cv-fullscreen-overlay .playlist-header h4,
.light-theme .video-cv-fullscreen-overlay .playlist-header h4 {
    color: #212529 !important;
}

html:not([data-theme="dark"]) .video-cv-fullscreen-overlay .video-count,
html[data-theme="light"] .video-cv-fullscreen-overlay .video-count,
.light-theme .video-cv-fullscreen-overlay .video-count {
    color: #6c757d !important;
    background: rgba(0, 0, 0, 0.05) !important;
}

.video-cv-fullscreen-overlay .playlist {
    background: transparent;
}

.video-cv-fullscreen-overlay .playlist_item {
    color: #b8c5d6;
    border-bottom: 1px solid #394455;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    margin-bottom: 5px;
    padding: 10px;
}

/* Light theme playlist items */
html:not([data-theme="dark"]) .video-cv-fullscreen-overlay .playlist_item,
html[data-theme="light"] .video-cv-fullscreen-overlay .playlist_item,
.light-theme .video-cv-fullscreen-overlay .playlist_item {
    color: #495057;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.video-cv-fullscreen-overlay .item_wrapper {
    display: flex;
    align-items: center;
    width: 100%;
}

.video-cv-fullscreen-overlay .playlist_item:hover {
    background-color: #2a3441;
    transform: translateX(2px);
}

/* Light theme hover */
html:not([data-theme="dark"]) .video-cv-fullscreen-overlay .playlist_item:hover,
html[data-theme="light"] .video-cv-fullscreen-overlay .playlist_item:hover,
.light-theme .video-cv-fullscreen-overlay .playlist_item:hover {
    background-color: #e9ecef;
    color: #212529;
}

.video-cv-fullscreen-overlay .playlist_item.active {
    background-color: #4a90e2;
    color: white;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.video-cv-fullscreen-overlay .item_thumb_container {
    width: 80px;
    height: 60px;
    overflow: hidden;
    border-radius: 4px;
    flex-shrink: 0;
    position: relative;
    background: #333;
}

.video-cv-fullscreen-overlay .item_thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-cv-fullscreen-overlay .item_thumb_play,
.video-cv-fullscreen-overlay .item_thumb_restart {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.video-cv-fullscreen-overlay .playlist_item:hover .item_thumb_play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(74, 144, 226, 0.9);
    border-color: rgba(255, 255, 255, 0.6);
}

.video-cv-fullscreen-overlay .item_thumb_play::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 8px solid white;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    margin-left: 2px;
}

/* Light theme play button */
html:not([data-theme="dark"]) .video-cv-fullscreen-overlay .playlist_item:hover .item_thumb_play,
html[data-theme="light"] .video-cv-fullscreen-overlay .playlist_item:hover .item_thumb_play,
.light-theme .video-cv-fullscreen-overlay .playlist_item:hover .item_thumb_play {
    background: rgba(33, 37, 41, 0.9);
    border-color: rgba(255, 255, 255, 0.8);
}

.video-cv-fullscreen-overlay .video_duration {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 2px;
    line-height: 1;
}

.video-cv-fullscreen-overlay .item_details {
    color: #b8c5d6;
    flex: 1;
    padding-left: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Light theme item details */
html:not([data-theme="dark"]) .video-cv-fullscreen-overlay .item_details,
html[data-theme="light"] .video-cv-fullscreen-overlay .item_details,
.light-theme .video-cv-fullscreen-overlay .item_details {
    color: #495057;
}

.video-cv-fullscreen-overlay .item_title {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    line-height: 1.3;
    font-size: 14px;
}

/* Light theme title */
html:not([data-theme="dark"]) .video-cv-fullscreen-overlay .item_title,
html[data-theme="light"] .video-cv-fullscreen-overlay .item_title,
.light-theme .video-cv-fullscreen-overlay .item_title {
    color: #212529;
}

.video-cv-fullscreen-overlay .item_meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
    gap: 8px;
}

.video-cv-fullscreen-overlay .item_type {
    font-size: 11px;
    color: #4a90e2;
    font-weight: 500;
    flex-shrink: 0;
}

.video-cv-fullscreen-overlay .item_duration {
    font-size: 11px;
    color: #7f8fa4;
    flex-shrink: 0;
}

/* Light theme duration */
html:not([data-theme="dark"]) .video-cv-fullscreen-overlay .item_duration,
html[data-theme="light"] .video-cv-fullscreen-overlay .item_duration,
.light-theme .video-cv-fullscreen-overlay .item_duration {
    color: #6c757d;
}

.video-cv-fullscreen-overlay .item_director {
    display: block;
    font-size: 12px;
    opacity: 0.7;
    line-height: 1.2;
}

.video-cv-fullscreen-overlay .playlist_item.active .item_details {
    color: white;
}

.video-cv-fullscreen-overlay .playlist_item.active .item_director {
    opacity: 0.9;
}

/* Filter menu styling */
.video-cv-fullscreen-overlay .filter-menu {
    padding: 15px;
    border-bottom: 1px solid #333;
}

/* Accordion and filter buttons */
.video-cv-fullscreen-overlay .accordion {
    background-color: #1a1a1a;
    color: #ccc;
}

.video-cv-fullscreen-overlay .accordion-button {
    color: #ccc;
    border-bottom: 1px solid #333;
    padding: 10px 15px;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 12px;
}

.video-cv-fullscreen-overlay .accordion-content {
    padding: 8px;
}

.video-cv-fullscreen-overlay .filter-button {
    color: #ccc;
    padding: 6px 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.video-cv-fullscreen-overlay .filter-button:hover {
    background-color: #333;
    color: white;
}

.video-cv-fullscreen-overlay .filter-button.active {
    background-color: #4a90e2;
    color: white;
}



/* Messages styling */
.video-cv-fullscreen-overlay .no-videos-message,
.video-cv-fullscreen-overlay .error-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    padding: 40px;
    color: #ccc;
    z-index: 1001;
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #333;
}

/* Light theme messages */
html:not([data-theme="dark"]) .video-cv-fullscreen-overlay .no-videos-message,
html:not([data-theme="dark"]) .video-cv-fullscreen-overlay .error-message,
html[data-theme="light"] .video-cv-fullscreen-overlay .no-videos-message,
html[data-theme="light"] .video-cv-fullscreen-overlay .error-message,
.light-theme .video-cv-fullscreen-overlay .no-videos-message,
.light-theme .video-cv-fullscreen-overlay .error-message {
    color: #495057;
    background: #ffffff;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.video-cv-fullscreen-overlay .no-videos-message i,
.video-cv-fullscreen-overlay .error-message i {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
    color: #666;
}

.video-cv-fullscreen-overlay .error-message {
    color: #e74c3c;
}

/* Responsive adjustments */

/* Очень большие экраны (4K и выше) */
@media (min-width: 2560px) {
    .video-cv-fullscreen-overlay .container.row {
        max-width: 2400px;
        padding: 30px;
        gap: 30px;
    }
    
    .overlay-header {
        padding: 20px 40px;
    }
    
    .overlay-header h3 {
        font-size: 24px;
    }
}

/* Большие экраны */
@media (min-width: 1600px) and (max-width: 2559px) {
    .video-cv-fullscreen-overlay .container.row {
        max-width: 1800px;
        padding: 25px;
        gap: 25px;
    }
}

@media (max-width: 1400px) {
    .video-cv-fullscreen-overlay .container.row {
        max-width: 100%;
        padding: 15px;
    }
}

@media (max-width: 1200px) {
    .video-cv-fullscreen-overlay .container.row {
        padding: 15px;
        gap: 15px;
    }
    
    .video-cv-fullscreen-overlay .col.col-sm-12.left {
        flex: 0 0 60%;
    }
    
    .video-cv-fullscreen-overlay .col-sm-12.right {
        flex: 0 0 35%;
    }
}

/* Notebook экраны (13-15 дюймов, разрешение ~1366x768 - 1920x1080) */
@media (max-width: 1366px) and (min-width: 1025px) and (max-height: 768px) {
    .video-cv-fullscreen-overlay .container.row {
        gap: 10px;
        padding: 10px;
        height: calc(100vh - 50px);
        min-height: calc(100vh - 50px);
        max-height: calc(100vh - 50px);
    }
    
    .overlay-header {
        padding: 8px 20px;
    }
    
    .video-cv-fullscreen-overlay .col.col-sm-12.left {
        flex: 0 0 68%;
        height: 100%;
        max-height: 100%;
    }
    
    .video-cv-fullscreen-overlay .col-sm-12.right {
        flex: 0 0 30%;
        height: 100%;
        max-height: 100%;
    }
    
    .video-cv-fullscreen-overlay .plyr__video-embed {
        min-height: calc(100vh - 150px);
    }
}

/* Стандартные notebook экраны (больше по высоте) */
@media (max-width: 1024px) and (min-width: 993px) {
    .video-cv-fullscreen-overlay .container.row {
        gap: 12px;
        padding: 12px;
    }
    
    .video-cv-fullscreen-overlay .col.col-sm-12.left {
        flex: 0 0 62%;
    }
    
    .video-cv-fullscreen-overlay .col-sm-12.right {
        flex: 0 0 36%;
    }
}

@media (max-width: 992px) {
    .video-cv-fullscreen-overlay .container.row {
        flex-direction: column;
        gap: 15px;
        height: calc(100vh - 60px);
        min-height: calc(100vh - 60px);
        max-height: calc(100vh - 60px);
    }
    
    .video-cv-fullscreen-overlay .col.col-sm-12.left {
        flex: 0 0 55vh;
        height: 55vh;
        min-height: 320px;
        max-height: 55vh;
    }
    
    .video-cv-fullscreen-overlay .col-sm-12.right {
        flex: 1;
        height: auto;
        max-height: calc(45vh - 30px);
        min-height: 200px;
    }
}

@media (max-width: 768px) {
    .overlay-header {
        padding: 10px 20px;
    }
    
    .overlay-header h3 {
        font-size: 18px;
    }
    
    .video-cv-fullscreen-overlay .container.row {
        height: calc(100vh - 50px);
        min-height: calc(100vh - 50px);
        max-height: calc(100vh - 50px);
        flex-direction: column;
        padding: 10px;
        gap: 10px;
    }
    
    .video-cv-fullscreen-overlay .col.col-sm-12.left {
        flex: 0 0 45vh;
        height: 45vh;
        min-height: 250px;
    }
    
    .video-cv-fullscreen-overlay .col-sm-12.right {
        flex: 1;
        height: auto;
        max-height: calc(55vh - 20px);
        overflow-y: auto;
    }
    
    .video-cv-fullscreen-overlay .plyr__video-embed {
        min-height: 200px;
    }
}

@media (max-width: 480px) {
    .overlay-header {
        padding: 8px 15px;
    }
    
    .overlay-header h3 {
        font-size: 16px;
    }
    
    .overlay-close {
        font-size: 24px;
    }
    
    .video-cv-fullscreen-overlay .container.row {
        padding: 8px;
        gap: 8px;
        height: calc(100vh - 44px);
        min-height: calc(100vh - 44px);
        max-height: calc(100vh - 44px);
    }
    
    .video-cv-fullscreen-overlay .col.col-sm-12.left {
        flex: 0 0 42vh;
        height: 42vh;
        min-height: 240px;
        max-height: 42vh;
    }
    
    .video-cv-fullscreen-overlay .col-sm-12.right {
        flex: 1;
        max-height: calc(58vh - 16px);
        min-height: 180px;
    }
    
    .video-cv-fullscreen-overlay .playlist-header {
        padding: 10px 12px;
    }
    
    .video-cv-fullscreen-overlay .playlist-header h4 {
        font-size: 14px;
    }
    
    .video-cv-fullscreen-overlay .playlist-wrapper {
        padding: 8px;
    }
    
    .video-cv-fullscreen-overlay .playlist_item {
        padding: 8px;
        margin-bottom: 3px;
    }
    
    .video-cv-fullscreen-overlay .item_thumb_container {
        width: 60px;
        height: 45px;
    }
    
    .video-cv-fullscreen-overlay .item_title {
        font-size: 13px;
        line-height: 1.2;
    }
    
    .video-cv-fullscreen-overlay .item_type,
    .video-cv-fullscreen-overlay .item_duration {
        font-size: 10px;
    }
}

/* Дополнительные улучшения для очень маленьких экранов */
@media (max-height: 600px) {
    .video-cv-fullscreen-overlay .container.row {
        height: calc(100vh - 40px);
        min-height: calc(100vh - 40px);
        max-height: calc(100vh - 40px);
    }
    
    .overlay-header {
        padding: 6px 15px;
    }
    
    .overlay-header h3 {
        font-size: 14px;
    }
}

/* Ориентация landscape для мобильных устройств */
@media (max-width: 768px) and (orientation: landscape) {
    .video-cv-fullscreen-overlay .container.row {
        flex-direction: row;
        height: calc(100vh - 50px);
    }
    
    .video-cv-fullscreen-overlay .col.col-sm-12.left {
        flex: 0 0 65%;
        height: 100%;
    }
    
    .video-cv-fullscreen-overlay .col-sm-12.right {
        flex: 0 0 32%;
        height: 100%;
        max-height: 100%;
    }
}