@import url(resources/css/root.css);
@import url(resources/css/media-panel.css);
@import url(resources/css/reset.css);

body {
    background-color: var(--bg-grey);
    color: var(--c-white);
    font-family: var(--font-courier);
}

.dashboard {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--b-black-dark);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 0 30px var(--bs-black-transparent);
}

.device {
    width: 300px;
    height: 300px;
    margin: 100px;
    margin-left: 190px;
    position: relative;
}

.device-body {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--b-black-light);
    border: 8px solide var(--b-grey-dark);
    box-shadow: inset 0 0 15px var(--bs-black-opaque), 0 0 20px var(--bs-black-transparent);
    position: relative;
}

.scale {
    position: absolute;
    width: 90%;
    height: 90%;
    border-radius: 50%;
    top: 5%;
    left: 5%;
}

.mark {
    position: absolute;
    color: var(--c-white);
    font-size: 20px;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-110px) rotate(calc(-1 * var(--angle)));
    left: 50%;
    top: 50%;
}

.needle {
    position: absolute;
    width: 3px;
    height: 100px;
    bottom: 50%;
    left: 50%;
    transform-origin: 50% 100%;
    transform: rotate(-90deg);
    transition: transform 0.5s ease-out;
    z-index: 10;
}

.center {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--b-grey-light);
    border-radius: 50%;
    bottom: 50%;
    left: 50%;
    transform: translate(-50%, 50%);
    z-index: 20;
    box-shadow: 0 0 10px var(--bs-black-transparent);
}

.mileage {
    text-align: center;
    font-size: 24px;
}

.value {
    text-align: center;
    font-size: 24px;
    margin-top: 20px;
    font-family: var(--font-digital);
}

.speedometer .scale {
    background: conic-gradient(var(--b-grey-light-transparent) 0deg 180deg,
            transparent 180deg 360deg);
}

.speedometer .needle {
    background: var(--b-red);
    box-shadow: 0 0 5px var(-bs-red-opaque);
}

.speedometer .value {
    color: var(--c-green);
}

.speedometer .label {
    color: var(--c-white);
    font-size: 18px;
    font-family: var(--font-courier);
    margin-left: 70px;
}

.tachometer .label {
    color: var(--c-white);
    font-size: 18px;
    font-family: var(--font-courier);
    margin-left: 40px;
}

.tachometer .scale {
    background: conic-gradient(var(--b-red-transparent) 0deg 100deg,
            var(--b-grey-light-transparent) 100deg 180deg,
            transparent 180deg 360deg);
}

.tachometer .needle {
    background: var(--b-yellow);
    box-shadow: 0 0 5px var(--bs-yellow-opaque);
}

.tachometer .value {
    color: var(--b-yellow);
}

.device-indicator {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.display .label {
    padding: 10px;
    background: var(--b-grey-dark);
    border-radius: 5px;
    color: var(--b-grey-light);
    text-align: center;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.display .label:hover {
    background: var(--b-grey-light);
}

.current-gear {
    font-size: 42px;
    text-align: center;
    color: var(--c-green);
    text-shadow: 0 0 10px var(--ts-green-opaque);
    height: 60px;
    line-height: 60px;
    margin-top: 15px;
    font-family: var(--font-digital);
}

.device .label.active {
    background: var(--c-green);
    color: var(--b-black-light);
    box-shadow: 0 0 8px var(--bs-red-opaque);
}

.loading-indicator {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(167, 167, 167, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid #3498db;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-indicator.active {
    display: flex;
}

@media (max-width: 1800px) {
    .device {
        width: 250px;
        height: 250px;
        margin: 50px;
        margin-left: 140px;
    }

    .mark {
        font-size: 16px;
        transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-100px) rotate(calc(-1 * var(--angle)));
    }

    .value {
        font-size: 20px;
    }

    .needle {
        height: 90px;
    }

    .speedometer .label {
        font-size: 14px;
        margin-left: 50px;
    }

    .tachometer .label {
        font-size: 14px;
        margin-left: 30px;
    }
}

@media (max-width: 1425px) {
    .device {
        width: 200px;
        height: 200px;
        margin: 40px;
        margin-left: 100px;
    }

    .mark {
        font-size: 14px;
        transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-75px) rotate(calc(-1 * var(--angle)));
    }

    .value {
        font-size: 16px;
    }

    .needle {
        height: 65px;
    }

    .speedometer .label {
        font-size: 12px;
        margin-left: 50px;
    }

    .tachometer .label {
        font-size: 12px;
        margin-left: 30px;
    }
}

@media (max-width: 1120px) {
    .device {
        width: 150px;
        height: 150px;
        margin: 40px;
        margin-left: 60px;
    }

    .mark {
        font-size: 10px;
        transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-60px) rotate(calc(-1 * var(--angle)));
    }

    .value {
        font-size: 14px;
    }

    .needle {
        height: 50px;
    }

    .speedometer .label {
        font-size: 8px;
        margin-left: 40px;
    }

    .tachometer .label {
        font-size: 8px;
        margin-left: 30px;
    }

    .current-gear {
        font-size: 30px;
    }

    .display .label {
        padding: 5px;
    }
}

@media (max-width: 850px) {
    .device {
        width: 150px;
        height: 150px;
        margin: 40px;
        margin-left: 20px;
    }
}

@media (max-width: 725px) {
    .device {
        width: 100px;
        height: 100px;
        margin: 40px;
        margin-left: 20px;
    }

    .mark {
        font-size: 8px;
        transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-40px) rotate(calc(-1 * var(--angle)));
    }

    .value {
        font-size: 12px;
    }

    .needle {
        height: 30px;
    }

    .speedometer .label {
        font-size: 8px;
        margin-left: 20px;
    }

    .tachometer .label {
        font-size: 8px;
        margin-left: 0;
    }

    .current-gear {
        font-size: 24px;
    }

    .display .label {
        padding: 1px;
    }
}

@media (max-width: 580px) {
    .dashboard {
        gap: 0px;
    }

    .device {
        width: 100px;
        height: 100px;
        margin: 40px 10px 40px 5px;
    }
}

@media (max-width: 400px) {
    .device {
        width: 80px;
        height: 80px;
        margin: 10px 10px 40px 5px;
    }

    .mark {
        font-size: 6px;
        transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-30px) rotate(calc(-1 * var(--angle)));
    }

    .current-gear {
        font-size: 20px;
        margin-top: 0px;
    }
}