/*
* chat TP
* MP 5.5.2025
*/

.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 450px;
    height: 700px;
    max-height: 90vh;
    max-width: 90vw;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: none;
    flex-direction: column;
    background: white;
    z-index: 1000;
    transition: height 0.3s ease, width 0.3s ease;
}

.chat-widget.open {
    display: flex;
}

.chat-widget.fullscreen {
    height: 90vh;
    width: 800px;
}

.chat-widget .chat-header {
    background-color: #30ACE2;
    color: white;
    padding: 12px 16px;
    font-weight: bold;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-widget .chat-header .chat-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-widget .chat-header .chat-header-left img{
    padding: 3px;
    background-color: #FFF;
}

.chat-widget .chat-header .chat-header-right button {
    background: transparent;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    margin-left: 8px;
    padding: 5px 3px;
}


.chat-widget .chat-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    overflow-y: auto;
}

.chat-widget .chat-message {
    display: flex;
    align-items: flex-start;
    max-width: 80%;

}

.chat-widget .chat-message .avatar {
    font-size: 24px;
    margin-right: 10px;
    margin-top: 4px;
}

.chat-widget .chat-message .text {
    padding: 12px;
 
    border-radius: 12px;
    background-color: #e8f0fe;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    text-align: left;
    
}

.chat-widget .chat-message .text p{
    margin: 0px;
    margin-bottom: 10px;
}

.chat-widget .chat-message.bot{
        max-width: 90%;
    
}

/* Odlišení bot vs uživatel */
.chat-widget .chat-message.bot .avatar{
    color:#FFF;
    font-size: 10px;
    border-radius: 100%;
    padding: 11px 7px;
    text-align: center;
    background-color: #30ACE2;
    font-weight: bold;
}

.chat-widget .chat-message.bot .text {
    background-color: #E6F7FD;
    border-left: 4px solid #30ACE2;
    color: #000;
    text-align: left;
    padding-bottom: 2px;

}

#content-private .chat-widget .chat-message.bot .text p a{
    color: #000;
    text-decoration: underline;
}


.chat-widget .chat-message.resitel .avatar{
    text-align: center;
    padding: 5px 0px;
}

.chat-widget .chat-message.resitel .text {
    background-color: #E6F7FD;
    border-left: 4px solid #30ACE2;
    color: #000;
    text-align: left;
    padding-bottom: 2px;
}

#content-private .chat-widget .chat-message.resitel .text p a{
    color: #000;
    text-decoration: underline;
}

.chat-widget .chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-widget .chat-message.user .text {
    background-color: #F2F3F5;
    border-left: 4px solid #AAA;
    color: #000;
    text-align: left;
}

.chat-widget .chat-message.user .avatar {
    margin-left: 10px;
    margin-right: 0;
}

.chat-widget .chat-input {
    display: flex;
    border-top: 1px solid #ccc;
    background: #fff;
    padding: 8px;
    align-items: flex-end;
}


.chat-widget .chat-input textarea {
    flex: 1;
    border: none;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    resize: none; /* zabrání manuálnímu roztažení */
    min-height: 40px;
    max-height: 120px;
    overflow-y: auto;
    font-family: 'Nunito', 'Roboto', "trebuchet MS", "Lucida Grande", 'Arial';

}

.chat-widget .chat-input button {
    width: 40px;
    height: 40px;
    background-color: #30ACE2; /* modrá */
    border: none;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}


.chat-widget .chat-input button::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-40%, -50%); /* zarovnání trojúhelníku do středu */
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 15px; /* výška a šířka trojúhelníku */
    border-color: transparent transparent transparent white;
}


/* Ovládací bublina */
.chat-widget-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #30ACE2;
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 999;
    padding:0px;
    margin: 0px;
}

.chat-widget-toggle i.uil-comment{
    position: relative;
    top: -2px;
}

.chat-widget-toggle:hover{
    background-color: #209ac0;
}

.chat-widget .chat-toggle-close i{
   font-size: 25px;
 
}

.chat-widget-new-message {
    display: none; /* výchozí stav – skrytý */
    position: absolute;
    top: -1px;
    right: 6px;
    width: 12px;
    height: 12px;
    background-color: #FF3B30; /* červená značka */
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
    z-index: 1001;
}

.chat-input button:hover{
    background-color: #209ac0;
}


#aida-typing-indicator{
    text-align: left;
    font-size: 12px;
    display: none; 
    padding: 5px 10px; 
    color: #555;
}

/* do CSS */
.chat-widget  #aida-typing-indicator .typing-dots span {
    animation: blink 1.4s infinite;
}
.chat-widget #aida-typing-indicator .typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}
.chat-widget #aida-typing-indicator .typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}


@keyframes blink {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}


@media (max-width: 399px) {
    .chat-toggle-resize {
        display: none !important;
    }
}