/* =======================================================
   VZEX NETSPEED STYLESHEET
   Строгий плоский минимализм в стиле VZEX Интернетометра
   ======================================================= */

.speedtest-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    position: relative;
    z-index: 1;
}

/* Верхний заголовок сервиса */
.speedtest-header {
    text-align: center;
    margin-bottom: 2rem;
}

.speedtest-title {
    font-family: 'Library3am', 'Inter', sans-serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-white, #fff);
    margin: 0;
    line-height: 1.1;
}

.speedtest-title span {
    color: var(--accent-red, #b71c1c);
}

/* Служебная строка статуса узла - жесткая трехколоночная сетка без дерганий */
.node-meta-bar {
    display: grid;
    grid-template-columns: minmax(280px, auto) 1fr 280px;
    align-items: center;
    background: #141414;
    border: 1px solid var(--border-dark, #222);
    padding: 12px 20px;
    margin-bottom: 1.75rem;
    box-sizing: border-box;
    min-height: 60px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--text-movie-desc, #adb5bd);
    white-space: nowrap;
}

/* Двойной стек IPv4 / IPv6 */
.meta-ip-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start !important;
    justify-content: center;
    gap: 4px;
}

.ip-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    font-size: 0.85rem;
    line-height: 1.2;
    text-align: left;
}

.ip-title {
    color: var(--text-movie-desc, #adb5bd);
    display: inline-block;
    width: 44px;
    min-width: 44px;
    text-align: left;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    user-select: none;
}

.ip-value {
    font-family: 'Roboto Mono', Consolas, monospace;
    font-variant-numeric: tabular-nums;
    color: var(--text-main, #fdf6ed);
    font-size: 0.88rem;
    letter-spacing: 0.3px;
    white-space: nowrap;
    text-align: left;
}

.ip-muted {
    color: #666 !important;
    font-weight: normal;
    font-family: 'Inter', sans-serif;
}

.meta-item-center {
    justify-content: center;
}

.meta-item-right {
    justify-content: flex-end;
}

.meta-item strong {
    color: var(--text-main, #fdf6ed);
    font-weight: 600;
}

#testStateText {
    display: inline-block;
    color: #ff5565;
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Главная сцена: Спидометр */
.speedtest-stage {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* Блок спидометра - плоский, строгий */
.gauge-card {
    background: #141414;
    border: 1px solid var(--border-dark, #222);
    border-radius: 0;
    padding: 2.2rem 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    box-sizing: border-box;
}

.gauge-svg-container {
    position: relative;
    width: 320px;
    height: 230px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gauge-svg {
    width: 100%;
    height: 100%;
}

/* Шкалы спидометра */
.gauge-track {
    fill: none;
    stroke: #242424;
    stroke-width: 10;
    stroke-linecap: butt;
}

.gauge-progress {
    fill: none;
    stroke: var(--accent-red, #b71c1c);
    stroke-width: 10;
    stroke-linecap: butt;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    opacity: 0;
    transition: stroke-dashoffset 0.15s ease-out, opacity 0.2s ease;
}

.gauge-ticks {
    fill: none;
    stroke: #444;
    stroke-width: 1.5;
}

.gauge-tick-label {
    fill: #666;
    font-size: 11px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    text-anchor: middle;
    user-select: none;
}

/* Центр спидометра */
.gauge-center-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -32%);
    text-align: center;
    width: 240px;
}

.gauge-phase-label {
    height: 20px;
    line-height: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-muted, #777);
    text-transform: uppercase;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    transition: color 0.2s ease;
}

.gauge-phase-label.active {
    color: #ff5565;
}

.gauge-value {
    font-size: 3.6rem;
    font-family: 'Inter', sans-serif;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: var(--text-white, #fff);
    letter-spacing: -1px;
}

.gauge-unit {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-movie-desc, #adb5bd);
    text-transform: uppercase;
    margin-top: 6px;
}

/* Кнопка запуска - строгий плоский стиль VZEX .btn-action */
.gauge-action-wrap {
    margin-top: 1.5rem;
    z-index: 2;
}

.btn-speedtest-start {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 240px;
    height: 48px;
    box-sizing: border-box;
    background: transparent;
    border: 2px solid var(--accent-red, #b71c1c);
    border-radius: 0;
    color: var(--accent-red, #b71c1c);
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.btn-speedtest-start:hover {
    background: var(--accent-red, #b71c1c);
    color: var(--text-white, #fff);
}

.btn-speedtest-start.running {
    background: #1a1a1a;
    border-color: #444;
    color: #888;
}

.btn-speedtest-start.running:hover {
    border-color: var(--accent-red, #b71c1c);
    color: #ff5565;
    background: #222;
}

/* Карточки 4-х измерительных приборов - строгий плоский стиль */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.metric-card {
    background: #141414;
    border: 1px solid var(--border-dark, #222);
    border-radius: 0;
    padding: 1.25rem;
    position: relative;
    transition: border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.metric-card.active-test {
    border-color: var(--accent-red, #b71c1c);
}

.metric-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.metric-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-movie-desc, #adb5bd);
}

.metric-icon {
    font-size: 1.1rem;
    opacity: 0.5;
}

.metric-value-wrap {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 0.75rem;
}

.metric-value {
    font-size: 2.2rem;
    font-family: 'Inter', sans-serif;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    color: var(--text-white, #fff);
    line-height: 1;
}

.metric-unit {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted, #777);
    text-transform: uppercase;
}

.metric-progress-track {
    width: 100%;
    height: 3px;
    background: #222;
    border-radius: 0;
    overflow: hidden;
    position: relative;
}

.metric-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent-red, #b71c1c);
    transition: width 0.15s ease;
}

/* Информационная панель в подвале сервиса */
.speedtest-details {
    margin-top: 2rem;
    background: #141414;
    border: 1px solid var(--border-dark, #222);
    border-radius: 0;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    font-size: 0.85rem;
    color: var(--text-muted, #777);
}

.details-specs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 25px;
}

.details-spec {
    display: flex;
    align-items: center;
    gap: 6px;
}

.details-spec span {
    color: var(--text-movie-desc, #adb5bd);
}

.details-spec strong {
    color: var(--text-main, #fdf6ed);
    font-weight: 600;
}

.details-spec a {
    color: var(--text-main, #fdf6ed);
    text-decoration: underline;
    transition: color 0.2s;
}

.details-spec a:hover {
    color: var(--accent-red, #b71c1c);
}

.details-action {
    flex-shrink: 0;
    width: 230px;
    display: flex;
    justify-content: flex-end;
}

/* Фиксированная кнопка без сдвигов верстки */
.btn-copy-result {
    width: 230px;
    height: 38px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid #333;
    border-radius: 0;
    color: var(--text-main, #fdf6ed);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.2s ease;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.btn-copy-result.visible {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.btn-copy-result:hover {
    background: rgba(183, 28, 28, 0.15);
    border-color: var(--accent-red, #b71c1c);
    color: #fff;
}

/* Отдельный информационный блок и блок конфиденциальности */
.speedtest-info-block {
    margin-top: 1.5rem;
    background: #141414;
    border: 1px solid var(--border-dark, #222);
    border-radius: 0;
    padding: 1.5rem 1.75rem;
    box-sizing: border-box;
}

.info-text {
    margin: 0 0 0.85rem 0;
    color: var(--text-movie-desc, #adb5bd);
    font-size: 0.95rem;
    line-height: 1.6;
}

.privacy-text {
    margin: 0;
    padding-top: 0.85rem;
    border-top: 1px solid #1f1f1f;
    color: #888;
    font-size: 0.88rem;
    line-height: 1.5;
}

/* Адаптивность для мобильных экранов */
@media (max-width: 900px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .node-meta-bar {
        grid-template-columns: 1fr;
        gap: 12px;
        min-height: auto;
    }
    .meta-item-center, .meta-item-right {
        justify-content: flex-start;
    }
    #testStateText {
        text-align: left;
    }
    .speedtest-details {
        flex-direction: column;
        align-items: flex-start;
    }
    .details-action {
        width: 100%;
        justify-content: flex-start;
    }
    .btn-copy-result {
        width: 100%;
    }
}

@media (max-width: 540px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    .btn-speedtest-start {
        width: 100%;
        min-width: 0;
    }
}
