:root {
    --blue-dark: #0d47a1;
    --blue-light: #42a5f5;
    --text-light: #fff;
    --bg: #f4f9ff;
    --radius: 1rem;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --transition: 0.3s ease;
}

*, *::before, *::after {
    box-sizing: border-box;
}


/* Sticky footer layout */
html, body {
    max-width: 100vw;
    width: 100%;
    overflow-x: hidden;
}

body {
    display: flex;
    flex-direction: column;
    color: #333;
    font-family: 'Segoe UI', sans-serif;
    padding-top: 40px;
}
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('img/background.png');
    background-size: cover;
    background-position: center;
    z-index: -1;
    pointer-events: none;
}

main {
    flex: 1;
}

header {
    background: linear-gradient(to right, var(--blue-dark), var(--blue-light));
    color: var(--text-light);
    box-shadow: var(--shadow);
    max-width: 100%;
}

header, nav, .container {
    max-width: 100%;
}

#project-name {
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
    margin: 0;
    word-break: break-word;
    white-space: normal;
}

.nav-link {
    color: white;
    transition: var(--transition);
}
.nav-link:hover {
    color: #cce7ff;
    text-decoration: underline;
}

/* Main list */
.list {
    max-width: 800px;
    margin: 2rem auto;
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    animation: fadeIn 0.8s ease-in-out;
}

.list p {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}
.list a {
    text-decoration: none;
    color: var(--blue-dark);
}
.list a:hover {
    color: var(--blue-light);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.level-list {
    display: flex;
    flex-direction: column;
    max-width: 100%;
    overflow-x: hidden;
    align-items: center;
}

.level-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start;
    background: #fff;
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
    width: 90%;
    flex-wrap: wrap;
    overflow: hidden;
    margin-left: auto;
    margin-right: auto;
}

.level-img {
    flex-shrink: 0;
    margin-right: 1rem;
}

.level-img img {
    width: 100%;
    max-width: 160px;
    height: auto;
    object-fit: cover;
    border-radius: 0.5rem;
}
.level-info {
    flex: 1 1 0;
    min-width: 0;
}

.level-info h5 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.level-info p {
    margin: 0;
    font-size: 0.95rem;
    color: #444;
}

.records-table {
    margin-top: 2rem;
}

.records-table table {
    width: 100%;
    border-collapse: collapse;
}

.detail-wrapper {
    max-width: 800px !important;
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 2rem;
    background-color: #0f172a;
    color: #f1f5f9;
    border-radius: 1rem;
}

.detail-wrapper a {
    color: #42a5f5;
}

.youtube-btn{
    color: red !important;
}

.video-container {
    position: relative;
    height: 100%;
    width: 100%;
}

.video-container iframe {
    width: 640px;
    height: 360px;
    border: 0;
    aspect-ratio: 16/9;
}

.dropdown {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.dropdown-text {
    font-weight: bold;
    color: #0d47a1;
    padding: 0.5rem 1rem;
    transition: color 0.2s ease;
}

.dropdown-text:hover {
    color: #1976d2;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #ffffff;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 8px;
    overflow: hidden;
}

.dropdown-content a {
    color: #0d47a1;
    padding: 12px 16px;
    display: block;
    text-decoration: none;
    transition: background 0.2s;
}

.dropdown-content a:hover {
    background-color: #e3f2fd;
}

.dropdown:hover .dropdown-content {
    display: block;
}

@media (max-width: 376px){
    table {
        font-size: 10px;
    }
    body {
        padding-top: 95px !important;
    }
    .btn {
        padding: 0.25rem 0.5rem; !important; /* Меньше отступы */
        font-size: 0.75rem; !important;    /* Меньше текст */
    }
    .youtube-btn {
        font-size: 10px !important;
        padding-block-end: 0px !important;
        margin-bottom: 12px !important;
        display: inline-block !important;
    }

    .btn i {
        font-size: 1rem; !important; /* уменьшить иконки, если есть */
    }
    .btn-telegram span {
        display: none; !important;
    }
    .btn-telegram i {
        padding-left: 10px;
    }
}

@media (max-width: 990px){
    body {
        padding-top:60px;
    }
}

@media (max-width: 768px) {
    .level-list  {
        width: 100%;
    }
    .level-card {
        flex-direction: column !important;
        align-items: center;
        text-align: center;
    }

    .level-img {
        margin-right: 0;
        margin-bottom: 5px;
    }

    .level-info {
        width: 100%;
    }
    body{
        padding-top: 72.5px;
    }
    #project-name {
        font-size: 18px;
    }
    .detail-wrapper{
        width: 97% !important;
    }
    .video-container iframe {
        width: 225px;
        height: 126px;
        border: 0;
    }
}