/* battle/modal-styles.css - Адаптивные стили для модальных окон */

/* ========================================
   БАЗОВЫЕ СТИЛИ МОДАЛОК
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
}

.modal-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 20px;
    border-radius: 12px;
    z-index: 1000;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
}

.modal-content {
    padding: 20px;
    max-width: 500px;
    background: #2c2c3d;
    border-radius: 10px;
    color: white;
    display: flex;
    flex-direction: column;
    max-height: calc(90vh - 40px);
}

.modal-header {
    margin-top: 0;
    color: #7289da;
    text-align: center;
    flex-shrink: 0;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 15px 0;
}

.modal-footer {
    flex-shrink: 0;
    padding-top: 15px;
}

/* ========================================
   LEADERBOARD - ТОП ИГРОКОВ
   ======================================== */

/* Двухколоночная раскладка */
.leaderboard-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 15px 0;
}

.leaderboard-top-players {
    background: #1a1a2e;
    padding: 15px;
    border-radius: 8px;
}

.leaderboard-player-stats {
    background: #3d3d5c;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #7289da;
}

.leaderboard-top-title {
    margin-top: 0;
    margin-bottom: 12px;
    color: #ffa500;
    text-align: center;
    font-size: 14px;
}

.leaderboard-stats-title {
    margin-top: 0;
    margin-bottom: 12px;
    color: #7289da;
    text-align: center;
    font-size: 14px;
}

.leaderboard-players-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leaderboard-player-card {
    background: #3d3d5c;
    padding: 8px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.leaderboard-player-card.top-1 {
    background: #3d3d5c;
    border-left: 3px solid #FFD700;
}

.leaderboard-player-card.top-2 {
    background: #3d3d5c;
    border-left: 3px solid #C0C0C0;
}

.leaderboard-player-card.top-3 {
    background: #3d3d5c;
    border-left: 3px solid #CD7F32;
}

.player-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 13px;
}

.stat-item {
    text-align: center;
    padding: 8px;
    background: #2c2c3d;
    border-radius: 6px;
}

.stat-label {
    color: #aaa;
    font-size: 11px;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 16px;
    font-weight: bold;
}

/* ========================================
   OPPONENT SELECTION - ВЫБОР ПРОТИВНИКА
   ======================================== */

/* Двухколоночная раскладка для противников */
.opponent-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 15px 0;
}

.opponent-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 5px;
}

.opponent-card {
    background: #3d3d5c;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    font-size: 13px;
}

.opponent-card:hover {
    border-color: #7289da;
    transform: scale(1.02);
}

.opponent-card:active {
    transform: scale(0.98);
}

/* Вертикальные кнопки */
.opponent-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.opponent-rating-display {
    background: #1a1a2e;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 10px;
}

/* ========================================
   МОБИЛЬНАЯ АДАПТАЦИЯ
   ======================================== */

@media (max-width: 768px) {
    .modal-container {
        max-width: 95vw;
        max-height: 90vh;
        padding: 10px;
    }

    .modal-content {
        padding: 12px;
        max-height: calc(90vh - 20px);
        max-width: 100%;
    }

    .modal-header {
        font-size: 16px;
        margin-bottom: 10px;
    }

    /* Двухколоночная раскладка сохраняется */
    .leaderboard-layout {
        gap: 10px;
    }

    .leaderboard-top-players,
    .leaderboard-player-stats {
        padding: 10px;
    }

    .leaderboard-top-title,
    .leaderboard-stats-title {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .leaderboard-player-card {
        padding: 6px;
        font-size: 11px;
    }

    .player-stats-grid {
        gap: 6px;
        font-size: 11px;
    }

    .stat-item {
        padding: 6px;
    }

    .stat-label {
        font-size: 10px;
    }

    .stat-value {
        font-size: 14px;
    }

    /* OPPONENT SELECTION - Двухколоночная раскладка */
    .opponent-layout {
        gap: 8px;
    }

    .opponent-list {
        max-height: 55vh;
        gap: 8px;
    }

    .opponent-card {
        padding: 10px;
        font-size: 12px;
    }

    /* Фиксированная кнопка закрытия */
    .modal-footer {
        position: sticky;
        bottom: 0;
        background: #2c2c3d;
        padding-top: 10px;
        margin-top: 10px;
        border-top: 1px solid #3d3d5c;
    }

    /* Скроллбар для мобильных */
    .modal-body::-webkit-scrollbar {
        width: 4px;
    }

    .modal-body::-webkit-scrollbar-track {
        background: #1a1a2e;
        border-radius: 4px;
    }

    .modal-body::-webkit-scrollbar-thumb {
        background: #7289da;
        border-radius: 4px;
    }

    .opponent-list::-webkit-scrollbar {
        width: 4px;
    }

    .opponent-list::-webkit-scrollbar-track {
        background: #1a1a2e;
        border-radius: 4px;
    }

    .opponent-list::-webkit-scrollbar-thumb {
        background: #7289da;
        border-radius: 4px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
    .modal-container {
        max-width: 98vw;
        max-height: 92vh;
        padding: 6px;
    }

    .modal-content {
        padding: 10px;
    }

    .modal-header {
        font-size: 14px;
    }

    .leaderboard-player-card {
        padding: 5px;
        font-size: 10px;
    }

    .opponent-card {
        padding: 8px;
        font-size: 11px;
    }

    .opponent-list {
        max-height: 50vh;
    }

    .stat-value {
        font-size: 12px;
    }
}

/* Горизонтальная ориентация (альбомная) */
@media (max-height: 500px) and (orientation: landscape) {
    .modal-container {
        max-height: 95vh;
    }

    .modal-content {
        max-height: calc(95vh - 12px);
    }

    .opponent-list {
        max-height: 45vh;
    }
}

/* ========================================
   УТИЛИТЫ
   ======================================== */

/* Плавная прокрутка */
.smooth-scroll {
    scroll-behavior: smooth;
}

/* Скрыть скроллбар но оставить прокрутку */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Кнопка модалки */
.modal-button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    background: #7289da;
    color: white;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s;
}

.modal-button:hover {
    background: #5b6eae;
}

.modal-button:active {
    transform: scale(0.98);
}

.modal-button.secondary {
    background: #555;
}

.modal-button.secondary:hover {
    background: #666;
}

@media (max-width: 480px) {
    .modal-button {
        padding: 10px;
        font-size: 14px;
    }
}
