/* =========================================
   DagiDeluxe Chat - UI Refined (Distinct Login)
   ========================================= */

#dd-chat-widget-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box;
    line-height: 1.5;
}

#dd-chat-widget-wrapper * { box-sizing: border-box; outline: none; }

/* 1. Buton Plutitor */
#dd-chat-floating-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: var(--dd-primary, #0073aa);
    color: #fff;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    z-index: 9999999;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#dd-chat-floating-btn:hover { transform: scale(1.1); }

/* 2. Fereastra Principală */
#dd-chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: var(--dd-width, 380px);
    height: 600px;
    max-height: 80vh;
    background-color: #fff;
    border-radius: var(--dd-radius, 16px);
    box-shadow: 0 5px 40px rgba(0,0,0,0.16);
    z-index: 9999999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-size: 14px;
    border: 1px solid rgba(0,0,0,0.05);
}

/* Header */
.dd-chat-header {
    background: var(--dd-primary, #0073aa);
    background: linear-gradient(135deg, var(--dd-primary, #0073aa) 0%, rgba(0,0,0,0.2) 100%);
    background-blend-mode: overlay;
    color: #fff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.dd-header-info h3 { margin: 0; font-size: 16px; font-weight: 700; }
.dd-status-dot { color: #46b450; font-size: 12px; }

.dd-chat-close {
    cursor: pointer;
    opacity: 0.8;
    font-size: 18px;
    transition: opacity 0.2s;
}
.dd-chat-close:hover { opacity: 1; }

/* 3. ECRAN LOGIN (Modificat pentru a arăta ca o pagină curată) */
#dd-screen-login {
    flex: 1;
    background-color: #ffffff; /* Fundal ALB curat, fara pattern */
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centrează formularul vertical */
}

.dd-login-content {
    /* Am scos umbra si fundalul cutiei pentru ca acum tot ecranul e cutia */
    width: 100%;
}

.dd-intro-text {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.dd-input-group { margin-bottom: 18px; }

.dd-input-group label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 6px;
    font-weight: 700;
}

.dd-input-group input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #f0f2f5; /* Bordura mai groasa dar subtila */
    border-radius: 8px;
    font-size: 15px;
    background-color: #f9f9f9;
    transition: all 0.2s;
    color: #333;
}

.dd-input-group input:focus {
    border-color: var(--dd-primary, #0073aa);
    background-color: #fff;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #666;
    line-height: 1.3;
}
.checkbox-group input { margin-top: 2px; cursor: pointer; }
.checkbox-group label { cursor: pointer; }

.dd-btn-primary {
    width: 100%;
    padding: 14px;
    background-color: var(--dd-primary, #0073aa);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.1s, filter 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.dd-btn-primary:hover {
    filter: brightness(110%);
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

/* 4. ECRAN CHAT (Doar aici pastram fundalul tip Messenger) */
#dd-screen-chat {
    display: none; /* Ascuns initial */
    flex-direction: column;
    height: 100%;
}

.dd-chat-body.dd-messages-container {
    flex: 1;
    background-color: #f0f2f5; /* Fundal gri deschis */
    /* Pattern subtil doar in zona de mesaje */
    background-image: radial-gradient(#cbd3da 1px, transparent 1px);
    background-size: 20px 20px;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.dd-messages-list { display: flex; flex-direction: column; gap: 8px; }

/* Bule Mesaje */
.dd-msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.dd-msg.client {
    align-self: flex-end;
    background-color: var(--dd-primary, #0073aa);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.dd-msg.client a { color: #fff; text-decoration: underline; }

.dd-msg.operator {
    align-self: flex-start;
    background-color: #fff;
    color: #1c1e21;
    border-bottom-left-radius: 4px;
}
.dd-msg.operator a { color: #0073aa; }

.dd-msg-meta {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
    display: block;
}

.dd-system-notice {
    text-align: center;
    font-size: 12px;
    color: #888;
    margin: 10px 0;
    background: rgba(255,255,255,0.85);
    padding: 6px 12px;
    border-radius: 12px;
    align-self: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* FOOTER - ZONA DE SCRIERE */
.dd-chat-footer {
    background: #fff;
    padding: 10px;
    border-top: 1px solid #eee;
    flex-shrink: 0; /* IMPEDICA disparitia footerului daca mesajele sunt multe */
}

#dd-form-send {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: #f0f2f5;
    padding: 8px 12px;
    border-radius: 24px;
}

/* 1. Buton Upload - Latime Fixa pentru Stabilitate */
.dd-btn-upload {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #606770;
    padding: 0;
    height: 36px;
    width: 36px; /* [FIX] Latime fixa ca sa nu sara layout-ul */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    flex-shrink: 0; /* Sa nu se turteasca */
}
.dd-btn-upload:hover { color: var(--dd-primary, #0073aa); }

/* 2. Textarea (Inputul) */
#dd-msg-input {
    flex: 1;
    background: transparent;
    border: none;
    resize: none;
    max-height: 100px;
    min-height: 24px; /* [FIX] Inaltime minima garantata */
    padding: 8px 0;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    overflow-y: auto;
}

/* 3. Buton Send */
.dd-btn-send {
    background: transparent;
    border: none;
    color: var(--dd-primary, #0073aa);
    cursor: pointer;
    padding: 0;
    height: 36px;
    width: 36px; /* [FIX] Latime fixa */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.dd-btn-send:hover { transform: scale(1.1); }
.dd-btn-send svg { display: block; }