/**
 * WP Live Chat Frontend Widget Stylesheet
 */

#wplc-widget-root {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    box-sizing: border-box;
}

#wplc-widget-root * {
    box-sizing: border-box;
}

/* Stânga vs Dreapta Positioning (Bottom Right vs Bottom Left) */
#wplc-widget-root.wplc-pos-right {
    bottom: 20px;
    right: 20px;
    left: auto;
}

#wplc-widget-root.wplc-pos-right .wplc-window-box {
    right: 0;
    left: auto;
}

#wplc-widget-root.wplc-pos-left {
    bottom: 20px;
    left: 20px;
    right: auto;
}

#wplc-widget-root.wplc-pos-left .wplc-window-box {
    left: 0;
    right: auto;
}

/* Floating Action Launch Button */
.wplc-btn-launch {
    background-color: var(--wplc-primary, #2271b1);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s;
}

.wplc-btn-launch:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.22);
}

.wplc-btn-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Chat Window Box */
.wplc-window-box {
    display: none;
    position: absolute;
    bottom: 60px;
    width: 360px;
    height: 500px;
    max-height: calc(100vh - 100px);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.08);
}

.wplc-window-box.wplc-is-open {
    display: flex;
    animation: wplcFadeInUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes wplcFadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header */
.wplc-win-header {
    background-color: var(--wplc-primary, #2271b1);
    color: #ffffff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wplc-win-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
}

.wplc-win-status {
    font-size: 11px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.wplc-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
}

.wplc-btn-close {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    opacity: 0.8;
}
.wplc-btn-close:hover { opacity: 1; }

/* Stream Area */
.wplc-stream-area {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wplc-chat-bubble {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.45;
    word-break: break-word;
}

/* Stânga vs Dreapta in Frontend Chat Window */
.wplc-bubble-visitor {
    align-self: flex-end;
    background-color: var(--wplc-primary, #2271b1);
    color: #ffffff;
    border-bottom-right-radius: 2px;
}

.wplc-bubble-operator {
    align-self: flex-start;
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 2px;
}

.wplc-bubble-system {
    align-self: center;
    background: #edf2f7;
    color: #64748b;
    font-size: 11px;
    text-align: center;
    border-radius: 20px;
    padding: 4px 10px;
}

/* Footer Input */
.wplc-win-footer {
    padding: 10px 12px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
    display: flex;
    gap: 8px;
}

.wplc-win-footer textarea {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px;
    font-size: 13px;
    resize: none;
    font-family: inherit;
    outline: none;
}
.wplc-win-footer textarea:focus {
    border-color: var(--wplc-primary, #2271b1);
}

.wplc-btn-send-vis {
    background-color: var(--wplc-primary, #2271b1);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 0 14px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
}

/* Pre-chat Form */
.wplc-prechat-form,
.wplc-offline-form {
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #ffffff;
    height: 100%;
}
.wplc-prechat-form input,
.wplc-offline-form input,
.wplc-offline-form textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
}

@media (max-width: 480px) {
    .wplc-window-box {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
}
