body {
    background-color: #121212;
    color: #ffffff;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.header {
    background-color: #1f1f1f;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #333;
}

.logo {
    color: #ff0000;
    font-size: 2em;
    font-weight: bold;
    margin: 0;
    cursor: pointer;
}

.search-box {
    display: flex;
    gap: 10px;
}

#search-input {
    padding: 8px 12px;
    border: none;
    background-color: #2c2c2c;
    color: #ffffff;
    border-radius: 5px;
    width: 250px;
}

#search-button {
    padding: 8px 15px;
    background-color: #ff0000;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#search-button:hover {
    background-color: #e50000;
}

.container {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.main-content {
    flex: 2;
}

.sidebar {
    flex: 1;
}

/* Скрываем видео-страницу по умолчанию */
.video-page {
    display: none;
    gap: 20px;
}

/* Стили для видео на главной странице */
.grid-item {
    background-color: #1f1f1f;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative; /* Важно для расположения длительности */
}

.grid-item:hover {
    transform: scale(1.02);
}

.grid-item-thumbnail {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.grid-item-info {
    padding: 10px;
}

.grid-item-title {
    font-size: 1em;
    margin: 0 0 5px;
}

.grid-item-channel {
    font-size: 0.8em;
    color: #aaaaaa;
}

/* Эффект для названия канала */
.channel-effect {
    font-size: 0.8em;
    color: #aaaaaa;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.5); /* Добавляем небольшое свечение */
    position: relative;
    padding: 2px 5px;
    border-radius: 5px;
    display: inline-block; /* Это важно для обводки */
    transition: all 0.3s;
}

/* Создаем псевдоэлемент для обводки */
.channel-effect::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 7px;
    background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
    background-size: 400% 400%;
    z-index: -1;
    animation: glowing 20s linear infinite;
    opacity: 0.5;
}

/* Эффект при наведении */
.channel-effect:hover::before {
    opacity: 1;
}

/* Анимация переливания */
@keyframes glowing {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.grid-item-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.8em;
}

/* Стили для страницы просмотра видео */
.video-page {
    display: flex;
}

.main-video-player {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    background-color: #000;
    border-radius: 10px;
    overflow: hidden;
}

.main-video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-info {
    margin-top: 15px;
}

#main-video-title {
    font-size: 1.5em;
    margin: 0 0 5px;
}

#main-video-channel {
    font-size: 0.9em;
    color: #aaaaaa;
}

.sidebar h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

.video-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.video-item {
    display: flex;
    background-color: #1f1f1f;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: background-color 0.2s;
}

.video-item:hover {
    background-color: #2c2c2c;
}

.video-item-thumbnail {
    width: 160px;
    height: 90px;
    object-fit: cover;
}

.video-item-info {
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.video-item-title {
    font-size: 1em;
    margin: 0 0 5px;
}

.video-item-channel {
    font-size: 0.8em;
    color: #aaaaaa;
}


.live-text {
    color: #ff0000;
    font-weight: bold;
    font-family: 'Arial Black', sans-serif;
    animation: glow 1.2s infinite ease-in-out;
}

@keyframes glow {
    0%, 100% {
        text-shadow: 
            0 0 5px #ff0000,
            0 0 10px #ff0000,
            0 0 15px #ff0000;
        transform: scale(1);
        opacity: 1;
    }
    50% {
        text-shadow: 
            0 0 20px #ff0000,
            0 0 30px #ff0000,
            0 0 40px #ff0000;
        transform: scale(1.05);
        opacity: 0.8;
    }
}