/* Базовые стили и переменные */
:root {
    --bg-color: #0f0f0f;
    --header-bg: #0f0f0f;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --element-bg: #272727;
    --element-hover: #3f3f3f;
    --border-color: #3f3f3f;
    --accent-color: #ff0000;
}

body.light-theme {
    --bg-color: #ffffff;
    --header-bg: #ffffff;
    --text-primary: #0f0f0f;
    --text-secondary: #606060;
    --element-bg: #f2f2f2;
    --element-hover: #e5e5e5;
    --border-color: #cccccc;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', Arial, sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Шапка */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: var(--header-bg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.burger-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
}

.burger-btn:hover {
    background-color: var(--element-hover);
}


.logo {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    letter-spacing: -1px;
    fill: currentcolor;
    position: relative;
}

.logo-icon {
    font-size: 24px;
    margin-top: -2px;
}
body.light-theme .logo_country_code{
    filter: invert(1);
    transition: filter 0.3s;
}
.logo_country_code{
    position: absolute;
    top: -11px;
    right: -14px;
    color: #a7a7a7;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0px
}
body.light-theme .logo-icon > img {
    fill: currentcolor;
}

.search-bar {
    display: flex;
    width: 50%;
    max-width: 600px;
}

.search-bar input {
    width: 100%;
    padding: 10px 15px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 20px 0 0 20px;
    color: var(--text-primary);
    outline: none;
}

.search-bar button {
    padding: 10px 20px;
    background-color: var(--element-bg);
    border: 1px solid var(--border-color);
    border-left: none;
    border-radius: 0 20px 20px 0;
    color: var(--text-primary);
    cursor: pointer;
}

.theme-btn {
    background-color: var(--element-bg);
    color: var(--text-primary);
    border: none;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
}

.theme-btn:hover {
    background-color: var(--element-hover);
}

/* Основной контент */
main {
    max-width: 1000px;
    margin: 20px auto;
    padding: 0 20px;
}

/* Плеер */
.video-player {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Фикс для полноэкранного режима */
.video-player:fullscreen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    max-width: none;
    margin: 0;
}
.video-player:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    max-width: none;
    margin: 0;
}

/* Стили для тега video */
#custom-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 1;
    /* object-fit: cover; */
}

/* Наш слой с кнопками растягиваем на всё видео */
.controls-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 70%, rgba(0,0,0,0.8) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 15px 10px 15px;
    /* Важно: фон ловит клики (для паузы), но не блокирует клики по кнопкам ниже */
}

.progress-bar-container {
    width: 100%;
    height: 4px;
    background-color: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: height 0.1s;
    position: relative;
    z-index: 3;
    pointer-events: auto;
}

.progress-bar-container:hover {
    height: 6px;
}

.progress-bar-fill {
    width: 0%; /* Начинаем с 0, JS будет менять это значение */
    height: 100%;
    background-color: var(--accent-color);
}

.bottom-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 3;
    pointer-events: auto;
    margin-top: 10px;
}

.controls-left, .controls-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.control-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0.9;
}

.control-btn:hover {
    opacity: 1;
}

.control-btn svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

/* Информация под видео */
.video-title {
    margin-top: 20px;
    font-size: 20px;
    font-weight: bold;
}

.video-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.channel-info {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
}

.channel-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--element-bg);
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}
.channel-avatar>img{
    display: block;
    border-radius: 50%;
    max-width: 30px;
}
.channel-details h3 {
    font-size: 16px;
}

.channel-details span {
    font-size: 12px;
    color: var(--text-secondary);
}

.subscribe-btn {
    background-color: var(--text-primary);
    color: var(--bg-color);
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 10px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.action-btn {
    background-color: var(--element-bg);
    color: var(--text-primary);
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.action-btn:hover {
    background-color: var(--element-hover);
}

/* Описание видео (Сворачиваемое) */
.description-box {
    background-color: var(--element-bg);
    padding: 15px;
    border-radius: 12px;
    margin-top: 20px;
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
    position: relative;
}

.description-box:hover {
    background-color: var(--element-hover);
}

.description-content {
    max-height: 65px; 
    overflow: hidden;
    pointer-events: none; 
}

.description-box.expanded .description-content {
    max-height: 400px; 
    overflow-y: auto; 
    pointer-events: auto;
}

.description-box.expanded .description-content::-webkit-scrollbar {
    width: 8px;
}
.description-box.expanded .description-content::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 4px;
}

.description-box strong {
    display: block;
    margin-bottom: 5px;
}

.show-more-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    margin-top: 5px;
    pointer-events: none; 
}

/* Секция комментариев */
.comments-section {
    margin-top: 30px;
}

.comments-header {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
}

.comment-input-area {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.comment-input-area input {
    flex-grow: 1;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    padding-bottom: 5px;
}

.comment {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.comment-text h4 {
    font-size: 13px;
    margin-bottom: 5px;
}

.comment-text h4 span {
    font-weight: normal;
    color: var(--text-secondary);
}

.comment-text p {
    font-size: 14px;
}

/* Иконки и инверсия цвета */
.search-icon {
    filter: invert(1); 
    transition: filter 0.3s;
}

body.light-theme .search-icon {
    filter: none;
}

.action-btn > img {
    width: 22px;
    height: 22px;
}

.likes {
    filter: invert(1); 
    transition: background-color 0.2s ease, filter 0.2s ease;
    cursor: pointer;
    padding: 4px;
    border-radius: 40%;
}
.likes:hover {
    background-color: rgba(255,255,255,0.1);
}
/* Тёмная тема — актив: серая круглая подложка + белая иконка */
.likes.active {
    background-color: rgba(255,255,255,0.2);
    filter: brightness(0) invert(1);
}
.like-count{
    color: #b9b9b9;
    font-size: 12px;
    margin-left: -15px;
    user-select: none;
}
body.light-theme .like-count{
    color: #000;
}

body.light-theme .likes {
    filter: none;
}
body.light-theme .likes:hover {
    background-color: rgba(0,0,0,0.05);
}
/* Светлая тема — актив: тёмная круглая подложка + чёрная иконка */
body.light-theme .likes.active {
    background-color: rgba(0,0,0,0.1);
    filter: brightness(0);
}

/* --- Стили для блока Order-form (Улучшенный дизайн) --- */
.order-block {
    background-color: var(--element-bg);
    border: 1px solid #4e8c0e;
    border-radius: 16px; /* Чуть больше скругления для современности */
    padding: 40px 30px; /* Добавили "воздуха" внутри */
    margin: 40px auto;
    max-width: 800px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3); /* Объемная тень */
    position: relative;
    overflow: hidden;
}

/* Элегантная акцентная линия сверху блока */
.order-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #4e8c0e;
}

/* Анимация плавного появления формы */
.fade-in {
    animation: fadeIn 0.8s ease-out forwards; /* Сделали чуть быстрее и плавнее */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.order-cta {
    text-align: center;
    font-size: 26px; /* Чуть крупнее */
    font-weight: 900;
    margin-bottom: 20px;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.order-content {
    display: flex;
    gap: 40px;
    align-items: center;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.product-img {
    width: 100%;
    max-width: 300px;
    border-radius: 12px; /* Совпадает со стилем формы */
    object-fit: cover;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s;
}

.product-img:hover {
    transform: scale(1.02); /* Легкий зум картинки при наведении */
}

.price-block {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: rgba(116, 255, 0, 0.05); /* Легкая подложка под цену */
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px dashed #4d890d;
    margin-bottom: 10px;

}

.old-price {
    font-size: 18px;
    color: var(--text-secondary);
    text-decoration: line-through; 
}

/* Обертка, чтобы цена и надпись стояли друг над другом */
.new-price-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Стили для самой надписи "Цена сегодня!" */
.price-label {
    font-size: 14px;
    font-weight: bold;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    background-color: #759a4e;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: -5px; /* Слегка прижимаем к самой цене */
    z-index: 1; /* Чтобы надпись была поверх цены */
}

.new-price {
    font-size: 36px; /* Сделали цену еще массивнее */
    font-weight: 900;
    color: #70da3f; 
}

.order-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.order-form input {
    width: 100%;
    padding: 16px 20px;
    background-color: var(--bg-color);
    border: 2px solid var(--border-color); /* Сделали рамку чуть толще */
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

/* Красивая подсветка при вводе данных */
.order-form input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.15);
}

/* Мощная кнопка заказа */
.submit-btn {
    background: linear-gradient(135deg, #ff4b4b 0%, var(--accent-color) 100%);
    color: #ffffff; /* Текст на кнопке всегда белый */
    border: none;
    padding: 18px;
    border-radius: 8px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.3); /* Цветная тень */
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.submit-btn:hover {
    transform: translateY(-3px); /* Кнопка тянется к курсору */
    box-shadow: 0 10px 25px rgba(255, 0, 0, 0.4);
}

.submit-btn:active {
    transform: translateY(1px); /* Физическое ощущение нажатия */
    box-shadow: 0 2px 10px rgba(255, 0, 0, 0.3);
}

/* Стили для текста безопасности под кнопкой */
.order-form p {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 5px;
}

/* Адаптив: на телефонах выстраиваем в колонку */
/* --- Стили для reply-комментариев (YouTube-стиль) --- */
.replies-wrapper {
    position: relative;
    
    padding-left: 0;
}

/* Базовые стили reply-комментария */
.comment.reply {
    position: relative;
    margin-bottom: 20px;
    margin-left: 56px;
}


/* Закорючка-иконка reply (как на ютубе) */
.comment:has(+ .reply){
    position: relative;
}
.comment:has(+ .reply):before {
    content: '';
    border-left: 2px solid #333;
    border-bottom: 2px solid #333;
    border-radius: 0 0 0 16px;
    width: 22px;
    height: calc(100% - 40px + 30px);
    position: absolute;
    top: 50px;
    left: 18px;
}

.comment.reply::before{
    height: calc(100% - 32px + 25px);
    top: 42px;
    left: 15px;
}

body.light-theme .comment.reply::before {
    filter: none;
}

.comment.reply .channel-avatar {
    width: 32px;
    height: 32px;
}

.comment.reply .channel-avatar > img {
    max-width: 24px;
}

/* Второй уровень вложенности (ответ на ответ) */
.comment.reply.reply2{
    margin-left: 106px;
}

.reply:has(+ .reply:not(.reply2)):before{
    border-bottom: none;
    border-radius: 0;
    height: calc(100% - 32px);
}
.reply2:has(+ .reply2):before{
    border-bottom: none;
    border-radius: 0;
    height: calc(100% - 32px);
}


@media (max-width: 650px) {
    .order-content {
        flex-direction: column;
        gap: 30px;
    }
    
    .order-cta {
        font-size: 22px;
    }
    
    .order-block {
        padding: 30px 20px;
    }
    .theme-btn{
        display: none;
    }
}

.cpu {
    padding: 10px 0;
    text-align: center;
}

.cpu img {
    display: block;
    margin: 0 auto;
    width: auto;
}

.cpu a {
    display: inline-block;
    margin: 5px;
    color: #FFF;
    font-size: 14px;
}

body.light-theme .cpu > a {
    color: #272727;
}

/* --- Стили для таймера --- */
.timer-wrapper {
    text-align: center;
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 25px;
    color: var(--text-primary);
}

#countdown-timer {
    color: var(--accent-color); /* Красный цвет для привлечения внимания */
    font-size: 26px;
    font-weight: bold;
    padding: 5px 12px;
    background: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: inline-block;
    margin-left: 10px;
    letter-spacing: 2px;
}

.comment-actions{
    display: flex;
    gap: 20px;
    align-items: center;
    margin-top: 5px;
    cursor: pointer;
    
}
.comment-actions>img{
    max-width: 25px;
    
}
.comment-actions>img:last-of-type{
    max-width: 22px;
}

@media (max-width: 480px){
    .theme-btn{
        display: none;
    }
    .search-bar{
        display: none;
    }
}

.comment-text h4{
    cursor: pointer;
}
/* --- Центральная анимация Play/Pause --- */
.center-animation-container {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4; /* Поверх видео и градиента */
    pointer-events: none; /* Пропускаем клики сквозь этот блок */
    display: flex;
    justify-content: center;
    align-items: center;
}

.center-icon {
    width: 72px;
    height: 72px;
    background: rgba(0, 0, 0, 0.6); /* Полупрозрачный черный круг */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    opacity: 0;
}

.center-icon svg {
    width: 36px;
    height: 36px;
    fill: currentColor;
}

/* Класс, который будет запускать саму анимацию */
.animate-center-icon {
    animation: pingFade 0.6s ease-out forwards;
}



.play-btn{
    position: absolute;
    top: 45%;
    left: 50%;
    margin: -50px 0 0 -50px;
    max-width: 100px;
    z-index: 99;
    pointer-events: none;
    opacity: 0.7;

    animation: scalePulse 0.8s ease-in-out infinite;
    
    /* Важно: добавляем плавный переход для ховера, чтобы анимация не дергалась */
    transition: transform 0.2s ease, opacity 0.3s ease;
}

@keyframes scalePulse {
    0% {
        transform: scale(1); /* Исходный размер */
    }
    50% {
        transform: scale(1.1); /* Увеличиваем на 5% */
    }
    100% {
        transform: scale(1); /* Возвращаем к исходному размеру */
    }
}
.play-btn:hover {
    /* Приостанавливаем пульсацию, когда пользователь навел курсор */
    animation-play-state: paused; 
    transform: scale(1.08); /* Делаем кнопку чуть больше при наведении */
}



@keyframes pingFade {
    0% {
        opacity: 1;
        transform: scale(0.8);
    }
    100% {
        opacity: 0;
        transform: scale(1.3);
    }
}

@media (max-width: 700px){
    .center-animation-container{
        top: 20%;
    }

    .play-btn{
        margin: -30px 0 0 -30px;
        max-width: 60px;
    }


}

