body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f0f2f5;
}

.container {
    flex: 1;
}

.footer {
    margin-top: auto;
}

/* ==================== КОМПАКТНАЯ КАРУСЕЛЬ ==================== */
.stages-carousel-wrapper {
    position: relative;
    padding: 1.5rem 0;
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.stages-carousel {
    overflow: hidden;
    position: relative;
    padding: 1rem 50px;
    height: 180px;
}

.carousel-track {
    display: flex;
    gap: 15px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 15px;
}

.stage-card-wrapper {
    flex: 0 0 auto;
}

/* ==================== СТРЕЛКИ НАВИГАЦИИ ==================== */
.carousel-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(74, 144, 226, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    color: #357ABD;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.carousel-nav-arrow:hover:not(:disabled) {
    background: rgba(74, 144, 226, 0.95);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav-arrow:disabled {
    opacity: 0;
    pointer-events: none;
}

.carousel-nav-left {
    left: 8px;
}

.carousel-nav-right {
    right: 8px;
}

/* ==================== КОМПАКТНЫЕ КАРТОЧКИ ==================== */
.stage-card {
    width: 120px;
    height: 140px;
    padding: 0.75rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-align: center;
    position: relative;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stage-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

/* ==================== КАРТОЧКА В ЦЕНТРЕ ==================== */
.stage-centered {
    width: 160px !important;
    height: 160px !important;
    padding: 1rem !important;
    transform: scale(1) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2) !important;
    filter: brightness(1) !important;
    opacity: 1 !important;
}

.stage-centered.stage-active-original {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%) !important;
    color: white !important;
    border: 2px solid #fff !important;
    animation: pulseCompact 2s infinite;
}

.stage-centered.stage-active-original .stage-number,
.stage-centered.stage-active-original .stage-date,
.stage-centered.stage-active-original .stage-location-short,
.stage-centered.stage-active-original .stage-winner-short,
.stage-centered.stage-active-original .stage-participants-short {
    color: white !important;
}

@keyframes pulseCompact {
    0%, 100% {
        box-shadow: 0 10px 30px rgba(16, 185, 129, 0.5);
    }
    50% {
        box-shadow: 0 12px 40px rgba(16, 185, 129, 0.8);
    }
}

.stage-centered.stage-completed {
    background: linear-gradient(135deg, #9CA3AF 0%, #6B7280 100%) !important;
    color: white !important;
}

.stage-centered.stage-completed .stage-number,
.stage-centered.stage-completed .stage-date,
.stage-centered.stage-completed .stage-location-short,
.stage-centered.stage-completed .stage-winner-short {
    color: white !important;
}

.stage-centered.stage-upcoming {
    background: linear-gradient(135deg, #60A5FA 0%, #3B82F6 100%) !important;
    color: white !important;
}

.stage-centered.stage-upcoming .stage-number,
.stage-centered.stage-upcoming .stage-date,
.stage-centered.stage-upcoming .stage-location-short {
    color: white !important;
}

/* ==================== КАРТОЧКИ НЕ В ЦЕНТРЕ ==================== */
.stage-dimmed {
    opacity: 0.5 !important;
    filter: brightness(0.85) saturate(0.7) !important;
    transform: scale(0.95) !important;
}

.stage-dimmed.stage-active-original {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.4) 0%, rgba(5, 150, 105, 0.4) 100%) !important;
}

.stage-dimmed.stage-completed {
    background: linear-gradient(135deg, #D1D5DB 0%, #9CA3AF 100%);
    opacity: 0.4 !important;
}

.stage-dimmed.stage-upcoming {
    background: linear-gradient(135deg, #E5E7EB 0%, #D1D5DB 100%);
    opacity: 0.5 !important;
}

.stage-selected {
    border: 2px solid #FFC107 !important;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.3) !important;
}

/* ==================== ЭЛЕМЕНТЫ КАРТОЧКИ ==================== */
.stage-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1F2937;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stage-centered .stage-number {
    font-size: 2rem;
}

.stage-date {
    font-size: 0.75rem;
    font-weight: 500;
    color: #4B5563;
    margin-bottom: 0.25rem;
}

.stage-location-short {
    font-size: 0.65rem;
    color: #6B7280;
    margin-bottom: 0.5rem;
}

.stage-badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
    margin: 0.25rem 0;
}

.stage-winner-short,
.stage-participants-short {
    font-size: 0.6rem;
    color: #6B7280;
    margin-top: 0.25rem;
}

/* ==================== МОДАЛЬНОЕ ОКНО ==================== */
.modal-header {
    border-bottom: 3px solid rgba(255, 255, 255, 0.3);
}

.stat-card {
    padding: 1rem;
    border-radius: 10px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-operational {
    border-left: 4px solid #10B981;
}

.stat-maintenance {
    border-left: 4px solid #F59E0B;
}

.stat-training {
    border-left: 4px solid #3B82F6;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #1F2937;
}

.stat-label {
    font-size: 0.875rem;
    color: #6B7280;
    margin-top: 0.25rem;
}

.category-badge {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
    font-size: 0.875rem;
    border-left: 3px solid #ddd;
    transition: all 0.3s ease;
}

.category-badge:hover {
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.category-pro {
    border-left-color: #DC2626;
}

.category-amateur {
    border-left-color: #F59E0B;
}

.category-beginner {
    border-left-color: #3B82F6;
}

.category-kids {
    border-left-color: #8B5CF6;
}

.category-badge i {
    display: block;
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

/* ==================== КНОПКИ УПРАВЛЕНИЯ ==================== */
.carousel-controls .btn-sm {
    min-width: 100px;
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
}

.btn-outline-light {
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.btn-outline-light:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
    color: white;
}

.btn-warning {
    background: #FFC107;
    border-color: #FFC107;
    color: #1F2937;
    font-weight: 600;
}

.btn-warning:hover {
    background: #FFB300;
}

/* ==================== АРХИВ ==================== */
.completed-stages {
    margin-top: 2rem;
}

.accordion-button {
    font-size: 1rem;
    padding: 1rem;
}

.accordion-button:not(.collapsed) {
    background-color: #E5E7EB;
    color: #1F2937;
}

.archive-card {
    transition: all 0.3s ease;
    border: 1px solid #D1D5DB;
    cursor: pointer;
}

.archive-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15) !important;
    border-color: #4A90E2;
}

.bg-success.bg-opacity-10 {
    background-color: rgba(16, 185, 129, 0.1) !important;
}

/* ==================== АДАПТИВНОСТЬ ==================== */
@media (max-width: 768px) {
    .stages-carousel {
        padding: 1rem 45px;
        height: 160px;
    }

    .stage-card {
        width: 100px;
        height: 130px;
        padding: 0.5rem;
    }

    .stage-centered {
        width: 140px !important;
        height: 150px !important;
        padding: 0.75rem !important;
    }

    .stage-number {
        font-size: 1.25rem;
    }

    .stage-centered .stage-number {
        font-size: 1.75rem;
    }

    .stage-date {
        font-size: 0.7rem;
    }

    .stage-location-short {
        font-size: 0.6rem;
    }

    .carousel-controls {
        flex-direction: column;
        gap: 0.5rem !important;
    }

    .carousel-controls .btn-sm {
        width: 100%;
        min-width: auto;
    }

    .carousel-nav-arrow {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .stages-carousel-wrapper {
        padding: 1rem 0;
    }
}

@media (max-width: 576px) {
    .stages-carousel {
        padding: 1rem 40px;
        height: 150px;
    }

    .stage-card {
        width: 90px;
        height: 120px;
    }

    .stage-centered {
        width: 130px !important;
        height: 140px !important;
    }

    h1 {
        font-size: 1.25rem;
    }

    .carousel-nav-arrow {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }

    .carousel-nav-left {
        left: 5px;
    }

    .carousel-nav-right {
        right: 5px;
    }

    /* Модальное окно на мобильных */
    .modal-dialog {
        margin: 0.5rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .category-badge {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
}

/* ==================== АНИМАЦИИ ==================== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stage-card-wrapper {
    animation: slideIn 0.4s ease;
}

.stages-carousel-wrapper {
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ==================== ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ==================== */
.footer {
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    background: #ffffff;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button, .stage-card, .archive-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stage-card:focus-visible {
    outline: 2px solid #FFC107;
    outline-offset: 2px;
}

.stage-card * {
    transition: color 0.3s ease;
}

/* Плавное появление модального окна */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
}

.modal.show .modal-dialog {
    transform: scale(1);
}

/* Улучшенные кнопки в модальном окне */
.modal-footer .btn {
    min-width: 120px;
}
/* ==================== КАТЕГОРИИ (ОБНОВЛЕННЫЕ ЦВЕТА) ==================== */
.category-juniors,
.category-badge.category-juniors {
    border-left-color: #8B5CF6 !important;
}

.category-lightweight,
.category-badge.category-lightweight {
    border-left-color: #3B82F6 !important;
}

.category-heavyweight,
.category-badge.category-heavyweight {
    border-left-color: #DC2626 !important;
}

.category-35plus,
.category-badge.category-35plus {
    border-left-color: #F59E0B !important;
}

/* Стили для модального окна - категории */
.category-badge i {
    display: block;
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.category-badge div {
    font-size: 0.875rem;
}

/* Стили для страницы детального этапа */
.category-info-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid #ddd;
    transition: all 0.3s ease;
    text-align: center;
}

.category-info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.category-info-card i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.category-info-card h6 {
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #1F2937;
}

.category-count {
    font-size: 2.5rem;
    font-weight: bold;
    color: #1F2937;
    margin: 0.5rem 0;
}

/* ==================== СТРАНИЦА РЕГИСТРАЦИИ ==================== */
.category-option {
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f9fafb;
}

.category-option:hover {
    border-color: #FFC107;
    background: #fffbf0;
    transform: translateY(-2px);
}

.form-check-input:checked ~ .form-check-label .category-option {
    border-color: #FFC107;
    border-width: 3px;
    background: #fffbf0;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.category-option i {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.category-option strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
    color: #1F2937;
}

.category-radio {
    margin: 0;
}

.form-check-input[type="radio"] {
    display: none;
}

/* Flash messages */
.alert {
    border-radius: 10px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffecb5;
    color: #664d03;
}

.alert-error {
    background-color: #f8d7da;
    border-color: #f5c2c7;
    color: #842029;
}