/**
 * Smart GPU Suggestions Component Styles
 */

.gpu-suggestions-container {
    margin-top: 16px;
    margin-bottom: 16px;
}

.gpu-suggestions {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(79, 70, 229, 0.3);
    color: #e2e8f0;
}

.gpu-suggestions.loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
}

.gpu-suggestions.error {
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
    border-color: rgba(239, 68, 68, 0.5);
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Header */
.suggestions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestions-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.model-summary {
    font-size: 0.85rem;
    color: #94a3b8;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
}

/* Quick Recommendation */
.quick-recommendation {
    background: linear-gradient(135deg, #312e81 0%, #4338ca 100%);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.rec-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #000;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

.rec-content {
    flex: 1;
}

.rec-gpu {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.rec-details {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.rec-details span {
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.rec-strategy {
    color: #a5b4fc;
}

.rec-method {
    color: #86efac;
}

.rec-cost {
    color: #fcd34d;
    font-weight: 600;
}

.rec-explanation {
    font-size: 0.9rem;
    color: #c7d2fe;
    line-height: 1.5;
    white-space: pre-line;
}

/* All Suggestions Section */
.all-suggestions {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 12px;
}

.suggestions-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 10px 0;
    color: #94a3b8;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.suggestions-toggle:hover {
    color: #e2e8f0;
}

.toggle-icon {
    transition: transform 0.2s;
}

.all-suggestions.expanded .toggle-icon {
    transform: rotate(180deg);
}

.suggestions-list {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.all-suggestions.expanded .suggestions-list {
    display: grid;
}

/* Suggestion Cards */
.suggestion-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.suggestion-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.gpu-name {
    font-weight: 600;
    color: #fff;
    font-size: 0.95rem;
}

.level-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
    color: #fff;
    font-weight: 600;
}

.card-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    font-size: 0.8rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
}

.detail-row .label {
    color: #94a3b8;
}

.detail-row .value {
    color: #e2e8f0;
    font-weight: 500;
}

.card-warnings {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.card-warnings .warning {
    font-size: 0.75rem;
    color: #fbbf24;
    margin-bottom: 4px;
}

.apply-btn {
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

.apply-btn:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* Multimodal Placement */
.multimodal-placement {
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
    border-radius: 10px;
    padding: 16px;
    margin-top: 16px;
}

.multimodal-placement h5 {
    margin: 0 0 12px 0;
    font-size: 1rem;
    color: #fff;
}

.placement-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.placement-item {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 10px 14px;
    min-width: 140px;
}

.gpu-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: #5eead4;
    margin-bottom: 4px;
}

.model-info {
    font-size: 0.85rem;
    color: #fff;
}

/* Notification Toast */
.gpu-suggestion-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 14px 20px;
    border-radius: 8px;
    background: #1e293b;
    color: #fff;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    z-index: 9999;
}

.gpu-suggestion-notification.show {
    transform: translateX(0);
}

.gpu-suggestion-notification.success {
    background: linear-gradient(135deg, #047857 0%, #10b981 100%);
}

.gpu-suggestion-notification.error {
    background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%);
}

/* Responsive */
@media (max-width: 768px) {
    .suggestions-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .quick-recommendation {
        flex-direction: column;
    }
    
    .rec-badge {
        align-self: flex-start;
    }
    
    .suggestions-list {
        grid-template-columns: 1fr;
    }
    
    .card-details {
        grid-template-columns: 1fr;
    }
}

/* Connection Type Indicator */
.connection-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.connection-badge.nvlink {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #fff;
}

.connection-badge.pcie {
    background: rgba(100, 116, 139, 0.5);
    color: #cbd5e1;
}

/* Strategy Icons */
.strategy-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-right: 6px;
}

.strategy-icon.ddp { background: #3b82f6; }
.strategy-icon.fsdp { background: #8b5cf6; }
.strategy-icon.zero { background: #ec4899; }
.strategy-icon.split { background: #14b8a6; }

/* Strategy Badge */
.strategy-badge {
    display: inline-block;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.3) 0%, rgba(99, 102, 241, 0.3) 100%);
    border: 1px solid rgba(99, 102, 241, 0.5);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #a5b4fc;
    margin-bottom: 10px;
    cursor: help;
}

/* Strategy Description */
.strategy-description {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 8px 10px;
    margin-top: 8px;
    font-size: 0.75rem;
    color: #94a3b8;
    line-height: 1.4;
}

/* Card Actions */
.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.card-actions .apply-btn {
    flex: 1;
    margin-top: 0;
}

.config-btn {
    padding: 8px 12px;
    background: rgba(99, 102, 241, 0.3);
    border: 1px solid rgba(99, 102, 241, 0.5);
    border-radius: 6px;
    color: #a5b4fc;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.config-btn:hover {
    background: rgba(99, 102, 241, 0.5);
}

/* Config Modal */
.config-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.config-modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(79, 70, 229, 0.5);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.config-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.config-modal-header h4 {
    margin: 0;
    color: #fff;
    font-size: 1.1rem;
}

.config-modal-header .close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.config-modal-header .close-btn:hover {
    color: #fff;
}

.config-modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 60px);
}

.config-modal-body p {
    color: #94a3b8;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.config-modal-body code {
    background: rgba(99, 102, 241, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    color: #a5b4fc;
    font-family: 'Fira Code', monospace;
}

.config-content {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 16px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.85rem;
    color: #10b981;
    white-space: pre-wrap;
    overflow-x: auto;
    margin-bottom: 16px;
    line-height: 1.6;
}

.copy-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

.copy-btn:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* 5 Strategy Colors */
.strategy-ddp { border-color: #3b82f6 !important; }
.strategy-fsdp { border-color: #8b5cf6 !important; }
.strategy-zero2 { border-color: #f59e0b !important; }
.strategy-zero3 { border-color: #ec4899 !important; }
.strategy-multimodal_split { border-color: #14b8a6 !important; }

