/* ================================
   Nettleio SmartChat — Frontend UI
   Style: Glassmorphism + Dark Maroon
=================================== */

/* ——— Variables ——— */

:root {
    --sc-primary: #4A0E1F;     /* زرشکی تیره */
    --sc-primary-light: #6b1a30;
    --sc-dark: #0e0e0e;        /* مشکی تیره */
    --sc-light: #ffffff;
    --sc-glass: rgba(255, 255, 255, 0.08);
    --sc-border: rgba(255, 255, 255, 0.15);
    --sc-blur: blur(18px);
}

/* ————————————————
   FLOATING BUTTON
——————————————— */

#nettleio-sc-button {
    position: fixed;
    bottom: 22px;
    right: 22px;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--sc-primary);
    border: 1px solid var(--sc-border);
    backdrop-filter: var(--sc-blur);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    cursor: pointer;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .25s;
}

#nettleio-sc-button:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 26px rgba(0,0,0,0.5);
}

#nettleio-sc-button img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
}

/* ————————————————
   POPUP BASE STYLE
——————————————— */

.nettleio-sc-popup {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 350px;
    height: 480px;
    background: var(--sc-glass);
    border: 1px solid var(--sc-border);
    backdrop-filter: var(--sc-blur);
    box-shadow: 0 8px 25px rgba(0,0,0,.5);
    border-radius: 22px;
    overflow: hidden;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    animation: scFadeIn .35s ease-out;
}

.hidden {
    display: none !important;
}

/* Mobile full-screen mode */
@media (max-width: 480px) {
    .nettleio-sc-popup {
        width: 100%;
        height: 100%;
        right: 0;
        bottom: 0;
        border-radius: 0;
    }
}

/* ————————————————
   HEADER
——————————————— */

.nettleio-sc-header {
    background: rgba(0,0,0,.4);
    padding: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--sc-border);
}

.nettleio-sc-header .left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nettleio-sc-header .logo {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--sc-border);
}

.nettleio-sc-header .info {
    color: #fff;
    display: flex;
    flex-direction: column;
}

.nettleio-sc-header .info .name {
    font-weight: 600;
}

.nettleio-sc-header .info .status {
    font-size: 12px;
    opacity: 0.8;
}

.status.online {
    color: #3fcf45;
}
.status.offline {
    color: #e03a3a;
}

.close-btn {
    background: transparent;
    border: none;
    font-size: 25px;
    color: #fff;
    cursor: pointer;
    transition: .2s;
}
.close-btn:hover {
    opacity: 0.8;
}

/* ————————————————
   WELCOME SCREEN
——————————————— */

#nettleio-sc-welcome .nettleio-sc-body {
    padding: 25px;
    text-align: center;
    color: #fff;
}

.welcome-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 14px;
}

.start-chat-btn {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    background: var(--sc-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 17px;
    margin-top: 25px;
    transition: .3s;
}

.start-chat-btn:hover {
    background: var(--sc-primary-light);
}

/* ————————————————
   ONLINE CHAT MESSAGES
——————————————— */

.nettleio-sc-messages {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    color: #fff;
    scroll-behavior: smooth;
}

.message-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 15px;
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.6;
}

.message-user {
    background: var(--sc-light);
    color: #222;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message-agent {
    background: var(--sc-primary-light);
    color: #fff;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message-ai {
    background: #333;
    color: #fff;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    opacity: .85;
}

.time {
    font-size: 11px;
    margin-top: 4px;
    opacity: 0.6;
}

/* ————————————————
   INPUT BAR
——————————————— */

.nettleio-sc-input {
    display: flex;
    align-items: center;
    padding: 12px;
    background: rgba(0,0,0,.35);
    border-top: 1px solid var(--sc-border);
}

.nettleio-sc-input input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--sc-border);
    background: rgba(255,255,255,.08);
    color: #fff;
    outline: none;
}

.nettleio-sc-input button {
    background: var(--sc-primary);
    border-radius: 12px;
    padding: 10px 14px;
    margin-left: 10px;
    cursor: pointer;
    border: none;
}

.nettleio-sc-input button img {
    width: 18px;
    filter: brightness(0) invert(1);
}

/* ————————————————
   OFFLINE SCREEN
——————————————— */

#nettleio-sc-chat-offline .offline-text {
    color: #fff;
    padding: 20px;
    font-size: 15px;
    opacity: .9;
}

/* ————————————————
   SCROLL CUSTOM
——————————————— */
.nettleio-sc-messages::-webkit-scrollbar {
    width: 5px;
}
.nettleio-sc-messages::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.25);
    border-radius: 10px;
}
