/**
 * Copyright (c) 2024–2025 Peter Kocalka – All Rights Reserved.
 *
 * This source code is proprietary and confidential.
 * Reproduction, distribution or unauthorized use of this file,
 * in whole or in part, without express written consent is strictly prohibited.
 */
 
.emoji-picker {
    position: absolute;
    bottom: 35px;
    left: 0;
    background: #fff;
    border: 1px solid #ccc;
    padding: 10px;
    z-index: 9999;
    min-width: 300px;
    max-width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 24px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    border-radius: 6px;
    overflow: hidden;
}
.emoji-picker.hidden {
    display: none !important;
}
.emoji-picker button {
    border: none;
    background: transparent;
    font-size: 24px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    text-align: center;
    padding: 0;
    line-height: 1;
}

#emoji-picker button {
    border: none;
    background: transparent;
    font-size: 24px;
    width: 36px;
    height: 36px;
    line-height: 36px;
    cursor: pointer;
    padding: 0;
    text-align: center;
}
.chat-ai-bubble {
    position: fixed;
    bottom: 20px;
    right: 20px;
//    background: #ffc107;
    color: #000;
    padding: 12px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 9999;
}

.chat-ai-box {
  position: fixed;
  bottom: clamp(10px, 4vh, 30px);
  right: clamp(10px, 4vw, 30px);
  width: clamp(280px, 90vw, 400px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
//  background: #fff;
  border: 1px solid #ccc;
  border-radius: 10px 10px 0 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  font-size: clamp(0.9rem, 1.2vw, 1.1rem);
  line-height: 1.4;
  overflow: hidden;
  z-index: 2147483647 !important;
}
/* Hlavička */
.chat-ai-header {
    padding: 5px;
//    background-color: #f4b400;
    color: #000;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.chat-ai-history {
  flex: 1;
  overflow-y: auto;
  min-height: 5rem; /* minimálna čitateľná veľkosť */
  max-height: clamp(100px, 40vh, 400px); /* obmedzíme na max 50% viewportu */
}
.chat-ai-input-section {
    padding: 5px;
}
.chat-ai-input {
    width: 48%;
    padding: 5px;
    margin-bottom: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.chat-ai-user-info input {
    width: 100%;
    padding: 5px 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}
.chat-ai-button {
    width: 100%;
    padding: 0.75em 1em;
    font-size: 1em;
}
.chat-ai-user-info {
    display: none;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 5px;
}
.chat-ai-field {
    flex: 1 1 48%;
    min-width: 120px;
}
.chat-ai-field.email {
    flex: 1 1 100%;
}
/* Vstupná sekcia */
.chat-ai-input-section {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Textové pole */

.chat-ai-input {
  width: 100%;
  min-height: 2.5em;
  max-height: clamp(40px, 15vh, 100px);
  resize: vertical;
  font-size: 1em; /* nech sa škáluje podľa root font-size */
}

.chat-ai-icons-row {
    display: flex;
    gap: 10px;
}


.chat-ai-icon-button, .chat-ai-file-label {
    font-size: 18px;
    cursor: pointer;
    background: none;
    border: none;
}

/* Emoji a spinka – menšie, aby nezavadzali */
.chat-ai-file-label, #emoji-toggle {
    font-size: 18px;
    cursor: pointer;
    background: none;
    border: none;
    flex-shrink: 0;
}

.chat-ai-close {
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.chat-ai-close:hover {
    background: rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
  .chat-ai-box.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 2147483647;
    border-radius: 0;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
}


/* ✅ Zvýraznenie nového používateľa v tabuľke */
.chat-ai-new-user {
    background-color: #ffffcc !important;
    animation: chatAiHighlight 2s ease-out;
}
/* ✨ Animácia pri zvýraznení */
@keyframes chatAiHighlight {
    from { background-color: #fff9b1; }
    to { background-color: #ffffcc; }
}
.chat-ai-file-label {
    display: inline-block;
    cursor: pointer;
    padding: 6px 12px;
    background-color: #f1f1f1;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.2s;
}
.chat-ai-file-label:hover {
    background-color: #e2e2e2;
}
.chat-user-entry {
    padding: 5px;
    border-radius: 4px;
}
.chat-user-new {
    background-color: #fff3cd;
    border-left: 4px solid orange;
}
.chat-ai-input-section {
    padding: 10px;
    border-top: 1px solid #eee;
    background: #fff;
    flex-shrink: 0;
}
.chat-user-has-new::after {
    content: ' 🔔';
    color: red;
    font-weight: bold;
    margin-left: 5px;
}
.chat-user-has-new {
    background-color: #fff4f4 !important;
}
.chat-user-link {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.chat-user-link:hover {
    background-color: #f5f5f5;
}
.chat-user-active {
    background-color: #e0f7fa !important;
    font-weight: bold;
    border-left: 4px solid #00acc1;
}
.chat-msg {
    padding: 8px 10px;
    margin-bottom: 8px;
    border-radius: 6px;
    max-width: 95%;
    word-wrap: break-word;
}
.chat-msg.user {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
}
.chat-msg.assistant {
    background-color: #fff3e0;
    border-left: 4px solid #fb8c00;
}
.chat-msg.ai {
    background-color: #fff3e0;
    border-left: 4px solid #fb8c00;
}
.chat-msg.admin {
    background-color: #e8f5e9;
    border-left: 4px solid #4caf50;
}
.chat-msg strong {
    display: block;
    margin-bottom: 4px;
}
.chat-ai-offline-message {
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    background: #fff8e1;
    color: #333;
}


/* 📐 Korekcia šírky inputov a textarea */
.chat-ai-box input,
.chat-ai-box textarea,
.chat-ai-box select {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 16px !important;
}
.chat-ai-translation {
    margin-top: 5px;
    font-style: italic;
    font-size: 0.92em;
    color: #444;
}

