/* ========================
   УПРАВЛЕНИЕ КАРТОЙ ЗАДАНИЙ
   ======================== */

/* Шапка и легенда */
.map-page-header {
    text-align: center;
    margin-bottom: 30px;
}

.map-status-legend {
    font-size: 14px;
    color: #E5E7EB;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.status-dot.green {
    background: #22C55E;
}

.status-dot.red {
    background: #EF4444;
}

.separator {
    color: #6B7280;
}

.align-left {
    text-align: left;
}

.text-center {
    text-align: center;
}

/* Основная сетка: Карта + Сектора */
.map-tasks-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
    padding: 0px 16px;
}

/* Сетка планет */
.planets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}



.am-planet-card {
    background: #3B3B46;
    border-radius: 8px;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
}

.am-planet-card img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.am-planet-card p {
    font-size: 13px;
    font-weight: 700;
    color: #FFF;
    line-height: 1.2;
}

.am-dots {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Правая панель (Задания по секторам) */
.am-tasks-panel {
    background: #3B3B46;
    border-radius: 12px;
    padding: 20px;
}

.am-create-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid #FFF;
    color: #FFF;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: 0.3s;
}

.am-create-btn:hover {
    background: #FFF;
    color: #181820;
}

.am-sector-title {
    font-size: 18px;
    font-weight: 700;
    color: #FFF;
    text-align: center;
    padding: 15px 0px;
}

/* Карточка задания (универсальная) */
.am-task-card {
    background: #181820;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
}

.am-task-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.am-task-actions button {
    background: none;
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: Inter;
    font-weight: 700;
    font-style: Bold;
    font-size: 15px;

}

.am-task-actions button:hover {
    color: #FFF;
}

.restore-btn {
    color: #FFF !important;
}

.am-task-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    color: #FFF;
}

.am-tt-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
}

.am-task-body {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.am-task-desc {
    font-size: 13px;
    color: #E5E7EB;
    margin-bottom: 10px;
}

.am-task-reward {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #FFF;
}

.am-task-reward img {
    width: 20px;
    height: 20px;
}

/* Сетка удаленных заданий */
.am-deleted-grid {
    display: grid;
    gap: 15px;
    margin-bottom: 15px;
    padding: 0px 16px;
}

.am-deleted-grid .am-task-card {
    background: #3B3B46;
    /* Удаленные карточки серые */
    margin-bottom: 0;
}

.am-show-all {
    text-align: right;
    padding: 0px 16px;
}

.am-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.am-show-all a {
    color: #A0AAB5;
    text-decoration: underline;
    font-size: 14px;
}

/* ЗАДАНИЯ НА ПРОВЕРКУ */
.am-review-panel {
    background: #23232D;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.am-review-title {
    font-size: 18px;
    font-weight: 700;
    color: #FFF;
    margin-bottom: 25px;
}

.am-review-card {
    background: #3B3B46;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 20px;
}

.am-rv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}



.am-rv-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    color: #FFF;
    font-weight: 500;
}

.am-rv-body {
    margin-left: 26px;
    /* Отступ под стрелочкой */
}

.am-rv-desc {
    font-size: 14px;
    color: #FFF;
    margin-bottom: 10px;
}

.am-rv-reward {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #FFF;
    margin-bottom: 20px;
}

.am-rv-meta p {
    font-size: 13px;
    color: #E5E7EB;
    margin-bottom: 6px;
}

.am-rv-meta strong {
    color: #FFF;
}

.am-download-link {
    color: #E5E7EB;
    margin-left: 5px;
}

.am-rv-comment-box {
    margin-top: 20px;
}

.am-rv-comment-box label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #FFF;
    margin-bottom: 10px;
}

.am-rv-comment-box textarea {
    width: 100%;
    height: 60px;
    background: #A0AAB5;
    border: none;
    border-radius: 6px;
    padding: 12px;
    color: #111;
    font-family: 'Inter', sans-serif;
    resize: none;
    margin-bottom: 20px;
}

.am-rv-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-accept {
    padding: 10px 25px;
    background: transparent;
    border: 1px solid #FFF;
    border-radius: 100px;
    color: #FFF;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.3s;
}

.btn-accept:hover {
    background: #FFF;
    color: #181820;
}

.btn-reject {
    background: none;
    border: none;
    color: #FFF;
    text-decoration: underline;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    cursor: pointer;
}

.btn-reject:hover {
    color: #A0AAB5;
}

.am-rv-header {
    cursor: pointer;
    user-select: none;
    /* Чтобы текст не выделялся при быстром клике */
}

.am-rv-body {
    padding-top: 10px;
}

/* ========================
   АДАПТИВ (МАКС 900px)
   ======================== */
@media (max-width: 900px) {
    .map-tasks-container {
        grid-template-columns: 1fr;
        /* Одна колонка на мобилке */
        gap: 40px;
    }

    .planets-grid {
        grid-template-columns: repeat(3, 1fr);
        /* На мобилке тоже 3 планеты в ряд */
        gap: 10px;
    }

    .am-planet-card {
        padding: 15px 5px;
    }

    .am-planet-card img {
        width: 45px;
        height: 45px;
    }

    .am-planet-card p {
        font-size: 11px;
    }

    .am-deleted-grid {
        grid-template-columns: 1fr;
        /* Удаленные в одну колонку */
    }

    .am-rv-body {
        margin-left: 0;
    }

    .am-review-panel {
        padding: 20px 15px;
    }

    .am-review-card {
        padding: 15px;
    }

    .am-rv-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .btn-accept {
        width: 100%;
    }
}

@media (max-width: 900px) {
    .planets-grid {
        display: grid;
        gap: 10px;
        grid-template-columns: none;
        grid-template-rows: 1fr;
        grid-auto-flow: column;

        /* Более надежная формула для Safari/Chrome */
        grid-auto-columns: calc(33.333% - 6.66px);

        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 10px;
    }

    .planets-grid::-webkit-scrollbar {
        display: none;
    }

    .am-planet-card {
        scroll-snap-align: start;
        padding: 15px 5px;

        /* МАГИЯ ЗДЕСЬ: заставляем карточку сжиматься, даже если контент внутри длинный */
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .am-planet-card img {
        width: 45px;
        height: 45px;
        /* Чтобы картинка тоже не распирала блок */
        max-width: 100%;
    }

    .am-planet-card p {
        font-size: 11px;
        width: 100%;

        /* Заставляем длинный текст переноситься или ломаться на новые строки */
        white-space: normal;
        word-break: break-word;
        text-align: center;

        /* Если нужно ограничить по высоте, чтобы карточки были ровными */
        line-height: 1.2;
    }
}