/* Дополнительные стили для RAG семинара */

/* Плавные анимации */
* {
    scroll-behavior: smooth;
}

/* Кастомные цвета */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --error-color: #f56565;
}

/* Улучшенные карточки */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Анимированные кнопки */
.btn-animated {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

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

/* Код блоки */
.code-block {
    background: #2d3748;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    overflow-x: auto;
    position: relative;
}

.code-block::before {
    content: attr(data-lang);
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 12px;
    color: #a0aec0;
    text-transform: uppercase;
}

/* Syntax highlighting */
.code-keyword { color: #f093fb; }
.code-string { color: #68d391; }
.code-comment { color: #a0aec0; font-style: italic; }
.code-function { color: #90cdf4; }

/* Загрузка состояния */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

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

.notification.success { background-color: var(--success-color); }
.notification.error { background-color: var(--error-color); }
.notification.warning { background-color: var(--warning-color); }

/* Визуализации */
.chart-container {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin: 20px 0;
}

.chart-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
    color: #2d3748;
}

/* Интерактивные элементы */
.interactive-element {
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.interactive-element:hover {
    border-color: var(--primary-color);
    background-color: #f7fafc;
}

.interactive-element.active {
    border-color: var(--primary-color);
    background-color: #edf2f7;
    border-style: solid;
}

/* Форматирование результатов */
.result-success {
    background-color: #f0fff4;
    border: 1px solid #9ae6b4;
    color: #22543d;
    padding: 12px 16px;
    border-radius: 6px;
    margin: 8px 0;
}

.result-error {
    background-color: #fed7d7;
    border: 1px solid #fc8181;
    color: #742a2a;
    padding: 12px 16px;
    border-radius: 6px;
    margin: 8px 0;
}

/* Адаптивность */
@media (max-width: 640px) {
    .code-block {
        font-size: 12px;
        padding: 16px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        transform: translateY(-100px);
    }
    
    .notification.show {
        transform: translateY(0);
    }
    
    .chart-container {
        padding: 16px;
        margin: 16px 0;
    }
}

/* Специальные эффекты */
.glow-effect {
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 0 20px rgba(102, 126, 234, 0.3); }
    to { box-shadow: 0 0 30px rgba(102, 126, 234, 0.6); }
}

/* Тултипы */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #2d3748;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: 117%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #2d3748;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.tooltip:hover::before,
.tooltip:hover::after {
    opacity: 1;
}

/* Секции с фоном */
.section-bg-pattern {
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(118, 75, 162, 0.1) 0%, transparent 50%);
    background-size: 100px 100px;
}

/* Стрелки навигации */
.nav-arrow {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0;
    transform: translateY(100px);
}

.nav-arrow.show {
    opacity: 1;
    transform: translateY(0);
}

.nav-arrow:hover {
    background: var(--secondary-color);
    transform: translateY(-5px);
}

/* Печать */
@media print {
    .no-print {
        display: none !important;
    }
    
    .section-padding {
        padding: 2rem 1rem !important;
    }
    
    .bg-white {
        background: white !important;
    }
    
    * {
        box-shadow: none !important;
    }
}