/* AI Trading Module Styles */
:root {
    --ai-primary: #6366f1;
    --ai-success: #10b981;
    --ai-danger: #ef4444;
    --ai-warning: #f59e0b;
    --ai-dark: #1f2937;
    --ai-darker: #111827;
    --ai-light: #f3f4f6;
    --ai-border: #374151;
}

.ai-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--ai-border);
}

.ai-title {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--ai-primary), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.ai-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-weight: 500;
    background: var(--ai-dark);
    color: var(--ai-light);
}

.ai-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ai-success);
    box-shadow: 0 0 10px var(--ai-success);
}

.ai-status-dot.inactive {
    background: var(--ai-danger);
    box-shadow: 0 0 10px var(--ai-danger);
}

.ai-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.ai-card {
    background: var(--ai-darker);
    border: 1px solid var(--ai-border);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ai-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.ai-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.ai-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ai-light);
    opacity: 0.9;
}

.ai-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin: 0.5rem 0;
}

.ai-card-change {
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    color: var(--ai-success);
}

.ai-card-change.negative {
    background: rgba(239, 68, 68, 0.1);
    color: var(--ai-danger);
}

/* Сигналы */
.ai-signals-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.ai-signals-table th {
    text-align: left;
    padding: 0.75rem;
    font-weight: 600;
    color: var(--ai-light);
    opacity: 0.7;
    border-bottom: 1px solid var(--ai-border);
}

.ai-signals-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--ai-border);
}

.ai-signal-buy {
    color: var(--ai-success);
    font-weight: 600;
}

.ai-signal-sell {
    color: var(--ai-danger);
    font-weight: 600;
}

.ai-confidence-bar {
    width: 100%;
    height: 6px;
    background: var(--ai-dark);
    border-radius: 3px;
    overflow: hidden;
}

.ai-confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ai-primary), #8b5cf6);
    border-radius: 3px;
}

/* Чат */
.ai-chat-container {
    background: var(--ai-darker);
    border: 1px solid var(--ai-border);
    border-radius: 1rem;
    overflow: hidden;
}

.ai-chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 1rem;
}

.ai-message {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 0.75rem;
    max-width: 80%;
}

.ai-message-user {
    background: var(--ai-primary);
    color: white;
    margin-left: auto;
}

.ai-message-ai {
    background: var(--ai-dark);
    color: var(--ai-light);
    margin-right: auto;
}

.ai-chat-input {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--ai-border);
}

.ai-chat-input input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--ai-border);
    border-radius: 0.5rem;
    background: var(--ai-dark);
    color: white;
}

.ai-chat-input button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    background: var(--ai-primary);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.ai-chat-input button:hover {
    background: #4f46e5;
}

/* Настройки */
.ai-settings-group {
    margin-bottom: 1.5rem;
}

.ai-settings-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--ai-light);
    font-weight: 500;
}

.ai-settings-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--ai-border);
    border-radius: 0.5rem;
    background: var(--ai-dark);
    color: white;
}

.ai-settings-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.ai-settings-checkbox input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    accent-color: var(--ai-primary);
}

.ai-button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    background: var(--ai-primary);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.ai-button:hover {
    background: #4f46e5;
}

.ai-button.secondary {
    background: var(--ai-dark);
    border: 1px solid var(--ai-border);
}

.ai-button.secondary:hover {
    background: var(--ai-border);
}

/* Анимации */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.ai-loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Адаптивность */
@media (max-width: 768px) {
    .ai-container {
        padding: 1rem;
    }
    
    .ai-grid {
        grid-template-columns: 1fr;
    }
    
    .ai-header {
        flex-direction: column;
        gap: 1rem;
        align-items: start;
    }
}