/* ============================================
   GlobalSpeed - Buy Page Styles
   ============================================ */

/* Main Content */
.main-content {
    padding-top: 90px;
    padding-bottom: 60px;
}

/* Region Selection */
.region-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
}

.region-item {
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.region-item:hover {
    border-color: rgba(6, 182, 212, 0.5);
}

.region-item.active {
    border-color: var(--accent);
    background: rgba(6, 182, 212, 0.1);
}

.region-item .flag {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.region-item .code {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.region-item .name {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.region-item .price {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 600;
}

.region-item .price span {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: normal;
}

/* Bandwidth Control with Progress Bar */
.bandwidth-section {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.bandwidth-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.bandwidth-value {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent);
    min-width: 100px;
    text-align: center;
}

.bandwidth-unit {
    font-size: 1.25rem;
    color: var(--text-muted);
}

.bandwidth-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn-bandwidth {
    width: 60px;
    height: 36px;
    border-radius: 8px;
    background: rgba(6, 182, 212, 0.1);
    border: 2px solid rgba(6, 182, 212, 0.3);
    color: var(--accent);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-bandwidth:hover {
    background: rgba(6, 182, 212, 0.2);
    border-color: var(--accent);
}

.btn-bandwidth:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.bandwidth-progress-container {
    position: relative;
    padding: 0 0.5rem;
}

/* Bandwidth Progress Bar */
.bandwidth-progress-wrapper {
    position: relative;
    width: 100%;
    height: 12px;
    border-radius: 6px;
    overflow: visible;
}

.bandwidth-progress-bg {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 8px;
    background: rgba(15, 23, 42, 0.8);
    border-radius: 4px;
    border: 1px solid var(--border);
}

.bandwidth-progress-fill {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 8px;
    background: linear-gradient(90deg, var(--accent), #0891b2);
    border-radius: 4px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

.bandwidth-progress {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 100%;
    height: 24px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    outline: none;
    cursor: pointer;
    margin: 0;
}

.bandwidth-progress::-webkit-slider-track {
    height: 24px;
    background: transparent;
}

.bandwidth-progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.8), 0 0 30px rgba(6, 182, 212, 0.4);
    border: 3px solid #fff;
    transition: all 0.3s;
}

.bandwidth-progress::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 25px rgba(6, 182, 212, 1), 0 0 50px rgba(6, 182, 212, 0.6);
}

.bandwidth-progress::-moz-range-track {
    height: 24px;
    background: transparent;
}

.bandwidth-progress::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.8);
}

.bandwidth-marks {
    display: flex;
    justify-content: space-between;
    padding: 0 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.bandwidth-price-preview {
    text-align: center;
    padding: 1rem;
    background: rgba(6, 182, 212, 0.05);
    border-radius: 8px;
    margin-top: 1rem;
}

.bandwidth-price-preview .label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.bandwidth-price-preview .price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

/* Traffic Badge */
.traffic-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 20px;
    color: var(--success);
    font-weight: 600;
}

/* Period Options */
.period-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.period-option {
    position: relative;
}

.period-option input {
    position: absolute;
    opacity: 0;
}

.period-option label {
    display: block;
    padding: 0.75rem 1.25rem;
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text);
    margin-bottom: 0;
    font-weight: 500;
}

.period-option input:checked + label {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.period-option .discount {
    display: inline-block;
    margin-left: 0.25rem;
    padding: 0.125rem 0.5rem;
    background: #ef4444;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Guide Table */
.guide-table {
    width: 100%;
    font-size: 0.875rem;
    margin-bottom: 0;
}

.guide-table th,
.guide-table td {
    padding: 0.875rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.guide-table th {
    color: var(--text-muted);
    font-weight: 500;
    background: rgba(15, 23, 42, 0.6);
}

.guide-table tr {
    cursor: pointer;
    transition: all 0.3s;
}

.guide-table tr:hover {
    background: rgba(6, 182, 212, 0.05);
}

.guide-table tr.active td {
    background: rgba(6, 182, 212, 0.1);
    border-left: 3px solid var(--accent);
}

.guide-table .node-tag {
    padding: 0.25rem 0.75rem;
    background: var(--accent);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Summary Card */
.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.summary-row:last-of-type {
    border-bottom: none;
}

.summary-row .label {
    color: var(--text-muted);
}

.summary-row .value {
    font-weight: 500;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin: 1rem 0;
    border-top: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
}

.summary-total .label {
    font-weight: 600;
}

.summary-total .price {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.summary-total .price .currency {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}

.summary-total .price .amount {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
}

/* Agreement Box */
.agreement-box {
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.agreement-box .form-check-input {
    width: 18px;
    height: 18px;
    /*background-color: transparent;*/
    /*border-color: var(--border);*/
}

.agreement-box .form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

.agreement-box a {
    color: var(--accent);
}

.agreement-box.is-invalid {
    border: 1px solid var(--danger);
    border-radius: 8px;
}

.agreement-box .invalid-feedback {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 992px) {
    .region-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .region-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .period-options {
        justify-content: center;
    }

    .bandwidth-value {
        font-size: 2rem;
    }
}



/* 节点禁用状态 */
.region-item.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(0.8);
    pointer-events: none;
}

.node-disabled-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ff5722;
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

/* 节点错误提示 */
.node-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.node-error i {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
    color: #ff9800;
}

/* 推荐表格行高亮 */
.guide-table tbody tr.active {
    background: rgba(0, 212, 255, 0.1);
}

.guide-table tbody tr.active .node-tag {
    background: var(--accent);
    color: #fff;
}
