/**
 * VPN Purchase Styles
 * Стили для мультипротокольной системы покупки VPN
 */

/* =================== СЕКЦИИ =================== */

.protocol-content {
    margin-top: 0;
}

.vpn-section {
    margin-bottom: 16px;
}

/* Описание протокола */
.protocol-desc {
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: #16181C;
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 12px;
}

.protocol-desc__text {
    font-size: 13px;
    color: #8A8D93;
    line-height: 1.45;
    white-space: pre-line;
}

.vpn-section__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #DCDDE0;
    margin-bottom: 12px;
    padding-left: 4px;
}

.vpn-section__icon {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

/* =================== СЛАЙДЕР КЛИЕНТОВ =================== */

.clients-slider-container {
    background: #16181C;
    border-radius: 20px;
    padding: 8px 16px 14px 16px;
}

.clients-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.clients-slider-label {
    font-size: 14px;
    font-weight: 500;
    color: #B1B4B9;
}

.clients-slider-value {
    font-size: 28px;
    font-weight: 700;
    color: #DCDDE0;
    min-width: 50px;
    text-align: right;
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), color 0.15s ease;
}

.clients-slider-value.updating {
    transform: scale(1.15);
    color: #3A81EC;
}

.clients-slider-wrapper {
    position: relative;
    height: 32px;
    display: flex;
    align-items: center;
}

.clients-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 32px;
    background: transparent;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.clients-slider-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    transform: translateY(-50%);
    z-index: 1;
    overflow: hidden;
}

.clients-slider-fill {
    height: 100%;
    background: linear-gradient(90deg, #1E5BB8 0%, #3A81EC 50%, #5A9BF0 100%);
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(58, 129, 236, 0.4);
}

/* Стилизация ползунка для WebKit */
.clients-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #fff 0%, #e8e8e8 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), 0 0 0 2px rgba(58, 129, 236, 0.2);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .clients-slider::-webkit-slider-thumb:hover {
        transform: scale(1.12);
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(58, 129, 236, 0.3);
    }
}

.clients-slider::-webkit-slider-thumb:active {
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2), 0 0 0 4px rgba(58, 129, 236, 0.4);
}

/* Стилизация ползунка для Firefox */
.clients-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #fff 0%, #e8e8e8 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), 0 0 0 2px rgba(58, 129, 236, 0.2);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .clients-slider::-moz-range-thumb:hover {
        transform: scale(1.12);
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(58, 129, 236, 0.3);
    }
}

.clients-slider::-moz-range-track {
    background: transparent;
    border: none;
}


/* =================== СЕЛЕКТОР ЛОКАЦИЙ =================== */

.location-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding-bottom: 4px;
}

@media (min-width: 400px) {
    .location-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 500px) {
    .location-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.location-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #16181C;
    border: 2px solid transparent;
    border-radius: 14px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .location-item:hover {
        border-color: rgba(255, 255, 255, 0.1);
        background: #1D2025;
    }
}

.location-item:active {
    background: #1D2025;
}

.location-item--selected {
    border-color: #3A81EC;
    background: linear-gradient(135deg, rgba(58, 129, 236, 0.15), transparent);
}

.location-flag {
    font-size: 24px;
    line-height: 1;
}

.location-info {
    flex: 1;
    min-width: 0;
}

.location-name {
    font-size: 13px;
    font-weight: 600;
    color: #DCDDE0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.location-city {
    font-size: 11px;
    color: #B1B4B9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =================== ДОПОЛНЕНИЯ (АДДОНЫ) - АККОРДЕОН =================== */

.addons-accordion {
    background: #16181C;
    border-radius: 16px;
    overflow: hidden;
}

.addons-accordion__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    .addons-accordion__header:hover {
        background: rgba(255, 255, 255, 0.03);
    }
}

.addons-accordion__header:active {
    background: rgba(255, 255, 255, 0.05);
}

.addons-accordion__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #B1B4B9;
}

.addons-accordion__info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.addons-accordion__count {
    background: rgba(58, 129, 236, 0.15);
    color: #3A81EC;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.addons-accordion__arrow {
    color: #666;
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: rotate(180deg); /* По умолчанию открыто */
}

.addons-accordion__arrow--closed {
    transform: rotate(0deg);
}

.addons-accordion__content {
    overflow: hidden;
    transition: height 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    padding: 0;
}

.addons-accordion__content--closed {
    height: 0;
}

.addons-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.addon-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    border: none;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.addon-item:first-child {
    border-top: none;
}

.addon-item:last-child {
    padding-bottom: 12px;
}

@media (hover: hover) and (pointer: fine) {
    .addon-item:hover {
        background: rgba(255, 255, 255, 0.04);
    }
}

.addon-item:active {
    background: rgba(255, 255, 255, 0.06);
}

.addon-item--selected {
    background: rgba(75, 181, 67, 0.08);
}

/* Toggle switch */
.addon-toggle {
    position: relative;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.addon-toggle input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    z-index: 1;
    margin: 0;
}

.addon-toggle-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 22px;
    background: #2A2D32;
    border-radius: 11px;
    transition: background 0.2s ease;
}

.addon-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #666;
    border-radius: 50%;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.addon-toggle input:checked ~ .addon-toggle-track {
    background: #4BB543;
}

.addon-toggle input:checked ~ .addon-toggle-thumb {
    left: 20px;
    background: white;
}

.addon-info {
    flex: 1;
    min-width: 0;
}

.addon-name {
    font-size: 13px;
    font-weight: 500;
    color: #DCDDE0;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 6px;
}

.addon-info-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.addon-info-btn svg {
    margin-top: 3px;
}

@media (hover: hover) and (pointer: fine) {
    .addon-info-btn:hover {
        color: #3A81EC;
    }
}

.addon-info-btn:active {
    transform: scale(0.95);
}

/* Tooltip для info кнопки */
.addon-info-btn {
    position: relative;
    z-index: 1;
}

.addon-tooltip {
    position: fixed;
    background: #1D2025;
    color: #DCDDE0;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.4;
    white-space: normal;
    max-width: min(280px, calc(100vw - 20px));
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    z-index: 999999;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s;
}

.addon-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1D2025;
}

.addon-tooltip.visible {
    opacity: 1;
    visibility: visible;
}

.addon-desc {
    font-size: 11px;
    color: #666;
    line-height: 1.3;
    margin-top: 1px;
}

.addon-price {
    font-size: 14px;
    font-weight: 600;
    color: #4BB543;
    white-space: nowrap;
}

/* =================== RADIO ADDON GROUP =================== */

.addon-radio-group__title {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    padding: 8px 14px 4px;
}

.addon-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 4px 0;
    margin-bottom: 5px;
    border-radius: 15px;
}

.addon-radio-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    margin-bottom: 5px;
}

.addon-radio-item:first-child {
    border-top: none;
}

@media (hover: hover) and (pointer: fine) {
    .addon-radio-item:hover {
        background: rgba(255, 255, 255, 0.04);
    }
}

.addon-radio-item--selected {
    background: rgba(58, 129, 236, 0.08);
}

.addon-radio-mark {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.addon-radio-mark__outer {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease;
}

.addon-radio-item--selected .addon-radio-mark__outer {
    border-color: #3A81EC;
}

.addon-radio-mark__inner {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: transparent;
    transition: background 0.2s ease, transform 0.2s ease;
    transform: scale(0);
}

.addon-radio-mark__inner--active {
    background: #3A81EC;
    transform: scale(1);
}

/* =================== PURCHASE BAR =================== */

.purchase-bar {
    background: transparent;
    padding: 0;
}

.purchase-bar__info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.purchase-bar__price {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.purchase-bar__amount {
    font-size: 28px;
    font-weight: 700;
    color: #DCDDE0;
    line-height: 1;
}

.purchase-bar__currency {
    font-size: 16px;
    font-weight: 500;
    color: #B1B4B9;
}

.purchase-bar__details {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 13px;
    color: #666;
}

.purchase-bar__dot {
    color: #444;
}

.purchase-bar__badge {
    background: rgba(75, 181, 67, 0.15);
    color: #4BB543;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 4px;
}

.purchase-bar__button {
    width: 100%;
    background: transparent;
    color: #3A81EC;
    border: 1.5px solid #3A81EC;
    border-radius: 12px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .purchase-bar__button:hover {
        background: rgba(58, 129, 236, 0.1);
    }
}

.purchase-bar__button:active {
    background: rgba(58, 129, 236, 0.15);
}

.purchase-bar__button:active {
    transform: scale(0.98);
}

.purchase-bar__button:active {
    transform: translateY(0);
}

/* =================== LOADING STATE =================== */

.protocol-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    color: #B1B4B9;
    font-size: 14px;
}

/* =================== АНИМАЦИИ И ПЛАВНЫЕ ПЕРЕХОДЫ =================== */

/* Плавное появление/скрытие секций */
.vpn-section--hideable {
    transition: opacity 0.3s ease, transform 0.3s ease;
    will-change: opacity, transform;
}

.vpn-section--hidden {
    opacity: 0;
    height: 0;
    margin-bottom: 0 !important;
    pointer-events: none;
    transform: scale(0.98);
    position: absolute;
    visibility: hidden;
}

.vpn-section--visible {
    opacity: 1;
    transform: scale(1);
    position: relative;
    visibility: visible;
}


/* =================== АДАПТИВНОСТЬ =================== */

@media (max-width: 360px) {
    .clients-slider-container {
        padding: 16px;
    }

    .clients-slider-value {
        font-size: 28px;
    }

    .location-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .addon-item {
        padding: 12px 14px;
    }

    .purchase-bar {
        padding: 14px 16px;
    }

    .purchase-bar__amount {
        font-size: 24px;
    }

    .purchase-bar__button {
        padding: 12px 20px;
        font-size: 15px;
    }
}
