body {
    background-color: #1a1a1a;
    color: #f0f0f0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.stack {
    display: grid;
    grid-template-columns: 1fr;
    text-align: center;
}

.stack span {
    font-weight: bold;
    grid-row-start: 1;
    grid-column-start: 1;
    font-size: 4rem;
    --stack-height: calc(100% / var(--stacks) - 1px);
    --inverse-index: calc(calc(var(--stacks) - 1) - var(--index));
    --clip-top: calc(var(--stack-height) * var(--index));
    --clip-bottom: calc(var(--stack-height) * var(--inverse-index));
    clip-path: inset(var(--clip-top) 0 var(--clip-bottom) 0);
    animation: stack 340ms cubic-bezier(.46,.29,0,1.24) 1 backwards calc(var(--index) * 120ms), glitch 2s ease infinite 2s alternate-reverse;
}

.stack span:nth-child(odd) { --glitch-translate: 8px; }
.stack span:nth-child(even) { --glitch-translate: -8px; }

@keyframes stack {
    0% {
        opacity: 0;
        transform: translateX(-50%);
        text-shadow: -2px 3px 0 red, 2px -3px 0 blue;
    };
    60% {
        opacity: 0.5;
        transform: translateX(50%);
    }
    80% {
        transform: none;
        opacity: 1;
        text-shadow: 2px -3px 0 red, -2px 3px 0 blue;
    }
    100% {
        text-shadow: none;
    }
}

@keyframes glitch {
    0% {
        text-shadow: -2px 3px 0 red, 2px -3px 0 blue;
        transform: translate(var(--glitch-translate));
    }
    2% {
        text-shadow: 2px -3px 0 red, -2px 3px 0 blue;
    }
    4%, 100% {  text-shadow: none; transform: none; }
}

.grid {
    display: flex;
    flex-wrap: wrap;
}

.grid-item {
    width: calc(33.333% - 20px);
    margin: 10px;
    background: #2a2a2a;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.grid-item img {
    width: 100%;
    height: auto;
    display: block;
}

.grid-item.video-item {
    position: relative;
}

.grid-item.video-item .video-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* Соотношение сторон 16:9 */
}

.grid-item.video-item video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-info {
    padding: 10px;
}

.item-info h3 {
    margin: 0 0 5px 0;
}

.item-info p {
    margin: 0;
    font-size: 14px;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.play-button::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-top: 20px solid transparent;
    border-bottom: 20px solid transparent;
    border-left: 30px solid white;
    margin-left: 7px;
}

@media (max-width: 768px) {
    .grid-item, .grid-item.video-item {
        width: calc(100% - 20px);
    }
}

/* Стили для Bootstrap */
.navbar {
    margin-bottom: 20px;
}

.form-select {
    background-color: #2a2a2a;
    color: #f0f0f0;
    border-color: #4a4a4a;
}

.form-select:focus {
    background-color: #2a2a2a;
    color: #f0f0f0;
    border-color: #6a6a6a;
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.btn-outline-primary {
    color: #007bff;
    border-color: #007bff;
}

.btn-outline-primary:hover {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

.modal-content {
    background-color: #2a2a2a;
    color: #f0f0f0;
}

.modal-header {
    border-bottom-color: #4a4a4a;
}

.modal-footer {
    border-top-color: #4a4a4a;
}

.form-control {
    background-color: #3a3a3a;
    color: #f0f0f0;
    border-color: #4a4a4a;
}

.form-control:focus {
    background-color: #3a3a3a;
    color: #f0f0f0;
    border-color: #6a6a6a;
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

/* Стили для пагинации */
.pagination {
    margin-top: 20px;
}

.page-item:not(.active) .page-link {
    background-color: #2a2a2a;
    border-color: #4a4a4a;
    color: #f0f0f0;
}

.page-item:not(.active) .page-link:hover {
    background-color: #3a3a3a;
    border-color: #5a5a5a;
    color: #ffffff;
}

.page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
    color: #ffffff;
}

.page-item.disabled .page-link {
    background-color: #222222;
    border-color: #3a3a3a;
    color: #6c757d;
}