body {
    font-family: 'Roboto', Arial, sans-serif;
    background-color: #ffffff;
    color: #202124;
    display: flex;
    justify-content: center;
    padding: 20px;
}

/* Chat Container */
.chat-container {
    position: fixed;
    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    background-color: #ffffff;

    border: 0px solid #e5e5e5;
    border-radius: 12px;

    display: flex;
    flex-direction: column;

    overflow: hidden;
}


/* =========================================================
   HEADER
========================================================= */

.chat-header {
    padding: 12px 16px;

    background-color: #ffffff;
    color: #202124;

    border-bottom: 1px solid #e5e5e5;

    font-weight: bold;
    font-size: 14px;
}


/* =========================================================
   CHAT BOX
========================================================= */

.chat-box {
    flex: 1;

    padding: 0px 2px 0px;

    overflow-y: auto;

    display: flex;
    flex-direction: column;
    margin-bottom: 5px;
    gap: 0px;

    background: #ffffff;
}


/* =========================================================
   MESSAGE
========================================================= */

.chat-message {
    position: relative;

    display: block;

    width: 100%;
    height: auto;

    box-sizing: border-box;

    padding-right: 32px;

    min-height: 20px;

    color: #202124;

    font-size: 13px;
    line-height: 1.4;

    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;

    flex-shrink: 0;
}


/* =========================================================
   USERNAME
========================================================= */

.username {
       color: rgba(0, 0, 0, .5);

    font-weight: bold;

    margin-right: 3px;

    cursor: pointer;

    transition: color 0.2s ease;
}


.username:hover {
    color: #065fd4;
    text-decoration: underline;
}


/* =========================================================
   INPUT AREA
========================================================= */

.chat-input-area {
  padding: 10px 15px 10px;

    background-color: #ffffff;

    border-top: 2px solid #e5e5e5;

    display: flex;
    flex-direction: column;

    gap: 8px;
}


.chat-input-area input {
    background-color: #ffffff;
    color: #202124;

    border: 1px solid #d6d6d6;

    padding: 8px 12px;

    border-radius: 6px;

    outline: none;

    font-size: 13px;
}


.chat-input-area input::placeholder {
    color: #8a8a8a;
}


.chat-input-area input:focus {
    border-color: #065fd4;
}


/* =========================================================
   INPUT + EMOJI BUTTON
========================================================= */

.input-with-button {
    position: relative;

    display: flex;
    align-items: center;

    width: 100%;
}


.input-with-button input {
    width: 100%;
    padding-right: 74px;
    box-sizing: border-box;
}


/* =========================================================
   SEND BUTTON
========================================================= */

.send-btn {
    background-color: #cc0000;
    color: #ffffff;

    border: none;

    padding: 8px;

    border-radius: 6px;

    cursor: pointer;

    font-weight: bold;
    font-size: 13px;
}


.send-btn:hover {
    background-color: #ff0000;
}


/* =========================================================
   EMOJI BUTTON
========================================================= */

.yt-emoji-btn {
    position: absolute;

    right: 38px;

    background: transparent !important;

    border: none;

    cursor: pointer;

    padding: 4px;
    margin: 0;

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

    border-radius: 50%;

    color: #606060;

    transition:
        color 0.2s ease,
        background-color 0.2s ease;
}


.yt-emoji-btn:hover {
    color: #202124;

    background-color: rgba(0, 0, 0, 0.06) !important;
}


.yt-emoji-btn svg {
    width: 20px;
    height: 20px;

    display: block;
}


/* =========================================================
   EMOJI PICKER
========================================================= */

.emoji-picker-wrapper {
    position: absolute;

    bottom: 110px;
    left: 12px;
    right: 12px;

    z-index: 10;

    display: flex;
    justify-content: center;
}


.emoji-picker-wrapper.hidden {
    display: none;
}


emoji-picker {
    width: 100%;
    height: 260px;

    --background: #ffffff;
    --border-color: #dddddd;
    --emoji-size: 1.1rem;
    --num-columns: 7;

    border-radius: 8px;

    box-shadow:
        0 -4px 14px rgba(0, 0, 0, 0.15);
}


/* =========================================================
   LOGIN AREA
========================================================= */

.chat-login-area {
    padding: 16px 12px;

    background-color: #ffffff;

    border-top: 1px solid #e5e5e5;

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


.chat-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 36px;

    padding: 0 16px;

    border-radius: 18px;

    background: #f2f2f2;
    color: #202124;

    font-size: 14px;
    font-weight: 500;

    text-decoration: none;

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}


.chat-login-btn:hover {
    background: #e5e5e5;
    color: #000000;
}


/* =========================================================
   LOGIN / REGISTER POPUP
========================================================= */

.chat-auth-overlay {
    position: absolute;

    inset: 0;

    z-index: 9999;

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

    padding: 16px;

    box-sizing: border-box;

    background: rgba(0, 0, 0, 0.38);
}


.chat-auth-overlay.hidden {
    display: none;
}


.chat-auth-box {
    position: relative;

    width: 100%;
    max-width: 320px;

    padding: 24px 18px 18px;

    box-sizing: border-box;

    background: #ffffff;

    border: 1px solid #dddddd;

    border-radius: 12px;

    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.20);
}


.chat-auth-box h3 {
    margin: 0 0 18px;

    color: #202124;

    font-size: 18px;
    font-weight: 600;

    text-align: center;
}


.chat-auth-box input {
    width: 100%;

    margin-bottom: 10px;

    padding: 10px 12px;

    box-sizing: border-box;

    background: #ffffff;
    color: #202124;

    border: 1px solid #d6d6d6;

    border-radius: 7px;

    outline: none;

    font-size: 13px;
}


.chat-auth-box input:focus {
    border-color: #065fd4;
}


.chat-auth-close {
    position: absolute;

    top: 6px;
    right: 9px;

    border: none;

    background: transparent;

    color: #606060;

    font-size: 24px;
    line-height: 1;

    cursor: pointer;
}


.chat-auth-close:hover {
    color: #000000;
}


.chat-auth-submit {
    width: 100%;

    min-height: 38px;

    margin-top: 4px;

    border: none;

    border-radius: 19px;

    background: #065fd4;
    color: #ffffff;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;
}


.chat-auth-submit:hover {
    background: #0b57c0;
}


.chat-auth-switch {
    margin-top: 16px;

    color: #606060;

    font-size: 12px;

    text-align: center;
}


.chat-auth-switch button {
    padding: 0;

    border: none;

    background: transparent;

    color: #065fd4;

    font-size: 12px;

    cursor: pointer;
}


.chat-auth-switch button:hover {
    text-decoration: underline;
}


.chat-auth-error {
    min-height: 16px;

    margin-top: 8px;

    color: #d93025;

    font-size: 12px;

    text-align: center;
}


#chatLoginPanel.hidden,
#chatRegisterPanel.hidden {
    display: none;
}


/* =========================================================
   CHAT MESSAGE OPTIONS
========================================================= */

.chat-message-actions {
    position: absolute;

    top: 3px;
    right: 0;

    z-index: 20;
}


/* =========================================================
   THREE DOTS
========================================================= */

.chat-more-btn {
    width: 28px;
    height: 28px;

    padding: 0;

    border: none;

    border-radius: 50%;

    background: transparent;

    color: #606060;

    font-size: 21px;
    line-height: 28px;

    text-align: center;

    cursor: pointer;

    opacity: 0;

    transition:
        opacity 0.15s ease,
        background-color 0.15s ease,
        color 0.15s ease;
}


.chat-message:hover .chat-more-btn,
.chat-ban-menu.open + .chat-more-btn {
    opacity: 1;
}


.chat-more-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #202124;
}


/* =========================================================
   BAN MENU
========================================================= */

.chat-ban-menu {
    position: absolute;

    top: 30px;
    right: 0;

    min-width: 210px;

    padding: 6px;

    background: #ffffff;

    border: 1px solid #dddddd;

    border-radius: 8px;

    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.18);

    display: none;

    z-index: 100;
}


.chat-ban-menu.open {
    display: block;
}


.chat-ban-option {
    width: 100%;

    padding: 9px 10px;

    border: none;

    border-radius: 6px;

    background: transparent;

    color: #202124;

    font-size: 13px;

    text-align: left;

    white-space: nowrap;

    cursor: pointer;
}


.chat-ban-option:hover {
    background: #f2f2f2;
}


.chat-ban-option:disabled {
    opacity: 0.5;

    cursor: default;
}


/* =========================================================
   TOAST MESSAGE
========================================================= */

.chat-ban-toast {
    position: fixed;

    left: 50%;
    bottom: 24px;

    transform:
        translate(-50%, 20px);

    max-width: calc(100% - 32px);

    padding: 10px 15px;

    box-sizing: border-box;

    background: #ffffff;
    color: #202124;

    border: 1px solid #dddddd;

    border-radius: 18px;

    font-size: 13px;
    line-height: 1.3;

    box-shadow:
        0 5px 20px rgba(0, 0, 0, 0.18);

    opacity: 0;

    pointer-events: none;

    z-index: 20000;

    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}


.chat-ban-toast.show {
    opacity: 1;

    transform:
        translate(-50%, 0);
}


/* =========================================================
   TOUCH / MOBILE
========================================================= */

@media (hover: none) {

    .chat-more-btn {
        opacity: 0.65;
    }

    .chat-more-btn:active {
        opacity: 1;
    }

}


/* =========================================================
   CHAT TIMEOUT NOTICE
========================================================= */

.chat-timeout-notice {
    margin: 0 12px 10px;

    padding: 10px 12px;

    display: flex;
    align-items: center;

    gap: 10px;

    background: #fff8e8;

    border: 1px solid #ead7ad;

    border-radius: 9px;

    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.10);

    animation:
        chatTimeoutAppear 0.25s ease;
}


.chat-timeout-notice.hidden {
    display: none;
}


.chat-timeout-icon {
    font-size: 22px;
    line-height: 1;
}


.chat-timeout-content {
    display: flex;
    flex-direction: column;

    gap: 2px;

    font-size: 12px;

    color: #606060;
}


.chat-timeout-content strong {
    color: #202124;

    font-size: 13px;
}


#chatTimeoutCountdown {
    color: #b06000;

    font-size: 13px;
}


@keyframes chatTimeoutAppear {

    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }

}


/* =========================================================
   BAN ACTIVITY
========================================================= */

.chat-ban-activity {
    display: block;

    width: 100%;
    height: auto;

    box-sizing: border-box;

    color: #777777;

    font-size: 12px;
    line-height: 1.4;

    white-space: normal;

    overflow-wrap: anywhere;

    word-break: normal;

    flex-shrink: 0;

    padding-right: 0;
}


/* =========================================================
   EMOJI
========================================================= */

.chat-emoji {
    font-size: 22px;
    line-height: 22px;

    vertical-align: middle;

    position: relative;

    top: -1px;
}


/* =========================================================
   YOUTUBE TRAILER
========================================================= */

.chat-youtube-player {
    display: block;

    width: 100%;
    max-width: 420px;

    aspect-ratio: 16 / 9;

    margin-top: 6px;

    overflow: hidden;

    background: #000000;

    border-radius: 6px;
}


.chat-youtube-player iframe {
    display: block;

    width: 100%;
    height: 100%;

    border: 0;
}


.chat-youtube-link {
    color: #065fd4;

    text-decoration: none;

    position: relative;

    top: 1px;
}


.chat-youtube-link:hover {
    text-decoration: underline;
}







.chat-message {
    transition: background-color 0.15s ease;
      padding: 7px 12px 3px;
}

.chat-message:hover {
    background-color: #f5f5f5;
}









.chat-delete-option {
    width: 100%;

    padding: 9px 10px;

    border: none;
    border-radius: 6px;

    background: transparent;

    color: #d93025;

    font-size: 13px;

    text-align: left;

    white-space: nowrap;

    cursor: pointer;
}


.chat-delete-option:hover {
    background: #fce8e6;
}


.chat-delete-option:disabled {
    opacity: 0.5;
    cursor: default;
}


/* =========================================================
   ADMIN HEADER MENU
========================================================= */

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}


.chat-admin-header-menu {
    position: relative;
}


.chat-admin-menu-button {
    width: 28px;
    height: 28px;

    padding: 3px;

    border: none;
    border-radius: 50%;

    background: transparent;
    color: #606060;

    cursor: pointer;

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


.chat-admin-menu-button:hover {
    background: #f2f2f2;
    color: #202124;
}


.chat-admin-menu-button svg {
    width: 20px;
    height: 20px;

    fill: currentColor;
}


.chat-admin-menu {
    position: absolute;

    top: 32px;
    right: 0;

    min-width: 190px;

    padding: 6px;

    background: #ffffff;

    border: 1px solid #dddddd;
    border-radius: 8px;

    box-shadow:
        0 6px 20px rgba(0,0,0,0.18);

    display: none;

    z-index: 300;
}


.chat-admin-menu.open {
    display: block;
}


.chat-admin-clear {
    width: 100%;

    padding: 9px 10px;

    border: none;
    border-radius: 6px;

    background: transparent;

    color: #d93025;

    font-size: 13px;

    text-align: left;

    cursor: pointer;
}


.chat-admin-clear:hover {
    background: #fce8e6;
}







.chat-user-avatar {
    width: 24px;
    height: 24px;

    border-radius: 50%;

    object-fit: cover;

    vertical-align: middle;

    margin-right: 3px;

    position: relative;
    top: -3px;
}






@media (max-width: 600px) {
    .chat-input-area input,
    .chat-auth-box input {
        font-size: 16px;
    }
}




/* Χώρος δεξιά στο input για emoji + send */
.input-with-button input {
    width: 100%;
    padding-right: 74px;
    box-sizing: border-box;
}


/* Emoji - αριστερά από το send */
.yt-emoji-btn {
    right: 38px;
    z-index: 20;
}


/* Send button */
.chat-inline-send-btn {
    position: absolute !important;
    right: 4px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;

    width: 30px !important;
    height: 30px !important;

    padding: 4px !important;
    margin: 0 !important;

    border: 0 !important;
    border-radius: 50% !important;

    background: transparent !important;
    color: #606060 !important;

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

    cursor: pointer;
    z-index: 20 !important;
}


.chat-inline-send-btn svg {
    display: block !important;
    width: 22px !important;
    height: 22px !important;

    fill: currentColor !important;

    pointer-events: none;
}


.chat-inline-send-btn:hover {
    background: rgba(0, 0, 0, 0.06) !important;
    color: #202124 !important;
}










.chat-message {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}



.chat-message-content {
    flex: 1;
    min-width: 0;
    display: block;
    white-space: normal;
}

.username {
    display: inline;
    white-space: nowrap;
}

.chat-message-text {
    display: inline;
    white-space: normal;
    overflow-wrap: anywhere;
}









.chat-message-content {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    display: block;
}


.chat-youtube-player {
    display: block;

    width: 100%;
    max-width: 420px;

    aspect-ratio: 16 / 9;

    margin-top: 6px;

    overflow: hidden;

    background: #000;
    border-radius: 6px;

    box-sizing: border-box;
}


.chat-youtube-player iframe {
    display: block;

    width: 100%;
    height: 100%;

    border: 0;
}

/* =========================================================
   TOKEN AUTH VISIBILITY
   =========================================================
   Το παλιό UI δημιουργούσε guest/logged-in blocks με PHP,
   άρα δεν χρειαζόταν CSS για να τα κρύβει.
   Στο νέο token auth υπάρχουν και τα δύο στο DOM και
   το JavaScript αλλάζει την class "hidden".
========================================================= */

.chat-login-area.hidden,
.chat-input-area.hidden,
.chat-admin-header-menu.hidden {
    display: none !important;
}



.chat-avatar-letter {
    width: 28px;
    height: 28px;

    border-radius: 50%;

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

    color: #fff;

    font-size: 13px;
    font-weight: 600;

    flex-shrink: 0;
}







.chat-profile-popup {
    position: fixed;
    inset: 0;
    z-index: 99999;

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

    background: rgba(0, 0, 0, 0.55);
}

.chat-profile-popup.hidden {
    display: none !important;
}

.chat-profile-box {
    position: relative;

    width: 90%;
    max-width: 380px;

    padding: 22px;

    box-sizing: border-box;

    background: #fff;
    border-radius: 10px;
}

.chat-profile-box h3 {
    margin: 0 0 18px;
}

.chat-profile-box label {
    display: block;
    margin: 12px 0 5px;
}

.chat-profile-box input {
    width: 100%;
    box-sizing: border-box;
}

.chat-profile-close {
    position: absolute;
    top: 8px;
    right: 10px;

    border: 0;
    background: transparent;

    font-size: 24px;
    cursor: pointer;
}

.chat-profile-save {
    margin-top: 18px;
}

.chat-profile-separator {
    margin: 18px 0;
    border-top: 1px solid #ddd;
}

.chat-profile-avatar-preview-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.chat-profile-avatar-preview {
    width: 72px;
    height: 72px;

    border-radius: 50%;

    object-fit: cover;

    border: 2px solid #e5e5e5;

    background: #f5f5f5;
}



.chat-current-user {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

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



.chat-profile-popup {
    position: fixed;
    inset: 0;
    z-index: 99999;

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

    padding: 12px;
    box-sizing: border-box;

    background: rgba(0, 0, 0, 0.55);

    overflow-y: auto;
}

.chat-profile-popup.hidden {
    display: none !important;
}

.chat-profile-box {
    position: relative;

    width: 100%;
    max-width: 380px;

    max-height: calc(100vh - 24px);

    padding: 22px;

    box-sizing: border-box;

    background: #fff;
    border-radius: 10px;

    overflow-y: auto;

    -webkit-overflow-scrolling: touch;
}


.chat-header{
    display: none !important;
}