/* =========================================
   PROGRESS MODAL
========================================= */

.progress-modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-progress-modal);

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 30px;

    opacity: 0;
    visibility: hidden;

    transition: var(--transition-slow);
}

.progress-modal.active {
    opacity: 1;
    visibility: visible;
}

.progress-modal__overlay {
    position: absolute;
    inset: 0;

    background: rgba(0, 0, 0, 0.45);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.progress-modal__card {
    position: relative;
    z-index: 2;

    width: min(1280px, 94vw);
    max-height: 88vh;

    overflow-y: auto;
    overflow-x: hidden;

    scrollbar-width: none;
    -ms-overflow-style: none;

    padding: 34px 38px 28px;

    border-radius: 28px;

    background: rgba(15, 18, 20, 0.76);

    border: 1px solid rgba(255, 255, 255, 0.14);

    box-shadow:
        0 35px 110px rgba(0, 0, 0, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);

    color: #fff;

    transform: translateY(25px) scale(0.97);
    opacity: 0;

    transition: var(--transition-slow);
}

.progress-modal__card::-webkit-scrollbar {
    display: none;
}

.progress-modal.active .progress-modal__card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.progress-modal__header {
    margin-bottom: 24px;
}

.progress-modal__header h2 {
    font-size: 30px;
    font-weight: 500;

    margin-bottom: 10px;
}

.progress-modal__header p {
    color: rgba(255, 255, 255, 0.68);
}

/* =========================================
   GRID
========================================= */

.progress-modal__grid {
    display: grid;

    grid-template-columns: 1.75fr 0.85fr 0.45fr 0.95fr;

    grid-template-areas:
        "main main donations donations"
        "milestones chart chart stats";

    gap: 20px;
    align-items: stretch;
}

.progress-big-card {
    grid-area: main;

    min-height: 215px;

    position: relative;

    display: flex;
    flex-direction: column;
    justify-content: center;

    padding-top: 30px;
}

.progress-circle-box {
    position: absolute;

    top: 26px;
    right: 44px;

    width: 110px;
    height: 110px;

    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-circle {
    position: absolute;
    inset: 0;

    border-radius: 50%;

    background:
        conic-gradient(
            #56c08d calc(var(--percent, 10) * 1%),
            rgba(255, 255, 255, 0.11) 0
        );

    -webkit-mask: radial-gradient(
        farthest-side,
        transparent calc(100% - 8px),
        #000 calc(100% - 7px)
    );

    mask: radial-gradient(
        farthest-side,
        transparent calc(100% - 8px),
        #000 calc(100% - 7px)
    );

    box-shadow: 0 0 20px rgba(86, 192, 141, 0.08);
}

.progress-circle__inner {
    position: relative;
    z-index: 2;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;
}

.progress-circle__inner strong { 
    display: block;

    font-size: 25px;
    font-weight: 500;
    line-height: 1;

    margin: 0;
}

.progress-circle__inner span {
    display: block;

    margin-top: 4px;

    font-size: 13px;
    font-weight: 400;

    color: rgba(255, 255, 255, 0.52);
}

.progress-donations-card {
    grid-area: donations;

    min-height: 215px;
}

.milestones-card {
    grid-area: milestones;
    min-height: 260px;
}

.chart-card {
    grid-area: chart;
    min-height: 260px;
}

.progress-stats-card {
    grid-area: stats;
    min-height: 260px;
}

.progress-big-card,
.progress-donations-card,
.milestones-card,
.chart-card,
.progress-stats-card,
.progress-modal__footer {
    background: rgba(255, 255, 255, 0.055);

    border: 1px solid rgba(255, 255, 255, 0.11);

    border-radius: 18px;

    padding: 22px 22px 18px;

    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* =========================================
   BIG PROGRESS CARD
========================================= */

.progress-label {
    display: block;

    color: rgba(255, 255, 255, 0.58);

    text-transform: uppercase;

    font-size: 13px;
    letter-spacing: 1px;

    margin-bottom: 12px;
}

.progress-big-card > strong {
    display: block;

    font-size: 40px;
    font-weight: 500;

    margin-bottom: 10px;
}

.progress-big-card p {
    color: rgba(255, 255, 255, 0.68);

    font-size: 20px;
}

.progress-modal-line {
    flex: 1;

    height: 12px;

    border-radius: 999px;

    background: rgba(255, 255, 255, 0.08);

    overflow: hidden;
}

.progress-progress-row {
    display: flex;
    align-items: center;

    gap: 14px;

    margin: 26px 0 6px;
}

.progress-line-value {
    font-size: 18px;
    font-weight: 500;

    color: #ffffff;

    flex-shrink: 0;
}

.progress-modal-line div {
    position: relative;
    z-index: 2;

    height: 100%;

    border-radius: 999px;

    background: linear-gradient(90deg, #2f7d5a, #56c08d);

    box-shadow: 0 0 20px rgba(86, 192, 141, 0.55);
}

.progress-modal-line div::before {
    content: "";

    position: absolute;

    left: 0;
    top: 50%;

    transform: translate(-18%, -50%);

    width: 18px;
    height: 18px;

    border-radius: 50%;

    background: #7effbc;

    box-shadow:
        0 0 10px rgba(126, 255, 188, 0.45),
        0 0 22px rgba(126, 255, 188, 0.16);

    opacity: 0.9;

    pointer-events: none;
}

.progress-left {
    text-align: right;

    color: rgba(255, 255, 255, 0.72);

    font-size: 15px;

    margin-top: 2px;
}

/* =========================================
   DONATIONS
========================================= */

.progress-card-title {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 12px;
}

.progress-card-title h3,
.milestones-card h3,
.chart-card h3,
.progress-stats-card h3 {
    font-size: 18px;
    font-weight: 500;
}

.progress-card-title span {
    color: rgba(255, 255, 255, 0.58);

    font-size: 14px;
}

.progress-donation-item {
    display: grid;

    grid-template-columns: 34px 1fr auto;

    align-items: center;

    gap: 10px;

    margin-bottom: 5px;
}

.progress-donation-avatar {
    width: 34px;
    height: 34px;

    border-radius: 50%;

    display: flex;
    justify-content: center;
    align-items: center;

    background: linear-gradient(135deg, #2f7d5a, #56c08d);

    font-size: 13px;
    font-weight: 700;
}

.progress-donation-item strong {
    display: block;

    font-size: 13px;

    font-weight: 500;

    line-height: 1.1;
}

.progress-donation-item p {
    color: rgba(255, 255, 255, 0.55);

    font-size: 11px;

    margin-top: 3px;

    line-height: 1.1;
}

.progress-donation-item > span {
    font-size: 14px;
    font-weight: 500;

    white-space: nowrap;
}

.progress-donation-item:last-child {
    margin-bottom: 0;
}

/* =========================================
   MILESTONES
========================================= */

.milestones-card {
    position: relative;

    display: flex;
    flex-direction: column;
}

.milestones-card h3 {
    margin-bottom: 32px;
}

.milestones {
    position: relative;

    display: grid;
    grid-template-columns: repeat(5, 1fr);

    gap: 0;

    margin-top: 4px;
}

.milestones::before {
    content: "";

    position: absolute;

    top: 21px;
    left: 9%;
    right: 9%;

    height: 1px;

    background: rgba(255, 255, 255, 0.06);

    z-index: 1;
}

.milestones::after {
    content: "";

    position: absolute;

    top: 21px;
    left: 9%;

    width: calc((100% - 18%) * (var(--milestones-line, 0) / 100));

    height: 2px;

    background: #56c08d;

    box-shadow: 0 0 14px rgba(86, 192, 141, 0.55);

    z-index: 1;
}

.milestone {
    position: relative;
    z-index: 3;

    display: flex;
    flex-direction: column;
    align-items: center;

    min-width: 0;

    color: rgba(255, 255, 255, 0.52);
}

.milestone-circle {
    position: relative;
    z-index: 4;

    width: 42px;
    height: 42px;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 26px;

    border: 1px solid rgba(255, 255, 255, 0.20);

    background: #222829;

    color: #ffffff;

    font-size: 17px;
    line-height: 1;

    box-shadow:
        0 0 0 5px rgba(0, 0, 0, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.milestone.done .milestone-circle {
    border-color: rgba(86, 192, 141, 0.9);

    background: linear-gradient(135deg, #43d886, #56c08d);

    color: #ffffff;

    box-shadow:
        0 0 0 5px rgba(86, 192, 141, 0.12),
        0 0 22px rgba(86, 192, 141, 0.42);
}

.milestone strong {
    display: block;

    margin-bottom: 12px;

    color: rgba(255, 255, 255, 0.92);

    font-size: 14px;
    font-weight: 500;
    line-height: 1.15;

    white-space: nowrap;
}

.milestone.done strong {
    color: var(--accent-color);
}

.milestone span {
    display: block;

    max-width: 86px;

    color: rgba(255, 255, 255, 0.55);

    font-size: 13px;
    line-height: 1.45;
    text-align: center;
}

.milestone.done span {
    color: rgba(86, 192, 141, 0.95);
}

.milestones-text {
    margin-top: auto;
    padding-top: 42px;

    color: rgba(255, 255, 255, 0.76);

    font-size: 18px;
    line-height: 1.55;
}

/* =========================================
   CHART
========================================= */

.chart-card {
    grid-area: chart;

    position: relative;

    min-height: 340px;

    overflow: hidden;
}

.chart-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;

    margin-bottom: 16px;
}

.chart-card__head h3 {
    font-size: 18px;
    font-weight: 500;
}

.chart-range-select {
    height: 40px;

    padding: 0 34px 0 14px;

    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.10);

    background-color: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.82);

    font-size: 13px;
    font-weight: 500;

    cursor: pointer;

    transition: var(--transition-medium);

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23DDE5E0' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 8px;
}

.chart-range-select:hover {
    border-color: rgba(86, 192, 141, 0.28);
    background-color: rgba(86, 192, 141, 0.05);
}


.chart-range-select:focus {
    outline: none;

    border-color: rgba(86, 192, 141, 0.55);

    box-shadow: 0 0 0 4px rgba(86, 192, 141, 0.08);
}

.chart-range-select option {
    background: #161b1d;
    color: #ffffff;
}

.chart-wrapper {
    position: relative;

    width: 100%;
    height: 290px;

    overflow: hidden;
}

#progressChart {
    width: 100% !important;
    height: 100% !important;
}

/* =========================================
   CHART AXIS POLISH
========================================= */

.chart-card canvas {
    image-rendering: auto;
}

.chart-card {
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.045) 0%,
            rgba(255, 255, 255, 0.03) 100%
        );
}

/* слегка усиливаем читаемость осей */

.chart-wrapper {
    position: relative;
}

.chart-wrapper::after {
    content: "";

    position: absolute;
    inset: 0;

    pointer-events: none;

    background:
        radial-gradient(
            circle at center,
            rgba(255, 255, 255, 0.025),
            transparent 72%
        );
}

/* =========================================
   STATS
========================================= */

.stat-row {
    display: flex;
    justify-content: space-between;

    padding: 12px 0;

    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}


.stat-row span {
    font-size: 14px;
    font-weight: 500;

    color: rgba(255, 255, 255, 0.50);
}

.stat-row strong {
    font-size: 15px;
    font-weight: 500;

    color: rgba(255, 255, 255, 0.98);

    text-shadow: 0 0 10px rgba(255, 255, 255, 0.04);
}

/* =========================================
   FOOTER
========================================= */

.progress-modal__footer {
    margin-top: 20px;

    min-height: 72px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;
}

.progress-modal__footer p {
    color: rgba(255, 255, 255, 0.78);

    font-size: 18px;
}

.progress-support-btn {
    min-width: 220px;
    height: 54px;

    border-radius: 16px;

    border: 1px solid rgba(52, 195, 124, 0.55);

    background: rgba(52, 195, 124, 0.08);

    color: var(--accent-color);

    font-size: 17px;

    cursor: pointer;

    transition: var(--transition-medium);
}

.progress-support-btn:hover {
    background: rgba(52, 195, 124, 0.18);

    transform: translateY(-2px);
}

/* =========================================
   ADAPTIVE
========================================= */

@media (max-width: 1100px) {
    .progress-modal__grid {
        grid-template-columns: 1fr 1fr;

        grid-template-areas:
            "main main"
            "donations donations"
            "milestones chart"
            "stats stats";
    }
}
/* =========================================
   MOBILE: PROGRESS MODAL LAYOUT
========================================= */

@media (max-width: 760px) {
    .progress-modal {
        padding: 14px;
    }

    .progress-modal__card {
        width: 100%;
        padding: 26px 18px;
    }

    .progress-modal__grid {
        grid-template-columns: 1fr;

        grid-template-areas:
            "main"
            "donations"
            "milestones"
            "chart"
            "stats";
    }

    .progress-modal__footer {
        flex-direction: column;
        align-items: stretch;
    }

    .progress-support-btn {
        width: 100%;
    }
}

/* =========================================
   MOBILE: PROGRESS BIG CARD POLISH
========================================= */

@media (max-width: 760px) {
    .progress-big-card {
        min-height: 220px;
        padding: 22px 22px 18px;
    }

    .progress-circle-box {
        top: 28px;
        right: 28px;
        width: 86px;
        height: 86px;
    }

    .progress-circle__inner strong {
        font-size: 20px;
    }

    .progress-circle__inner span {
        font-size: 11px;
        margin-top: 3px;
    }

    .progress-big-card > strong {
        font-size: 36px;
        line-height: 1.05;
        max-width: 220px;
    }

    .progress-big-card p {
        font-size: 18px;
        max-width: 220px;
    }

    .progress-progress-row {
        margin-top: 30px;
    }

    .progress-left {
        font-size: 14px;
        text-align: right;
    }
}

/* =========================================
   MOBILE: MILESTONES CARD POLISH
========================================= */

@media (max-width: 760px) {
    .milestones-card {
        min-height: 355px;
        padding: 24px 22px 24px;
        overflow: hidden;
    }

    .milestones-card h3 {
        margin-bottom: 34px;
        font-size: 18px;
    }

    .milestones {
        grid-template-columns: repeat(5, 1fr);
        gap: 0;
        margin-top: 0;
    }

    .milestones::before {
        top: 22px;
        left: 10%;
        right: 10%;
        height: 1px;
        background: rgba(255, 255, 255, 0.08);
    }

    .milestones::after {
        top: 22px;
        left: 10%;
        height: 2px;
    }

    .milestone-circle {
        width: 40px;
        height: 40px;
        margin-bottom: 22px;
        font-size: 18px;
    }

    .milestone.done .milestone-circle {
        box-shadow:
            0 0 0 7px rgba(86, 192, 141, 0.13),
            0 0 24px rgba(86, 192, 141, 0.38);
    }

    .milestone strong {
        font-size: 11px;
        line-height: 1.15;
        margin-bottom: 10px;
        white-space: nowrap;
        letter-spacing: -0.3px;
    }

    .milestone span {
        max-width: 54px;
        font-size: 11px;
        line-height: 1.35;
    }

    .milestones-text {
        margin-top: 38px;
        padding-top: 28px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        font-size: 17px;
        line-height: 1.55;
    }
}

@media (max-width: 760px) {
    .progress-modal__header h2 {
    font-size: 24px;
    line-height: 1.1;

    margin-bottom: 10px;

    white-space: nowrap;
    }

    .progress-modal__header p {
    font-size: 15px;
    line-height: 1.1;
    letter-spacing: -0.5px;
    }
}

/* =========================================
   ACCESSIBILITY / FOCUS
========================================= */

.progress-support-btn:focus-visible {
    outline: 1px solid rgba(86, 192, 141, 0.85);
    outline-offset: 4px;
}