html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Arial', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    color: white;
    position: relative;
    background: url('assets/лого.jpg') repeat;
    background-size: 20%;
}

.header-flex {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 2rem;
    margin-bottom: 2rem;
}

.logo {
    position: static;
    width: 150px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.header-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.container {
    text-align: center;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    width: calc(100% - 40px);
    max-width: 900px;
    margin: 20px auto;
    box-sizing: border-box;
}

.timer {
    font-size: 3rem;
    font-weight: bold;
    margin: 1rem 0;
}

.timer-block {
    display: inline-block;
    margin: 0 1rem;
}

.timer-label {
    font-size: 1rem;
    text-transform: uppercase;
    margin-top: 0.5rem;
}

h1 {
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2.5rem;
    margin: 2rem 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.route-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    margin: 2rem 0;
    border-radius: 10px;
    display: block;
}

.slideshow-container {
    position: relative;
    width: 100%;
    margin: 2rem auto;
    border-radius: 10px;
    overflow: hidden;
    max-width: 900px;
    padding-top: 56.25%; /* 16:9 Aspect Ratio (9 / 16 * 100%) */
    height: 0; /* Required for padding-top trick */
    padding-left: 40px;
    padding-right: 40px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    color: white;
    font-weight: bold;
    font-size: 24px;
    transition: 0.6s ease;
    border-radius: 50%;
    user-select: none;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transform: translateY(-50%);
}

.prev {
    left: 0;
}

.next {
    right: 0;
}

.prev:hover, .next:hover {
    background-color: rgba(0,0,0,0.8);
}

.dots {
    text-align: center;
    margin: 1rem 0;
}

.dot {
    cursor: pointer;
    height: 12px;
    width: 12px;
    margin: 0 4px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.6s ease;
}

.active, .dot:hover {
    background-color: #717171;
}

.fade {
    animation-name: fade;
    animation-duration: 1.5s;
}

@keyframes fade {
    from {opacity: .4}
    to {opacity: 1}
}

/* Медиа-запросы */
@media (max-width: 768px) {
    .logo {
        width: 100px;
    }
    
    .header-flex {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .header-content {
        align-items: center;
    }
    
    .timer {
        font-size: 2rem;
    }
    
    .timer-block {
        margin: 0 0.5rem;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 1rem;
        border-radius: 6px;
        margin: 10px auto;
        width: calc(100% - 20px);
    }
    
    .route-image {
        border-radius: 6px;
        margin: 1rem 0;
    }
    
    h1 {
        font-size: 1.2rem;
    }
    
    .timer {
        font-size: 1.1rem;
    }
    
    .slideshow-container {
        height: calc(100vw * 9 / 16 - 20px);
        margin-top: 1rem;
        margin-bottom: 1rem;
        padding-left: 60px;
        padding-right: 60px;
    }
    
    .prev, .next {
        width: 25px;
        height: 25px;
        margin-top: -12.5px;
        font-size: 16px;
        left: 10px;
        right: 10px;
    }
    
    #mainNav {
        flex-wrap: wrap;
        height: auto !important;
        min-height: 48px;
        padding: 0 4px !important;
    }
    #navTabs {
        gap: 0.5rem !important;
    }
    .nav-tab {
        font-size: 0.95rem !important;
        padding: 0.5rem 1.1rem !important;
        min-width: 80px;
    }
    #userPanel {
        min-width: 40px !important;
        gap: 2px !important;
    }
    #userEmail {
        display: none !important;
    }
    #userIcon {
        width: 28px !important;
        height: 28px !important;
    }
    #riversContent > div > div {
        padding: 0 !important;
        margin: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        overflow-x: auto !important;
    }
    #riversTable {
        min-width: 900px;
        width: 100vw !important;
        max-width: 100vw !important;
        font-size: 0.92rem !important;
    }
    #riversTable th, #riversTable td {
        padding: 0.3rem 0.3rem !important;
        font-size: 0.92rem !important;
    }
}

@media (max-width: 500px) {
    #userEmail {
        display: none !important;
    }
    .nav-tab {
        font-size: 0.85rem !important;
        padding: 0.4rem 0.7rem !important;
        min-width: 60px;
    }
    #riversTable {
        min-width: 700px;
        font-size: 0.85rem !important;
    }
    #riversTable th, #riversTable td {
        font-size: 0.85rem !important;
        padding: 0.2rem 0.2rem !important;
    }
}

#riversTable th {
    background: linear-gradient(90deg, #23243a 0%, #0f2027 100%);
    color: #fff;
    font-weight: 700;
}

#riversTable th:nth-child(13), #riversTable td:nth-child(13) { min-width: 200px; white-space: nowrap; }

#riversTable th:nth-child(14), #riversTable td:nth-child(14) { min-width: 200px; width: 200px; white-space: nowrap; }

.action-col, #riversTable td.action-col { min-width: 240px; width: 240px; white-space: nowrap; }

#riversTable thead tr {
    border-bottom: 2px solid #fff;
} 