#ezc-widget-container,
#ezc-widget-container * {
    box-sizing: border-box;
}

#ezc-widget-container {
    position: fixed;
    bottom: var(--ezc-bottom);
    bottom: max(var(--ezc-bottom), 96px);
    width: 60px;
    height: 60px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Positioning rules */
#ezc-widget-container.ezc-right {
    right: var(--ezc-side);
    right: max(var(--ezc-side), 16px);
}
#ezc-widget-container.ezc-left {
    left: var(--ezc-side);
    left: max(var(--ezc-side), 16px);
}

/* Auto Popup Styling */
#ezc-auto-popup {
    position: absolute;
    bottom: 76px;
    background: var(--ezc-bg-dark, #111);
    color: var(--ezc-text-light, #fff);
    padding: 11px 14px;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.28);
    white-space: normal;
    max-width: min(280px, calc(100vw - 36px));
    width: max-content;
    font-size: 14px;
    font-weight: 650;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    border: 1px solid rgba(255,255,255,0.14);
    border-bottom: 3px solid var(--ezc-primary, #FFE300);
    text-align: left;
    line-height: 1.35;
    transform: translateY(6px);
    z-index: 1000000;
}

#ezc-auto-popup::after {
    content: "";
    position: absolute;
    bottom: -8px;
    width: 14px;
    height: 14px;
    background: var(--ezc-bg-dark, #111);
    border-right: 1px solid rgba(255,255,255,0.14);
    border-bottom: 1px solid rgba(255,255,255,0.14);
    transform: rotate(45deg);
}

#ezc-auto-popup.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

#ezc-widget-container.ezc-right #ezc-auto-popup {
    right: 0 !important;
    left: auto !important;
}
#ezc-widget-container.ezc-right #ezc-auto-popup::after {
    right: 22px;
}

#ezc-widget-container.ezc-left #ezc-auto-popup {
    left: 0 !important;
    right: auto !important;
}
#ezc-widget-container.ezc-left #ezc-auto-popup::after {
    left: 22px;
}

/* Floating Trigger Button */
#ezc-trigger-btn {
    position: relative;
    width: 60px;
    height: 60px;
    background: var(--ezc-primary);
    color: var(--ezc-text-dark);
    border-radius: 50%;
    text-align: center;
    line-height: 60px;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,0.38);
    transition: transform 0.2s, box-shadow 0.2s;
}
#ezc-trigger-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 8px 24px rgba(0,0,0,0.45);
}

/* Main Window */
#ezc-window {
    display: none;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: min(560px, calc(100vh - 190px));
    min-height: 320px;
    max-height: calc(100vh - 190px);
    background: var(--ezc-panel-bg);
    border: 1px solid #333;
    border-radius: 14px;
    box-shadow: 0 10px 34px rgba(0,0,0,0.58);
    position: absolute;
    bottom: 78px;
    overflow: hidden;
    flex-direction: column;
}
#ezc-widget-container.ezc-right #ezc-window { right: 0; }
#ezc-widget-container.ezc-left #ezc-window { left: 0; }
#ezc-widget-container.ezc-open #ezc-window { display: flex; }

/* Header */
.ezc-header {
    background: var(--ezc-bg-dark);
    color: var(--ezc-primary);
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    font-size: 16px;
    border-bottom: 2px solid var(--ezc-primary);
}
.ezc-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
#ezc-reset-chat {
    color: var(--ezc-text-light);
    font-size: 12px;
    text-decoration: none;
    opacity: 0.78;
}
#ezc-reset-chat:hover {
    color: var(--ezc-primary);
    opacity: 1;
}
#ezc-close {
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    color: var(--ezc-text-light);
}
#ezc-close:hover { color: var(--ezc-primary); }

/* Tabs */
.ezc-tabs {
    display: flex;
    background: var(--ezc-bg-dark);
}
.ezc-tab-btn {
    flex: 1;
    border: none;
    background: none;
    padding: 12px;
    cursor: pointer;
    font-weight: 600;
    color: #888;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.ezc-tab-btn.active {
    color: var(--ezc-primary);
    border-bottom: 2px solid var(--ezc-primary);
    background: var(--ezc-panel-bg);
}

/* Chat Body */
.ezc-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--ezc-text-light);
}
.ezc-panel {
    display: none;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
    padding: 15px;
}
.ezc-panel.active {
    display: flex;
}

/* Messages */
#ezc-chat-box {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    margin-bottom: 10px;
    padding-right: 5px;
}
.ezc-msg {
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 12px;
    max-width: 88%;
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.ezc-msg.system, .ezc-msg.ai {
    background: var(--ezc-msg-ai);
    color: var(--ezc-text-light);
    align-self: flex-start;
    margin-right: auto;
    border-left: 3px solid var(--ezc-primary);
}
.ezc-msg.user {
    background: var(--ezc-primary);
    color: var(--ezc-text-dark);
    align-self: flex-end;
    margin-left: auto;
    text-align: right;
    font-weight: 600;
}

/* Inputs */
.ezc-input-wrapper {
    display: flex;
    padding-top: 10px;
}
#ezc-input {
    flex: 1;
    min-width: 0;
    padding: 12px;
    background: var(--ezc-bg-dark);
    color: var(--ezc-text-light);
    border: 1px solid #444;
    border-radius: 8px;
    outline: none;
}
#ezc-input:focus { border-color: var(--ezc-primary); }
#ezc-send {
    background: var(--ezc-primary);
    color: var(--ezc-text-dark);
    border: none;
    font-weight: bold;
    padding: 0 15px;
    margin-left: 8px;
    border-radius: 8px;
    cursor: pointer;
}
#ezc-send:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Links Tab */
.ezc-links-container p {
    color: #ccc;
    font-size: 14px;
    line-height: 1.5;
}
.ezc-links-container .ezc-btn {
    display: block;
    text-align: center;
    padding: 14px;
    margin: 12px 0;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    letter-spacing: 0.5px;
}
.ezc-btn.wa { background: #25D366; color: #fff; }
.ezc-btn.fb { background: #1877F2; color: #fff; }
.ezc-btn.email { background: #555555; color: #fff; }

/* Reviews Tab Styling */
#ezc-tab-reviews {
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

#ezc-reviews-content {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    display: block;
    overflow-y: auto !important;
    overflow-x: hidden;
    padding: 15px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}

.ezc-master-rating {
    text-align: center;
    padding: 14px 0;
    border-bottom: 1px solid #333;
    margin-bottom: 12px;
}
.ezc-master-rating h2 {
    font-size: 28px;
    margin: 0 0 5px 0;
    color: var(--ezc-text-light);
}
.ezc-master-rating p {
    margin: 0;
    font-size: 13px;
    color: #aaa;
}
.ezc-stars, .ezc-rev-stars {
    color: var(--ezc-primary);
    font-size: 16px;
}
.ezc-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: visible !important;
    padding-bottom: 18px;
}
.ezc-review-card {
    flex: 0 0 auto;
    background: #222;
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid var(--ezc-primary);
}
.ezc-rev-header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--ezc-primary);
}
.ezc-rev-body {
    font-size: 13px;
    line-height: 1.45;
    color: #ccc;
    overflow-wrap: anywhere;
}


.ezc-review-warning {
    border-left-color: #ffcc00;
    background: rgba(255, 227, 0, 0.08);
}

/* Typing Indicator */
.ezc-typing-pulse {
    font-weight: bold;
    font-size: 18px;
    letter-spacing: 2px;
    animation: ezc-pulse 1.2s infinite;
}
@keyframes ezc-pulse {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

@media (max-width: 480px) {
    #ezc-widget-container {
        bottom: var(--ezc-bottom);
        bottom: max(var(--ezc-bottom), 88px);
    }

    #ezc-widget-container.ezc-right {
        right: 14px;
    }

    #ezc-widget-container.ezc-left {
        left: 14px;
    }

    #ezc-window {
        width: calc(100vw - 28px);
        height: min(540px, calc(100vh - 178px));
        max-height: calc(100vh - 178px);
    }

    #ezc-auto-popup {
        max-width: min(260px, calc(100vw - 36px));
        font-size: 13px;
    }
}

