/**
 * Standalone Chat Widget - EXACT COPY of appoiint Chat Interface
 * With Ghost Mode (Transparent) enabled by default
 * Based on public/css/client.css
 */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500&display=swap');

/*--------------------------------------------------------------
# Root settings - EXACT COPY from client.css with Ghost Mode
--------------------------------------------------------------*/

:root {
    /* Ghost mode variables - less transparent for better readability */
    --body-bg: rgba(0, 0, 0, 0.95);
    --msger-bg: rgba(0, 0, 0, 0.85);
    --msger-private-bg: rgba(0, 0, 0, 0.85);
    --select-bg: rgba(44, 44, 44, 0.9);
    
    /* Widget positioning */
    --msger-top: 50%;
    --msger-left: 50%;
    --msger-height: 680px;
    --msger-width: 420px;
    --msger-bubble-width: 85%;
    
    /* Common */
    --border: 0.5px solid rgb(255 255 255 / 32%);
    --dd-color: #ffffff;
    --box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    
    /* Chat msg bubble */
    --left-msg-bg: rgba(204, 204, 204, 0.8);
    --right-msg-bg: rgba(221, 221, 221, 0.8);
    --private-msg-bg: rgba(238, 238, 238, 0.8);
    
    /* Hover */
    --hover-color: grey;
}

* {
    outline: none;
    font-family: 'Montserrat';
}

/*--------------------------------------------------------------
# Widget Container
--------------------------------------------------------------*/

#appoiint-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-family: 'Montserrat', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    --widget-primary-color: #5c6ac4;
}

/*--------------------------------------------------------------
# Launcher Button (Tawk.to style)
--------------------------------------------------------------*/

#appoiint-widget-launcher {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--widget-primary-color);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#appoiint-widget-launcher:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

#appoiint-widget-launcher.open i {
    transform: rotate(0deg);
}

#appoiint-widget-launcher i {
    transition: transform 0.3s ease;
}

.appoiint-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    padding: 2px;
}

/*--------------------------------------------------------------
# Chat room aka msger - EXACT COPY from client.css
--------------------------------------------------------------*/

.msger-draggable {
    z-index: 999998;
    display: none;
    position: fixed;
    height: var(--msger-height);
    width: var(--msger-width);
    min-height: var(--msger-height);
    min-width: var(--msger-width);
    background: var(--msger-bg);
    border: var(--border);
    resize: both;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    transition: width 0.5s ease-in-out;
    bottom: 90px;
    right: 20px;
}

.msger-draggable.open {
    display: block;
}

.msger {
    width: 100%;
    height: 100%;
    display: flex;
    flex-flow: column wrap;
    justify-content: space-between;
    background: var(--msger-bg);
}

/*--------------------------------------------------------------
# Chat room header - EXACT COPY
--------------------------------------------------------------*/

.msger-header {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    color: #666;
    cursor: move;
}

.msger-private-header {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    color: #666;
}

.msger-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
}

.msger-header-title button,
.msger-header-options button {
    padding: 5px;
    border: none;
    font-size: 1rem;
    background: transparent;
    color: #fff;
    border-radius: 5px;
    transition: all 0.3s ease-in-out;
    transition: background 0.23s;
    cursor: pointer;
}

.msger-header-title button:hover,
.msger-header-options button:hover {
    background: var(--body-bg);
}

#msgerTogglePin,
#msgerDropDownMenuBtn {
    display: none !important;
}

/*--------------------------------------------------------------
# Chat room output area - EXACT COPY
--------------------------------------------------------------*/

.msger-chat {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: transparent;
    max-width: 95%;
}

.msger-chat::-webkit-scrollbar {
    width: 5px;
}

.msger-chat::-webkit-scrollbar-track {
    background: transparent;
}

.msger-chat::-webkit-scrollbar-thumb {
    background: black;
}

.msg {
    display: flex;
    align-items: flex-end;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.msg:last-of-type {
    margin: 0;
}

/* left side */

.left-msg .msg-bubble {
    background: var(--left-msg-bg);
    border-bottom-left-radius: 0;
    color: #fff;
    width: var(--msger-bubble-width);
}

.left-msg .private-msg-bubble {
    background: var(--private-msg-bg);
    border-bottom-left-radius: 0;
    color: #fff;
    width: var(--msger-bubble-width);
}

.left-msg .msg-img {
    margin: 0px 5px 5px 0px;
}

/* right side */

.right-msg {
    flex-direction: row-reverse;
}

.right-msg .msg-bubble {
    background: var(--right-msg-bg);
    border-bottom-right-radius: 0;
    color: #fff;
    width: var(--msger-bubble-width);
}

.right-msg .private-msg-bubble {
    background: var(--private-msg-bg);
    border-bottom-right-radius: 0;
    color: #fff;
    width: var(--msger-bubble-width);
}

.right-msg .msg-img {
    margin: 0px 0px 5px 5px;
}

/* common */

.msg-img {
    width: 50px;
    height: 50px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    border-radius: 50%;
}

.peer-img {
    width: 48px;
    height: 48px;
    border-radius: 50px !important;
}

.private-msg-bubble,
.msg-bubble {
    padding: 15px;
    border-radius: 15px;
    overflow: auto;
}

.msg-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.msg-info-name {
    margin-right: 10px;
    font-weight: bold;
}

.msg-info-time {
    font-size: 0.85em;
}

.msg-text {
    display: inline;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

.msg-text button {
    padding: 5px;
}

.msg-text iframe {
    width: 100%;
}

.msg-text img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 5px;
}

.msger-copy-txt {
    border: none;
    border-radius: 5px;
    color: #fff;
    background: transparent;
}

a {
    color: #fff;
}
a:hover {
    color: var(--hover-color);
    transition: all 0.3s ease-in-out;
}

button {
    padding: 10px 20px;
    cursor: pointer;
    transition:
        color 0.3s ease,
        background-color 0.3s ease,
        border-color 0.3s ease,
        transform 0.3s ease;
    outline: none;
}

/*--------------------------------------------------------------
# Chat room input area - EXACT COPY
--------------------------------------------------------------*/

.msger-inputarea {
    display: flex;
    padding: 10px;
    background: var(--msger-bg);
    min-height: 60px;
    height: auto;
}

.msger-input {
    flex: 1;
    padding: 10px;
    min-height: 40px;
    height: 40px;
    resize: none;
    color: #fff;
    font-size: 14px !important;
    background: rgba(0, 0, 0, 0.2);
    border-top-left-radius: 10px;
    -webkit-transition: height 1s;
    -moz-transition: height 1s;
    -ms-transition: height 1s;
    -o-transition: height 1s;
    transition: height 1s;
    border: var(--border);
}

.msger-input::-webkit-scrollbar {
    width: 5px;
}

.msger-input::-webkit-scrollbar-track {
    background: transparent;
}

.msger-input::-webkit-scrollbar-thumb {
    background: #404040;
}

/*--------------------------------------------------------------
# Chat room buttons area - EXACT COPY
--------------------------------------------------------------*/

.msger-input-buttons {
    padding: 10px;
    background: var(--msger-bg);
}

.msger-input-buttons button {
    padding: 5px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    color: #fff;
    background: transparent;
    transition: background 0.23s;
}

.msger-input-buttons button:hover {
    background: var(--body-bg);
}

.msger-input-buttons input {
    cursor: pointer;
}

#msgerSendBtn {
    float: right;
}

/*--------------------------------------------------------------
# Chat Connected Peers - EXACT COPY
--------------------------------------------------------------*/

#msgerCP {
    z-index: 12;
    display: none;
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: default;
    background: var(--msger-private-bg);
    overflow: hidden;
}

#msgerCPChat {
    flex: 1;
    overflow-y: auto;
    background: transparent;
}

#msgerCPList {
    border: var(--border);
}

#msgerCPList textarea {
    height: auto;
}

#msgerCPList button {
    border: none;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    border-radius: 5px;
}

#msgerCPList button:hover {
    color: var(--hover-color);
}

#searchPeerBarName {
    width: 94.5%;
    padding: 10px;
    font-size: 1rem;
    background-color: transparent;
    color: #ffffff;
    border: var(--border);
}

.msger-peer-inputarea {
    display: flex;
    padding: 10px;
    background: var(--msger-bg);
}

.msger-peer-inputarea * {
    padding: 5px;
    border: none;
    border-radius: 3px;
    font-size: 1rem;
    margin: 1px;
    color: #fff;
}

/*--------------------------------------------------------------
# DropDown menu custom - EXACT COPY
--------------------------------------------------------------*/

.dropdown-custom {
    position: relative;
    display: inline-block;
}

.dropdown-toggle-custom {
    color: #fff;
    border: var(--border);
    background: var(--body-bg);
    cursor: pointer;
    padding: 5px;
    font-size: 1rem;
    background: transparent;
    border: none;
    border-radius: 5px;
    transition: all 0.3s ease-in-out;
}

.dropdown-toggle-custom:hover {
    background: var(--body-bg);
}

.dropdown-menu-custom {
    z-index: 1;
    display: none;
    position: absolute;
    right: 0;
    padding: 10px 0;
    min-width: 240px;
    border-radius: 5px;
    border: var(--border);
    background: var(--body-bg);
    box-shadow: var(--box-shadow);
}

.dropdown-menu-custom.show {
    display: block;
}

.dropdown-menu-custom li {
    padding: 8px 16px;
    list-style-type: none;
}

.dropdown-menu-custom li button {
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    padding: 8px 16px;
    font-size: 0.8em;
    cursor: pointer;
    color: #fff;
}

.dropdown-menu-custom li button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.dropdown-menu-custom hr {
    border: 0;
    display: block;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 5px 0;
}

.dropdown-menu-custom .title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 0.9rem;
}

.dropdown-menu-custom .switch {
    position: relative;
    display: inline-block;
    width: 41px;
    height: 19px;
}

.dropdown-menu-custom .switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.dropdown-menu-custom .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
}

.dropdown-menu-custom .slider:before {
    position: absolute;
    content: '';
    height: 17px;
    width: 17px;
    left: 0px;
    bottom: 1px;
    background-color: white;
    transition: 0.4s;
}

.dropdown-menu-custom input:checked + .slider {
    background-color: green;
}

.dropdown-menu-custom input:focus + .slider {
    box-shadow: 0 0 1px green;
}

.dropdown-menu-custom input:checked + .slider:before {
    transform: translateX(24px);
}

.dropdown-menu-custom .slider.round {
    border-radius: 34px;
}

.dropdown-menu-custom .slider.round:before {
    border-radius: 50%;
}

/*--------------------------------------------------------------
# Fade in animation
--------------------------------------------------------------*/

.fadein {
    -webkit-animation: fadeIn ease-in 1;
    -moz-animation: fadeIn ease-in 1;
    animation: fadeIn ease-in 1;
    -webkit-animation-fill-mode: forwards;
    -moz-animation-fill-mode: forwards;
    animation-fill-mode: forwards;
    -webkit-animation-duration: 1s;
    -moz-animation-duration: 1s;
    animation-duration: 1s;
}

@-webkit-keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@-moz-keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/*--------------------------------------------------------------
# Common utilities
--------------------------------------------------------------*/

.hidden {
    display: none;
}

.show {
    display: block;
}

.ml-10 {
    margin-left: 10px;
}

/*--------------------------------------------------------------
# Responsive Design
--------------------------------------------------------------*/

@media screen and (max-width: 500px) {
    #appoiint-chat-widget {
        bottom: 10px;
        right: 10px;
    }
    
    .msger-draggable {
        width: calc(100vw - 20px) !important;
        height: calc(100vh - 100px) !important;
        bottom: 80px !important;
        right: 10px !important;
        left: 10px !important;
    }
    
    #appoiint-widget-launcher {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}
