/* Tech Support Chat Styles */
#tech-support-dialog {
    position: fixed;
    bottom: 10px;
    right: 1rem;
    width: 350px !important;
    height: 500px !important;
    border-radius: 1rem;
    box-shadow: 0 0 10px 3px rgba(0,0,0,.12) !important;
    background-color: #fff;
    font-family: 'EurobankSans', Arial, sans-serif;
    overflow: hidden;
    z-index: 380 !important;
    transition: all 0.4s ease-in-out;
    display: flex;
    flex-direction: column;
}

#tech-support-dialog.expanded {
    height: 500px !important;
    clip-path: circle(160% at 92% 88%);
}

#tech-support-dialog.minimized {
    height: 45px;
    clip-path: circle(0% at 92% 88%);
}

#tech-support-dialog.has-notification .tech-support-header {
    background-color: #0c6cb2;
}

.tech-support-header {
    padding: 12px 16px;
    background-color: #021342;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.875rem;
}

.tech-support-header h3 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    position: relative;
    padding-left: 18px; /* Space for the status indicator */
}

/* Add online status indicator */
.tech-support-header h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background-color: #2de68c; /* Bright green for "online" */
    border-radius: 50%;
    margin-right: 8px;
}

.tech-support-controls button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.tech-support-controls button:hover {
    opacity: 1;
}

.tech-support-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: calc(100% - 45px);
}

.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background-color: #fff;
}

.chat-message {
    max-width: 80%;
    padding: 10px 14px;
    margin-bottom: 12px;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 0.875rem;
    position: relative;
}

.support-message {
    align-self: flex-start;
    background-color: #f2f2f2;
    color: #4a4a4a;
    border-radius: 0 18px 18px 18px;
    float: left;
    clear: both;
}

.user-message {
    align-self: flex-end;
    background-color: #0c6cb2;
    color: white;
    border-radius: 18px 0 18px 18px;
    float: right;
    clear: both;
}

.system-message {
    align-self: center;
    background-color: #fff3cd;
    max-width: 90%;
    text-align: center;
    font-style: italic;
    color: #856404;
    margin: 10px auto;
    clear: both;
    float: none;
}

.chat-input-container {
    padding: 12px;
    display: flex;
    border-top: 1px solid #eaeeef;
    background-color: #ffffff;
}

#chat-input {
    flex: 1;
    border: 1px solid #eaeeef;
    border-radius: 20px;
    padding: 10px 14px;
    outline: none;
    resize: none;
    margin-right: 10px;
    font-family: 'EurobankSans', Arial, sans-serif;
    font-size: 14px;
    box-shadow: none;
}

#chat-input:focus {
    border-color: #0c6cb2;
}

#chat-input::placeholder {
    color: #96989b;
}

#chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #021342;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
    transition: background-color 0.2s;
}

#chat-send-btn:hover {
    background-color: #032266;
}

/* Remove the previous arrow style */
#chat-send-btn:before,
#chat-send-btn:after {
    display: none;
}

/* Add a proper arrow with center line and two sides */
#chat-send-btn {
    position: relative;
}

#chat-send-btn::after {
    content: '';
    display: block;
    position: absolute;
    width: 2px;
    height: 14px;
    background-color: white;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(-0px);
}

#chat-send-btn::before {
    content: '';
    display: block;
    position: absolute;
    width: 10px;
    height: 10px;
    border-top: 2px solid white;
    border-right: 2px solid white;
    top: 50%;
    left: 50%;
    transform: translate(-25%, -50%) rotate(-45deg) translateY(-4px);
}

/* Typing indicator */
.typing-indicator {
    padding: 12px 20px 12px 12px;
    display: flex;
    align-items: center;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    max-width: 60px !important;
}

.typing-dots {
    display: flex;
    align-items: center;
}

.typing-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #0c6cb2;
    margin-right: 4px;
    animation: typingAnimation 1s infinite ease-in-out;
}

.typing-dots .dot:nth-child(1) {
    animation-delay: 0s;
}

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

.typing-dots .dot:nth-child(3) {
    animation-delay: 0.4s;
    margin-right: 0;
}

@keyframes typingAnimation {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0.5;
    }
}

/* Additional clearfix to ensure message display */
.chat-messages::after {
    content: "";
    display: table;
    clear: both;
}


/* Media queries for responsive design */
@media screen and (max-width: 48em) {
    #tech-support-dialog {
        width: 90% !important;
        max-width: 350px;
    }
}

@media screen and (max-width: 30em) {
    #tech-support-dialog {
        width: 95% !important;
        max-width: 320px;
        bottom: 10px;
        right: 10px;
    }
    
    .chat-message {
        max-width: 85%;
    }
}