@import url('./chat-attachment.css');
@import url('./chat-audio.css');
@import url('./chat-voice.css');
@import url('./chat-box.css');
@import url('./chat-footer.css');
@import url('./chat-header.css');
@import url('./chat-input.css');
@import url('./chat-menu.css');
@import url('./chat-message.css');
@import url('./chat-sidebar.css');
@import url('./chat-preview.css');
@import url('./chat-mobile.css');
@import url('./chat-workspace.layer.css');


/* ==========================================
   CORE LAYOUT TOKENS (NO duplicar en otros lados)
========================================== */

:root {
    --chat-footer-height: 80px;
}


/* ==========================================
   SCROLL INDICATOR
========================================== */

.scroll-indicator {
    position: absolute;
    right: 16px;
    bottom: 200px;
    display: none;
    padding: 8px;
    cursor: pointer;
    z-index: 999;
    font-size: 25px;
    font-weight: normal;

    color: var(--sky-scroll-indicator);

    opacity: .85;

    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%,100% {
        transform: translateY(0);
        opacity: .7;
    }
    50% {
        transform: translateY(6px);
        opacity: 1;
    }
}


/* ==========================================
   ANIMATIONS
========================================== */

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 var(--sky-pulse-ring);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(13,110,253,0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(13,110,253,0);
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(.98);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* ==========================================
   GLOBAL FOCUS
========================================== */

button:focus-visible {
    outline: 2px solid var(--sky-focus-outline);
    outline-offset: 2px;
}


/* ==========================================
   FLOATING CHAT BUTTON
========================================== */

.chat-button {
    position: fixed;
    right: 20px;
    bottom: 20px;

    width: 70px;
    height: 70px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 50%;

    background-color: var(--sky-chat-button-bg);
    color: var(--sky-chat-button-text);

    font-size: 30px;
    cursor: pointer;

    box-shadow: 0 4px 8px rgba(0,0,0,.2);

    transition:
        background-color .3s,
        transform .2s ease;
}

.chat-button:hover {
    background-color: var(--sky-chat-button-hover);
    transform: scale(1.05);
}

.chat-button.notify {
    animation: pulse 1s infinite;
}


/* ==========================================
   AVATARS
========================================== */

.gt-sky-inline-avatar {
    width: 22px;
    height: 22px;
    object-fit: cover;
    border-radius: 50%;
    flex-shrink: 0;

    box-shadow:
        0 2px 10px rgba(0,0,0,.18);
}

.chat-button .gt-sky-inline-avatar {
    width: 100%;
    height: 100%;
}


/* ==========================================
   CHAT ACTIONS
========================================== */

.chat-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-actions button {
    position: relative;

    padding: 6px;

    border: none;
    border-radius: 50%;

    background-color: transparent;
    color: white;

    font-size: 16px;
    cursor: pointer;

    transition:
        background-color .2s ease,
        transform .2s ease;

    margin-left: 5px;
}

.chat-actions button:hover {
    background-color: var(--sky-action-hover-bg);
    transform: scale(1.1);
}

.chat-actions button:focus {
    outline: 2px solid var(--sky-action-focus);
    outline-offset: 2px;
}


/* ==========================================
   CLOSE BUTTON
========================================== */

.chat-close-btn {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 50%;

    background: var(--sky-close-btn-bg);
    color: white;

    font-size: 18px;
    cursor: pointer;

    transition:
        background .2s ease,
        transform .1s ease;
}

.chat-close-btn:hover {
    background: var(--sky-close-btn-hover);
}

.chat-close-btn:active {
    background: var(--sky-close-btn-active);
    transform: scale(.92);
}


/* ==========================================
   CHAT BODY
========================================== */

.chat-body {
    flex: 1 1 auto;
    min-height: 0;

    overflow-y: auto;

    padding: 10px;
    padding-bottom: 80px;

    background-color: var(--sky-body-background);

    position: relative;
    box-sizing: border-box;

    -webkit-overflow-scrolling: touch;
    will-change: transform;

    z-index: 1;
}


/* ==========================================
   BODY CLOSE BUTTON
========================================== */

.chat-body-close {
    position: sticky;
    top: 8px;

    float: right;

    width: 28px;
    height: 28px;

    margin-bottom: 8px;

    border: none;
    border-radius: 50%;

    background: rgba(0,0,0,.1);

    font-size: 16px;
    cursor: pointer;

    z-index: 5;
}

.chat-body-close:hover {
    background: rgba(0,0,0,.25);
}


/* ==========================================
   FORM LAYOUT
========================================== */

#chat-form {
    display: flex;
    align-items: flex-end;
    width: 100%;
}

.input-wrapper {
    width: 100%;
}

#chat-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}


/* ==========================================
   FOOTER
========================================== */

.chat-footer {
    min-height: var(--chat-footer-height);
}


/* ==========================================
   TABLE SCROLL
========================================== */

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}