/* styles.css */

@import url('https://fonts.googleapis.com/css2?family=Jura:wght@400;500;700&display=swap');

body {
    font-family: 'Jura', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #121212;
    color: #e0e0e0; 
    animation: fadeInBody 1s ease-out forwards;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

h1 {
    text-align: center;
}

@keyframes fadeInBody {
    from { opacity: 0; }
    to { opacity: 1; }
}

header {
    background-color: #1e1e1e;
    padding: 16px 32px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    opacity: 0;
    animation: slideInDown 0.8s ease-out 0.2s forwards;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.logo {
    color: #ffffff;
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
    transition: color 0.3s ease;
}

.logo:hover {
    color: #bb86fc;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 24px;
}

nav ul li a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s, transform 0.3s;
}

nav ul li a:hover {
    color: #e0e0e0;
    transform: scale(1.1);
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.hamburger.active {
    transform: rotate(90deg);
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    nav ul {
        display: none;
        flex-direction: column;
        gap: 16px;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #1e1e1e;
        padding: 16px 0;
        text-align: center;
        opacity: 0;
        transform: translateY(-20px);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    nav ul.active {
        display: flex;
        opacity: 1;
        transform: translateY(0);
        z-index: 100;
    }
}

main {
    max-width: 1200px;
    margin: 32px auto;
    padding: 0 16px;
    flex: 1;
}

#carousel-section {
    margin-bottom: 48px;
    opacity: 0;
    animation: fadeIn 1s ease-out 0.4s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

h2 {
    color: #ffffff;
    font-size: 24px;
    margin-bottom: 16px;
    text-align: center;
}

.carousel-container {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.carousel {
    position: relative;
    display: flex;
    transition: transform 0.4s ease-in-out;
    z-index: 2;
}

.video-item {
    flex: 0 0 100%;
    position: relative;
    cursor: pointer;
    aspect-ratio: 16 / 9;
    height: auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-item:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

.video-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter 0.3s;
}

.video-item:hover img {
    filter: brightness(1.1);
}

.video-overlay-right {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 350px;
    background: linear-gradient(to right, transparent 0%, rgba(18, 18, 18, 0.85) 20%); /* Затемнение справа */
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
    color: #ffffff;
    box-sizing: border-box;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.video-item:hover .video-overlay-right {
    opacity: 1;
}

.video-overlay-right h3 {
    font-size: 20px;
    margin: 0 0 16px 0;
    font-weight: 500;
    line-height: 1.3;
    transition: color 0.3s;
}

.video-overlay-right h3:hover {
    color: #e0e0e0;
}

.video-overlay-right p {
    font-size: 14px;
    margin: 8px 0;
    color: #e0e0e0;
}

.carousel-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 16px;
    position: relative;
    z-index: 3;
}

.carousel-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: #bbbbbb;
    border-radius: 50%;
    transition: width 0.3s, height 0.3s, border-radius 0.3s, background-color 0.3s;
    position: relative;
    overflow: hidden;
}

.dot.active {
    width: 32px;
    height: 4px;
    border-radius: 2px;
    background-color: #1e1e1e;
    margin-top: 2px;
}

.progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background-color: #ffffff; 
    transition: width linear;
}

.carousel-play-pause {
    background: none;
    border: none;
    color: #ffffff; 
    font-size: 20px;
    cursor: pointer;
    margin-left: 16px;
    transition: color 0.3s, transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.content-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    width: 100%;
}

.content-item {
    flex: 0 0 300px;
    background-color: #2c2c2c;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;             /* добавляем flex */
    flex-direction: column;    /* элементы идут сверху вниз */
}

.content-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.content-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.content-item h3 {
    font-size: 18px;
    margin: 12px 16px 8px;
    color: #ffffff;
}

.content-item p {
    font-size: 14px;
    margin: 0 16px 16px;
    line-height: 1.4;
    color: #e0e0e0;
    min-height: 55px;
}

.content-button {
    margin-top: auto;          
    margin-left: 16px;
    margin-right: 16px;
    margin-bottom: 16px;
    padding: 8px 16px;
    background-color: #bb86fc;
    color: #121212;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.3s;
    display: flex;
    justify-content: center;
}

.content-button:hover {
    background-color: #ffffff;
}

.setup-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    width: 100%;
}

.setup-box {
    flex: 0 0 300px;
    background-color: #1e1e1e;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInBox 0.5s ease-out forwards;
    animation-delay: calc(0.2s * var(--order));
}

@keyframes fadeInBox {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.setup-box h2 {
    margin-top: 0;
}

.setup-photo {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 16px;
    transition: transform 0.3s ease;
}

.setup-box:hover .setup-photo {
    transform: scale(1.05);
}

.setup-text {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 16px;
    flex-grow: 1;
}

.details-button {
    padding: 10px 20px;
    background-color: #bb86fc;
    color: #121212;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
    align-self: center;
    width: 100%;
}

.details-button:hover {
    background-color: #ffffff;
}

.setup-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
}

.setup-list.loading {
    max-height: 200px;
}

.setup-list.expanded {
    max-height: 1000px;
}

.setup-list li {
    background-color: #2c2c2c;
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 8px;
    font-size: 16px;
}

.setup-list li strong {
    color: #ffffff;
}

footer {
    background-color: #1e1e1e;
    color: #e0e0e0;
    padding: 24px;
    text-align: center;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.2);
    opacity: 0;
    animation: slideInUp 0.8s ease-out 0.8s forwards;
    margin-top: auto; 
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

footer ul {
    list-style: none;
    padding: 0;
    margin: 12px 0;
    display: flex;
    justify-content: center;
    gap: 16px;
}

footer ul li a {
    color: #ffffff; 
    text-decoration: none;
    transition: color 0.3s, transform 0.3s;
}

footer ul li a:hover {
    color: #e0e0e0;
    transform: scale(1.1);
}

footer p {
    margin: 8px 0;
    color: #bbbbbb;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
    animation: fadeInModal 0.5s ease-out forwards;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: #1e1e1e;
    padding: 16px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    max-height: 90%;
    transform: scale(0.8);
    transition: transform 0.5s ease;
    overflow-y: auto;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #2c2c2c;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #ffffff;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #e0e0e0;
}

.close-modal {
    position: absolute;
    top: 8px;
    right: 16px;
    color: #e0e0e0;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s, transform 0.3s;
}

.close-modal:hover {
    color: #ffffff;
    transform: rotate(90deg);
}

#video-iframe {
    width: 1000px;
    height: 562px;
    border-radius: 8px;
    max-width: 100%;
}

@media (max-width: 768px) {
    #video-iframe {
        width: 100%;
        height: 315px;
    }
    
    footer ul {
        flex-direction: column;
    }

    .video-item {
        aspect-ratio: 16 / 9;
    }

    .video-overlay-right {
        width: 100%;
        background: rgba(18, 18, 18, 0.85);
        justify-content: flex-end;
    }

    .video-overlay-right h3 {
        font-size: 18px;
    }

    nav ul {
        flex-wrap: wrap;
        gap: 16px;
    }
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    width: 100%;
}

.loading-spinner::before {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #bb86fc;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}