/* ============================================
   АТРИ АССИСТЕНТ - СТИЛИ ЧАТА
   ============================================ */

/* Кнопка вызова Атри - теперь использует существующий atri-guide */
.atri-guide.logged-in {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto;
}

.atri-guide.logged-in .atri-bubble {
    display: none !important;
}

.atri-guide.logged-in .atri-character {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: block !important;
    opacity: 1 !important;
    animation: atri-float 3s ease-in-out infinite;
}

.atri-guide.logged-in .atri-character:hover {
    transform: translateY(-10px) scale(1.1);
    animation: none;
}

/* Круглое свечение для .atri-pixel-glow */
.atri-guide.logged-in .atri-pixel-glow {
    border-radius: 50% !important;
    transition: all 0.3s ease;
}

.atri-guide.logged-in .atri-character:hover .atri-pixel-glow {
    background: radial-gradient(circle, rgba(0, 212, 255, 0.4) 0%, rgba(0, 212, 255, 0.2) 40%, transparent 70%) !important;
    box-shadow: 
        0 0 40px rgba(0, 212, 255, 0.8),
        0 0 80px rgba(0, 212, 255, 0.5),
        inset 0 0 30px rgba(0, 212, 255, 0.3);
    transform: translate(-50%, -50%) scale(1.2);
}

/* Круглое свечение для самой картинки */
.atri-guide.logged-in .atri-image {
    border-radius: 50%;
    transition: all 0.3s ease;
}

.atri-guide.logged-in .atri-character:hover .atri-image {
    filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.8)) 
            drop-shadow(0 0 40px rgba(0, 212, 255, 0.5))
            brightness(1.2);
}

.atri-guide.logged-in .atri-character::after {
    content: '💬';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 24px;
    animation: atri-badge-bounce 0.5s ease;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Модальное окно чата */
.atri-chat-modal {
    position: fixed;
    bottom: 180px;
    left: 30px;
    width: 420px;
    height: 600px;
    background: linear-gradient(135deg, #001122 0%, #002233 100%);
    border: 3px solid rgba(0, 212, 255, 0.5);
    border-radius: 20px;
    box-shadow: 
        0 0 40px rgba(0, 212, 255, 0.3),
        0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: atri-modal-appear 0.3s ease;
}

.atri-chat-modal.active {
    display: flex;
}

/* Хедер чата */
.atri-chat-header {
    background: linear-gradient(135deg, #003355 0%, #004466 100%);
    padding: 20px;
    border-bottom: 2px solid rgba(0, 212, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.atri-chat-header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%,
        #00d4ff 50%,
        transparent 100%);
    animation: atri-line-scan 2s linear infinite;
}

.atri-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.atri-header-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid rgba(0, 212, 255, 0.5);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.atri-header-text h3 {
    margin: 0;
    font-family: 'Press Start 2P', cursive;
    font-size: 14px;
    color: #00d4ff;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.atri-header-text p {
    margin: 4px 0 0 0;
    font-size: 11px;
    color: #66ccff;
    font-family: 'JetBrains Mono', monospace;
}

.atri-status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #00ff88;
    border-radius: 50%;
    margin-right: 5px;
    animation: atri-status-blink 2s infinite;
    box-shadow: 0 0 8px #00ff88;
}

.atri-header-actions {
    display: flex;
    gap: 8px;
}

.atri-header-button {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    color: #00d4ff;
    width: 35px;
    height: 35px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.atri-header-button:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: #00d4ff;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.atri-header-button i {
    font-size: 14px;
}

/* Область сообщений */
.atri-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #001122;
    position: relative;
}

.atri-chat-messages::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            0deg,
            rgba(0, 212, 255, 0.02) 0px,
            transparent 1px,
            transparent 2px,
            rgba(0, 212, 255, 0.02) 3px
        );
    pointer-events: none;
}

.atri-chat-messages::-webkit-scrollbar {
    width: 8px;
}

.atri-chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.atri-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.3);
    border-radius: 4px;
    border: 1px solid rgba(0, 212, 255, 0.5);
}

.atri-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.5);
}

/* Сообщения */
.atri-message {
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
    animation: atri-message-appear 0.3s ease;
}

.atri-message.user {
    flex-direction: row-reverse;
}

.atri-message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(0, 212, 255, 0.3);
    background: #002233;
    display: flex;
    align-items: center;
    justify-content: center;
}

.atri-message-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.atri-message-avatar i {
    color: #00d4ff;
    font-size: 16px;
}

.atri-message-content {
    max-width: 75%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.atri-message.user .atri-message-content {
    align-items: flex-end;
}

.atri-message-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    position: relative;
    word-wrap: break-word;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.atri-message.assistant .atri-message-bubble {
    background: linear-gradient(135deg, #003355 0%, #004466 100%);
    border: 1px solid rgba(0, 212, 255, 0.3);
    color: #e0f7ff;
    border-top-left-radius: 4px;
}

.atri-message.user .atri-message-bubble {
    background: linear-gradient(135deg, #00d4ff 0%, #0099ff 100%);
    color: #001122;
    border-top-right-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.atri-message-time {
    font-size: 10px;
    color: #66ccff;
    font-family: 'JetBrains Mono', monospace;
    opacity: 0.7;
}

.atri-message.user .atri-message-time {
    color: #00d4ff;
}

/* Markdown в сообщениях */
.atri-message-bubble strong {
    color: #00ff88;
    font-weight: bold;
}

.atri-message-bubble em {
    color: #ffaa00;
    font-style: italic;
}

.atri-message-bubble code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    color: #ff88ff;
    border: 1px solid rgba(255, 136, 255, 0.3);
}

.atri-message-bubble a {
    color: #00d4ff;
    text-decoration: underline;
}

.atri-message-bubble a:hover {
    color: #00ffff;
}

/* Индикатор печатания */
.atri-typing-indicator {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.atri-typing-indicator.active {
    display: flex;
}

.atri-typing-dots {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #003355 0%, #004466 100%);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    border-top-left-radius: 4px;
}

.atri-typing-dot {
    width: 8px;
    height: 8px;
    background: #00d4ff;
    border-radius: 50%;
    animation: atri-typing 1.4s infinite;
    box-shadow: 0 0 5px rgba(0, 212, 255, 0.5);
}

.atri-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.atri-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* Форма ввода */
.atri-chat-input {
    background: #002233;
    border-top: 2px solid rgba(0, 212, 255, 0.3);
    padding: 15px 20px;
}

.atri-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.atri-input-container {
    flex: 1;
    position: relative;
}

.atri-input-field {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    color: #e0f7ff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    resize: none;
    min-height: 45px;
    max-height: 120px;
    transition: all 0.2s ease;
}

.atri-input-field:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.atri-input-field::placeholder {
    color: #66ccff;
    opacity: 0.5;
}

.atri-send-button {
    background: linear-gradient(135deg, #00d4ff 0%, #0099ff 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.atri-send-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.4);
}

.atri-send-button:active:not(:disabled) {
    transform: translateY(0);
}

.atri-send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.atri-send-button i {
    color: #001122;
    font-size: 16px;
}

/* Приветственное сообщение */
.atri-welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: #66ccff;
}

.atri-welcome-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px auto;
    animation: atri-float 3s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(138, 43, 226, 0.2));
    border-radius: 20px;
    border: 2px solid rgba(0, 212, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

.atri-welcome-icon svg {
    width: 50px;
    height: 50px;
    color: #00d4ff;
    filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.6));
}

.atri-welcome-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 16px;
    color: #00d4ff;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.atri-welcome-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.8;
    color: #66ccff;
    margin-bottom: 20px;
}

.atri-quick-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
}

.atri-quick-button {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    padding: 10px 15px;
    color: #00d4ff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.atri-quick-button:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: #00d4ff;
    transform: translateX(5px);
}

.atri-quick-button i {
    margin-right: 8px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .atri-chat-modal {
        bottom: 160px;
        left: 20px;
        right: 20px;
        width: auto;
        height: 500px;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .atri-chat-modal {
        bottom: 140px;
        left: 10px;
        right: 10px;
        height: 450px;
    }
    
    .atri-header-text h3 {
        font-size: 12px;
    }
    
    .atri-header-text p {
        font-size: 10px;
    }
}

/* Анимации */
@keyframes atri-pulse {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(0, 212, 255, 0.4),
            0 0 40px rgba(0, 212, 255, 0.2),
            0 4px 15px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 
            0 0 30px rgba(0, 212, 255, 0.6),
            0 0 60px rgba(0, 212, 255, 0.3),
            0 4px 15px rgba(0, 0, 0, 0.3);
    }
}

@keyframes atri-shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

@keyframes atri-modal-appear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes atri-message-appear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes atri-typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

@keyframes atri-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes atri-line-scan {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes atri-status-blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

@keyframes atri-badge-bounce {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

