/* 运营商自动识别样式 */

/* 输入框验证状态 */
.form-group input[type="tel"].valid {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.form-group input[type="tel"].invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* 运营商显示容器 */
#operatorDisplay {
    margin-top: 15px;
    padding: 15px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 1px solid #dee2e6;
    display: none;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 识别成功的运营商 */
.operator-detected {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: white;
    border-radius: 10px;
    border: 1px solid #e8f5e8;
    position: relative;
    overflow: hidden;
}

.operator-detected::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #28a745, #20c997);
}

/* 未识别的运营商 */
.operator-unknown {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: white;
    border-radius: 10px;
    border: 1px solid #f8d7da;
    position: relative;
    overflow: hidden;
}

.operator-unknown::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #dc3545, #c82333);
}

/* 运营商头像 */
.operator-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
    position: relative;
    transition: all 0.3s ease;
}

.operator-avatar.viettel {
    background: linear-gradient(135deg, #ff4757, #ff3742);
}

.operator-avatar.vinaphone {
    background: linear-gradient(135deg, #3742fa, #2f3542);
}

.operator-avatar.mobifone {
    background: linear-gradient(135deg, #2ed573, #1e90ff);
}

.operator-avatar.vietnamobile {
    background: linear-gradient(135deg, #ffa502, #ff6348);
}

.operator-avatar.gmobile {
    background: linear-gradient(135deg, #ff7675, #fd79a8);
}

.operator-avatar.unknown {
    background: linear-gradient(135deg, #6c757d, #495057);
    font-size: 1.5em;
}

/* 运营商信息 */
.operator-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.operator-name {
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.1em;
}

.operator-prefix {
    font-size: 0.9em;
    color: #6c757d;
}

/* 识别状态 */
.detection-status {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 600;
    flex-shrink: 0;
}

.detection-status i {
    font-size: 1em;
}

.operator-detected .detection-status {
    background: #d4edda;
    color: #155724;
}

.operator-unknown .detection-status.error {
    background: #f8d7da;
    color: #721c24;
}

/* 脉冲动画效果 */
.operator-detected .operator-avatar::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    background: inherit;
    opacity: 0.3;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.1;
    }
    100% {
        transform: scale(1);
        opacity: 0.3;
    }
}

/* 支持的运营商列表显示 */
.supported-operators {
    margin-top: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.supported-operators h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 0.9em;
}

.operators-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.operator-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    background: white;
    border-radius: 15px;
    font-size: 0.8em;
    border: 1px solid #dee2e6;
    white-space: nowrap;
}

.operator-badge .mini-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6em;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}

.operator-badge .mini-avatar.viettel {
    background: linear-gradient(135deg, #ff4757, #ff3742);
}

.operator-badge .mini-avatar.vinaphone {
    background: linear-gradient(135deg, #3742fa, #2f3542);
}

.operator-badge .mini-avatar.mobifone {
    background: linear-gradient(135deg, #2ed573, #1e90ff);
}

.operator-badge .mini-avatar.vietnamobile {
    background: linear-gradient(135deg, #ffa502, #ff6348);
}

.operator-badge .mini-avatar.gmobile {
    background: linear-gradient(135deg, #ff7675, #fd79a8);
}

/* 号码格式提示 */
.phone-format-hint {
    margin-top: 8px;
    padding: 8px 12px;
    background: #e3f2fd;
    border-radius: 6px;
    font-size: 0.85em;
    color: #1976d2;
}

.phone-format-hint i {
    margin-right: 5px;
    color: #1976d2;
}

/* 移动端优化 */
@media (max-width: 768px) {
    #operatorDisplay {
        margin-top: 10px;
        padding: 12px;
    }
    
    .operator-detected,
    .operator-unknown {
        gap: 10px;
        padding: 8px;
    }
    
    .operator-avatar {
        width: 40px;
        height: 40px;
        font-size: 1em;
    }
    
    .operator-name {
        font-size: 1em;
    }
    
    .operator-prefix {
        font-size: 0.8em;
    }
    
    .detection-status {
        font-size: 0.75em;
        padding: 4px 8px;
    }
    
    .operators-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .operator-badge {
        font-size: 0.75em;
        padding: 4px 6px;
    }
}

@media (max-width: 480px) {
    .operator-detected,
    .operator-unknown {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .operator-info {
        align-items: center;
    }
    
    .detection-status {
        align-self: center;
    }
    
    .operators-list {
        grid-template-columns: 1fr;
    }
}

/* 加载状态 */
.operator-detecting {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: white;
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

.operator-detecting .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 输入验证提示 */
.input-validation {
    margin-top: 5px;
    font-size: 0.8em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.input-validation.valid {
    color: #28a745;
}

.input-validation.invalid {
    color: #dc3545;
}

.input-validation i {
    font-size: 0.9em;
} 