/**
 * Enhanced Dynamic System Styles
 * CSS for animated status indicators, model selector, and dynamic messaging
 */

/* Dynamic Status Indicator */
.dynamic-status-indicator {
    background: linear-gradient(135deg, rgba(0, 122, 204, 0.1), rgba(255, 215, 0, 0.05));
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.dynamic-status-indicator.processing {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 107, 53, 0.1));
    border-color: var(--vigthoria-gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
    animation: processingGlow 2s ease-in-out infinite;
}

@keyframes processingGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.2); }
    50% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.4); }
}

.status-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.status-main {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-icon {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.processing .status-icon {
    animation: statusIconPulse 1s ease-in-out infinite;
}

@keyframes statusIconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.status-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.status-animation {
    font-size: 16px;
    min-width: 20px;
    text-align: center;
    color: var(--vigthoria-gold);
}

.status-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    margin-left: 26px;
    opacity: 0.8;
}

.status-model {
    font-size: 10px;
    color: var(--vigthoria-gold);
    margin-left: 26px;
    font-weight: 500;
    background: rgba(255, 215, 0, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* Model Selector */
.model-selector-container {
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin: 12px 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.model-selector-header {
    display: flex;
    justify-content: between;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1), rgba(255, 215, 0, 0.1));
    border-bottom: 1px solid var(--border);
}

.model-selector-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.subscription-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.subscription-badge.basic {
    background: linear-gradient(135deg, #6b7280, #9ca3af);
    color: white;
}

.subscription-badge.professional {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
}

.subscription-badge.enterprise {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
}

.model-selector-content {
    padding: 12px;
}

.model-select {
    width: 100%;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.model-select:hover {
    border-color: var(--vigthoria-gold);
    background: rgba(255, 215, 0, 0.05);
}

.model-select:focus {
    outline: none;
    border-color: var(--vigthoria-gold);
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.2);
}

.model-info {
    margin-top: 8px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
    border-left: 2px solid var(--vigthoria-gold);
}

.model-description {
    font-size: 10px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Enhanced Thinking Indicator */
.thinking-indicator.enhanced {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 107, 53, 0.1));
    border: 1px solid var(--vigthoria-gold);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 8px 0;
    animation: thinkingEnhancedPulse 2s ease-in-out infinite;
}

@keyframes thinkingEnhancedPulse {
    0%, 100% { 
        opacity: 0.9; 
        transform: scale(1);
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
    }
    50% { 
        opacity: 1; 
        transform: scale(1.01);
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.4);
    }
}

.thinking-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.thinking-icon {
    font-size: 18px;
    animation: thinkingIconBounce 1.5s ease-in-out infinite;
}

@keyframes thinkingIconBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-3px); }
    60% { transform: translateY(-1px); }
}

.thinking-text {
    flex: 1;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
}

.thinking-dots {
    display: flex;
    gap: 3px;
}

.thinking-dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--vigthoria-gold);
    animation: thinkingDotPulse 1.4s ease-in-out infinite both;
}

.thinking-dots .dot:nth-child(1) { animation-delay: -0.32s; }
.thinking-dots .dot:nth-child(2) { animation-delay: -0.16s; }
.thinking-dots .dot:nth-child(3) { animation-delay: 0s; }

@keyframes thinkingDotPulse {
    0%, 80%, 100% { 
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% { 
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Mode Buttons Enhancement */
.mode-btn {
    position: relative;
    overflow: hidden;
}

.mode-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.2), transparent);
    transition: left 0.5s ease;
}

.mode-btn:hover::before {
    left: 100%;
}

.mode-btn.active {
    background: var(--vigthoria-gradient);
    color: #1a1a1a;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.mode-btn.active .mode-label {
    font-weight: 700;
}

/* Status Transitions */
.status-content * {
    transition: all 0.3s ease;
}

/* Processing Animation Variants */
.dynamic-status-indicator[data-mode="ask"].processing {
    background: linear-gradient(135deg, rgba(0, 122, 204, 0.15), rgba(59, 130, 246, 0.1));
    border-color: #007acc;
}

.dynamic-status-indicator[data-mode="build"].processing {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.15), rgba(255, 215, 0, 0.1));
    border-color: #ff6b35;
}

.dynamic-status-indicator[data-mode="agent"].processing {
    background: linear-gradient(135deg, rgba(137, 209, 133, 0.15), rgba(16, 185, 129, 0.1));
    border-color: #89d185;
}

.dynamic-status-indicator[data-mode="operator"].processing {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(251, 191, 36, 0.1));
    border-color: #ffd700;
}

/* Responsive Design */
@media (max-width: 400px) {
    .model-selector-header {
        flex-direction: column;
        gap: 6px;
        align-items: flex-start;
    }
    
    .status-main {
        flex-wrap: wrap;
    }
    
    .status-model {
        margin-left: 0;
        margin-top: 4px;
    }
}

/* Loading States */
.model-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.model-select option {
    background: var(--primary);
    color: var(--text-primary);
    padding: 4px;
}

/* Accessibility */
.model-selector-container:focus-within {
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.3);
}

.dynamic-status-indicator[aria-live="polite"] {
    outline: none;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .dynamic-status-indicator {
        background: linear-gradient(135deg, rgba(0, 122, 204, 0.08), rgba(255, 215, 0, 0.03));
    }
    
    .model-selector-container {
        background: rgba(0, 0, 0, 0.2);
    }
}
