/**
 * Component Dependency UI Styles
 * Implements DESIGN_16: User-friendly error messages for missing features
 *
 * Styles for graceful degradation messages when components are unavailable
 */

/* AI Analysis Unavailable Notice */
.ai-analysis-unavailable-notice {
    position: absolute;
    top: -40px;
    right: 0;
    z-index: 1000;
    max-width: 300px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.ai-analysis-unavailable-notice .notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f0f8ff;
    border: 1px solid #cce7ff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    color: #1565c0;
    animation: slideInFromTop 0.3s ease-out;
}

.ai-analysis-unavailable-notice .notice-info {
    background: #f0f8ff;
    border-color: #cce7ff;
    color: #1565c0;
}

.ai-analysis-unavailable-notice .notice-warning {
    background: #fff8e1;
    border-color: #ffecb3;
    color: #ff8f00;
}

.ai-analysis-unavailable-notice .notice-error {
    background: #ffebee;
    border-color: #ffcdd2;
    color: #d32f2f;
}

.ai-analysis-unavailable-notice .icon-info-circle::before {
    content: "ℹ️";
    margin-right: 4px;
}

.ai-analysis-unavailable-notice .icon-warning::before {
    content: "⚠️";
    margin-right: 4px;
}

.ai-analysis-unavailable-notice .icon-error::before {
    content: "❌";
    margin-right: 4px;
}

.ai-analysis-unavailable-notice .notice-dismiss {
    background: none;
    border: none;
    font-size: 18px;
    color: inherit;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.ai-analysis-unavailable-notice .notice-dismiss:hover {
    opacity: 1;
}

.ai-analysis-unavailable-notice .notice-dismiss:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Component loading states */
.component-loading-notice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
}

.component-loading-notice .loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top: 2px solid #666;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Dependency timeout error */
.dependency-timeout-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: 4px;
    color: #d32f2f;
    font-size: 14px;
    margin: 8px 0;
}

.dependency-timeout-error .error-icon::before {
    content: "⚠️";
}

.dependency-timeout-error .retry-button {
    background: #d32f2f;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    margin-left: auto;
}

.dependency-timeout-error .retry-button:hover {
    background: #b71c1c;
}

/* Component status indicators */
.component-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.component-status-indicator.status-registered {
    background: #e8f5e8;
    color: #2e7d32;
}

.component-status-indicator.status-waiting {
    background: #fff8e1;
    color: #ff8f00;
}

.component-status-indicator.status-timeout {
    background: #ffebee;
    color: #d32f2f;
}

.component-status-indicator.status-error {
    background: #ffebee;
    color: #d32f2f;
}

/* Status indicator icons */
.component-status-indicator.status-registered::before {
    content: "✅";
}

.component-status-indicator.status-waiting::before {
    content: "⏳";
}

.component-status-indicator.status-timeout::before {
    content: "⏰";
}

.component-status-indicator.status-error::before {
    content: "❌";
}

/* Progressive enhancement message */
.progressive-enhancement-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 4px;
    color: #1976d2;
    font-size: 13px;
    margin: 8px 0;
}

.progressive-enhancement-notice .enhancement-icon::before {
    content: "🚀";
}

/* Animations */
@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ai-analysis-unavailable-notice {
        max-width: 250px;
        top: -35px;
    }

    .ai-analysis-unavailable-notice .notice {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ai-analysis-unavailable-notice .notice {
        border-width: 2px;
    }

    .component-status-indicator {
        border: 1px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .ai-analysis-unavailable-notice .notice {
        animation: none;
    }

    .component-loading-notice .loading-spinner {
        animation: none;
    }

    .component-loading-notice .loading-spinner::after {
        content: "Loading...";
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 10px;
    }
}

/* Print styles */
@media print {
    .ai-analysis-unavailable-notice,
    .component-loading-notice,
    .dependency-timeout-error {
        display: none;
    }
}