/**
 * Enhanced Dynamic Animation Styles
 * Supports the new force-refresh animation system
 */

/* Operator Animation Styles */
.operator-animation-container {
    width: 100%;
    height: 100%;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.operator-interface {
    width: 95%;
    height: 95%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px;
    font-family: 'Rajdhani', sans-serif;
}

.interface-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.status-light {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
    animation: pulse 2s infinite;
}

.interface-title {
    font-weight: 600;
    color: white;
    font-size: 1.1rem;
}

.router-panel {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 12px;
}

.router-header {
    color: #a78bfa;
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.router-models {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.model-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.model-item.active {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
    animation: glow 2s infinite alternate;
}

.model-name {
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
}

.model-status {
    color: #10b981;
    font-size: 0.8rem;
}

.model-status.typing {
    color: #f59e0b;
    animation: pulse 1.5s infinite;
}

.router-metrics {
    display: flex;
    gap: 15px;
}

.metric {
    text-align: center;
}

.metric-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    margin-bottom: 4px;
}

.metric-value {
    color: #6366f1;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Coder Animation Styles */
.coder-animation-container {
    width: 100%;
    height: 100%;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-radius: 12px;
    overflow: hidden;
}

.code-editor {
    width: 95%;
    height: 95%;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Courier New', monospace;
    overflow: hidden;
}

.editor-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.editor-tabs {
    display: flex;
    gap: 1px;
}

.tab {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 12px;
    border-radius: 4px 4px 0 0;
    font-size: 0.8rem;
}

.tab.active {
    background: rgba(99, 102, 241, 0.2);
    color: white;
}

.editor-content {
    display: flex;
    height: calc(100% - 45px);
}

.line-numbers {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    line-height: 1.4;
    min-width: 30px;
    text-align: right;
}

.code-area {
    flex: 1;
    padding: 12px;
    color: white;
    font-size: 0.85rem;
    line-height: 1.4;
}

.code-line {
    margin-bottom: 2px;
}

.keyword { color: #c792ea; }
.module { color: #82aaff; }
.comment { color: #676e95; font-style: italic; }
.variable { color: #f78c6c; }
.operator { color: #89ddff; }
.function { color: #82aaff; }
.string { color: #c3e88d; }

.typing-line {
    animation: pulse 1.5s infinite;
}

.cursor {
    background: white;
    width: 2px;
    height: 14px;
    display: inline-block;
    animation: blink 1s infinite;
    margin-left: 2px;
}

.ai-suggestion {
    color: #f59e0b;
    font-style: italic;
    font-size: 0.8rem;
}

/* LLM Chat Animation Styles */
.llm-animation-container {
    width: 100%;
    height: 100%;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
    border-radius: 12px;
    overflow: hidden;
}

.chat-interface {
    width: 95%;
    height: 95%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    font-family: 'Rajdhani', sans-serif;
}

.chat-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.model-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-weight: 500;
}

.current-model {
    background: rgba(99, 102, 241, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.chat-messages {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

.message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.message.user {
    background: rgba(99, 102, 241, 0.2);
    color: white;
    align-self: flex-end;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.message.assistant {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    align-self: flex-start;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.message.assistant.typing {
    animation: pulse 2s infinite;
}

.chat-models {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 8px;
}

.model-chip {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.model-chip.active {
    background: rgba(99, 102, 241, 0.2);
    color: white;
    border-color: rgba(99, 102, 241, 0.3);
}

/* App Animation Styles */
.app-animation-container {
    width: 100%;
    height: 100%;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
    border-radius: 12px;
    overflow: hidden;
}

.app-interface {
    width: 95%;
    height: 95%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px;
    display: flex;
    flex-direction: column;
    font-family: 'Rajdhani', sans-serif;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.app-logo {
    font-weight: 700;
    font-size: 1.2rem;
    color: white;
}

.app-status {
    color: #10b981;
    font-size: 0.9rem;
    animation: pulse 2s infinite;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    flex: 1;
}

.app-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.app-card.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.3);
    transform: scale(1.05);
    animation: glow 2s infinite alternate;
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.card-title {
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Default Animation */
.default-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: white;
    font-family: 'Rajdhani', sans-serif;
}

.loading-text {
    font-size: 1.1rem;
    font-weight: 500;
    animation: pulse 2s infinite;
}

/* Light Mode Adjustments */
[data-theme="light"] .operator-interface,
[data-theme="light"] .chat-interface,
[data-theme="light"] .app-interface {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1e293b;
}

[data-theme="light"] .code-editor {
    background: rgba(0, 0, 0, 0.9);
}

[data-theme="light"] .interface-title,
[data-theme="light"] .model-name,
[data-theme="light"] .app-logo,
[data-theme="light"] .card-title,
[data-theme="light"] .current-model,
[data-theme="light"] .message.user,
[data-theme="light"] .message.assistant {
    color: #1e293b;
}

[data-theme="light"] .default-animation,
[data-theme="light"] .loading-text {
    color: #1e293b;
}

/* Keyframe Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(99, 102, 241, 0.5); }
    100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.8); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
