﻿
.modern-gauge-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
    direction: ltr;
}

.modern-gauge {
    position: relative;
    width: 300px;
    height: 150px;
    margin-top: 35px; /* فضای کافی برای اعداد که حالا بیرون زده‌اند */
    /* overflow: hidden; از اینجا حذف شد تا اعداد بریده نشوند */
}

/* این کلاس جدید فقط دایره رنگی را به نیم‌دایره تبدیل می‌کند */
.gauge-background-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 300px;
    height: 150px;
    overflow: hidden;
}

.gauge-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: conic-gradient( from 270deg, #ff4d4d 0deg 36deg, #ffa64d 36deg 72deg, #ffcc00 72deg 108deg, #99e699 108deg 144deg, #33cc33 144deg 180deg, transparent 180deg 360deg );
}

    .gauge-background::after {
        content: '';
        position: absolute;
        top: 45px;
        left: 45px;
        width: 210px;
        height: 210px;
        background-color: #fff;
        border-radius: 50%;
    }

/* سایر استایل‌ها بدون تغییر می‌مانند */
.gauge-label {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform-origin: bottom center;
    width: 60px;
    height: 150px;
    margin-left: -30px;
    padding-top: 14px;
    box-sizing: border-box;
    text-align: center;
    font-size: 0.65rem;
    font-weight: 800;
    color: #2c3e50;
    z-index: 5;
}

.gauge-score {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 5;
}

.score-value {
    font-size: 2.5rem;
    font-weight: 900;
    color: #2c3e50;
}

.gauge-needle-container {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 20px;
    height: 150px;
    margin-left: -10px;
    transform-origin: bottom center;
    transition: transform 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.gauge-needle {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 130px;
    background-color: #34495e;
    border-radius: 4px 4px 0 0;
}

    .gauge-needle::after {
        content: '';
        position: absolute;
        bottom: -10px;
        left: 50%;
        transform: translateX(-50%);
        width: 20px;
        height: 20px;
        background-color: #2c3e50;
        border-radius: 50%;
        border: 3px solid #fff;
    }

.gauge-boundary {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 40px;
    margin-left: -20px;
    height: 175px;
    transform-origin: bottom center;
    text-align: center;
    color: #555;
    z-index: 4;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

    .gauge-boundary span {
        display: inline-block;
        font-size: 0.8rem;
        font-weight: bold;
    }
/* استایل‌های مخصوص موبایل */
@media (max-width: 600px) {
    .modern-gauge-wrapper {
        transform: scale(0.8); /* کل نمودار و اعداد را ۲۰ درصد کوچک‌تر می‌کند */
        transform-origin: center center;
        margin: 0.5rem 0; /* کاهش حاشیه برای جاگیری بهتر */
    }
}

@media (max-width: 380px) {
    .modern-gauge-wrapper {
        transform: scale(0.7); /* برای گوشی‌های خیلی کوچک */
    }
}
