/* ===================================================
   AI Speed Doctor & Network Diagnostics
   =================================================== */

.ai-doctor-card {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(0, 242, 255, 0.25);
    border-radius: 20px;
    padding: 30px;
    margin: 35px auto;
    max-width: 820px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 242, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #e2e8f0;
    text-align: left;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.ai-doctor-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #00f2ff, #00ff88, #7000ff);
}

.ai-doctor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 15px;
}

.ai-doctor-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-doctor-title h3 {
    margin: 0;
    font-size: 1.4rem;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.ai-badge {
    background: linear-gradient(135deg, rgba(0, 242, 255, 0.2), rgba(112, 0, 255, 0.2));
    border: 1px solid #00f2ff;
    color: #00f2ff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ai-doctor-desc {
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Quick Topic Chips */
.ai-chips-container {
    margin-bottom: 20px;
}

.ai-chips-label {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-chips-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    padding: 8px 14px;
    border-radius: 25px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.ai-chip:hover, .ai-chip.active {
    background: rgba(0, 242, 255, 0.15);
    border-color: #00f2ff;
    color: #ffffff;
    transform: translateY(-1px);
}

.ai-doctor-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-ai-diagnose {
    background: linear-gradient(135deg, #00f2ff, #00aaff);
    color: #050b14;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 242, 255, 0.3);
}

.btn-ai-diagnose:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 242, 255, 0.5);
}

.btn-ai-diagnose:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* AI Diagnostics Output Box */
.ai-diagnosis-result {
    margin-top: 25px;
    background: rgba(2, 6, 23, 0.6);
    border: 1px solid rgba(0, 242, 255, 0.2);
    border-radius: 16px;
    padding: 22px;
    animation: fadeInAI 0.4s ease-out;
}

@keyframes fadeInAI {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-grade-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 16px;
}

.ai-grade-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-grade-letter {
    font-size: 1.8rem;
    font-weight: 900;
    line-height: 1;
    padding: 6px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
}

.ai-grade-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
}

.ai-diagnosis-summary {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #e2e8f0;
    margin-bottom: 18px;
    background: rgba(0, 242, 255, 0.04);
    border-left: 3px solid #00f2ff;
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
}

.ai-fixes-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #00ff88;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-fixes-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-fix-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #cbd5e1;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.ai-fix-num {
    background: rgba(0, 255, 136, 0.15);
    color: #00ff88;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.ai-source-tag {
    font-size: 0.75rem;
    color: #64748b;
    text-align: right;
    margin-top: 14px;
}

/* Loading state */
.ai-loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(5, 11, 20, 0.3);
    border-radius: 50%;
    border-top-color: #050b14;
    animation: spinAI 0.8s linear infinite;
}

@keyframes spinAI {
    to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
    .ai-doctor-card {
        padding: 20px;
        margin: 25px 10px;
    }
    .ai-doctor-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .btn-ai-diagnose {
        width: 100%;
        justify-content: center;
    }
}
