/* AISell Light Theme Styles */

:root {
    --aisell-purple: #7c3aed;
    --aisell-purple-light: #f5f3ff;
    --aisell-purple-hover: #6d28d9;
    --aisell-bg: #f8fafc;
    --aisell-card-bg: #ffffff;
    --aisell-border: #e2e8f0;
    --aisell-text-main: #1e293b;
    --aisell-text-muted: #64748b;
}

body {
    background-color: #f8fafc;
    color: #1e293b;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Кастомный тонкий скроллбар для светлой темы */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Элементы активного пункта меню AISell */
.aisell-menu-active {
    background-color: #f5f3ff !important;
    color: #7c3aed !important;
    font-weight: 600;
    border-left: 3.5px solid #7c3aed;
}

/* Telegram Message Bubbles для светлой темы */
.tg-bubble-user {
    background: #7c3aed;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.tg-bubble-ai {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    border-bottom-left-radius: 4px;
}

.tg-bubble-operator {
    background: #059669;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

/* Анимация точек печатания */
.typing-dots span {
    animation: blink 1.4s infinite both;
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: #7c3aed;
    margin: 0 1.5px;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {
    0% {
        opacity: 0.2;
        transform: scale(0.8);
    }
    20% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: 0.2;
        transform: scale(0.8);
    }
}

/* Плавные переходы */
.tab-content {
    animation: fadeIn 0.15s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(3px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Пульсирующий индикатор онлайна */
.pulse-online {
    position: relative;
}
.pulse-online::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #10b981;
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    70% {
        transform: scale(1.8);
        opacity: 0;
    }
    100% {
        transform: scale(0.95);
        opacity: 0;
    }
}

/* Элегантные выпадающие списки в стиле AISell (без дублирования стрелок и кривых рамок) */
.aisell-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 0.9rem;
    padding-right: 2.25rem !important;
}

.aisell-select:focus {
    border-color: #7c3aed !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Плавные тултипы для графиков без обрезания и залипания на тач-устройствах */
.chart-bar-tooltip {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease-in-out;
}

.group:hover .chart-bar-tooltip {
    opacity: 1;
}

@media (hover: none) {
    .chart-bar-tooltip {
        display: none !important;
    }
}

/* Аккуратные ровные чекбоксы */
input[type="checkbox"] {
    accent-color: #7c3aed;
    cursor: pointer;
}

/* ==================== PATTERN: ABSTRACT TOPOGRAPHY ==================== */
.topography-canvas {
    background-color: #F0FDF4;
}

@keyframes topoBreathe {
    0%, 100% {
        stroke-opacity: var(--base-op, 0.06);
    }
    50% {
        stroke-opacity: calc(var(--base-op, 0.06) * 1.5);
    }
}

.topo-curve {
    fill: none;
    stroke: #16A34A;
    stroke-width: 0.85px;
    stroke-linecap: round;
    animation: topoBreathe 7s ease-in-out infinite;
}

/* ==================== АДАПТИВНАЯ ВЕРСТКА ДЛЯ ВСЕХ ЭКРАНОВ ==================== */
/* Предотвращает поломку верстки и расползание колонок при сужении экрана */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Фиксированная высота и защита от вертикального распирания шапки */
header.h-16 {
    min-height: 4rem !important;
    max-height: 4rem !important;
}

/* Предотвращение поломки текста баланса и элементов верхней панели */
#topbar-balance-display,
#topbar-company-dropdown,
#role-switcher-container {
    white-space: nowrap !important;
}

#topbar-balance-display * {
    white-space: nowrap !important;
}

@media (max-width: 1024px) {
    .responsive-split-view {
        flex-direction: column !important;
        overflow-y: auto !important;
        height: auto !important;
        min-height: calc(100vh - 4rem) !important;
        max-height: none !important;
    }
    .responsive-split-panel {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        height: auto !important;
        max-height: none !important;
        overflow-y: visible !important;
    }
}

.responsive-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* Гарантирует корректное отображение выпадающего меню профиля поверх всех элементов */
#topbar-profile-menu {
    max-height: 88vh;
    overflow-y: auto;
}

