/* LiveChat Widget - NitroBilisim Theme */
#livechat-widget {
    font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
}

/* Chat Bubble */
#lc-bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #f48525;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(244, 133, 37, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

#lc-bubble:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(244, 133, 37, 0.5);
}

/* Chat Window */
#lc-window {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 380px;
    max-height: 560px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(28, 20, 13, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #f4ede7;
}

#lc-window.lc-hidden {
    display: none !important;
}

/* Header */
#lc-header {
    background: #1c140d;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.lc-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lc-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f48525;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lc-agent-name {
    font-weight: 600;
    font-size: 15px;
}

.lc-status {
    font-size: 12px;
    opacity: 0.7;
}

.lc-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

#lc-close {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 6px;
    opacity: 0.7;
    transition: all 0.2s;
    border-radius: 6px;
    line-height: 0;
}

#lc-close:hover {
    opacity: 1;
    background: rgba(255,255,255,0.15);
}

#lc-end-session {
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 5px 12px;
    background: rgba(244, 133, 37, 0.85);
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

#lc-end-session:hover {
    background: rgba(244, 133, 37, 1);
}

#lc-end-session.lc-hidden {
    display: none !important;
}

/* Pre-Chat Form */
#lc-prechat {
    padding: 20px;
}

#lc-prechat.lc-hidden {
    display: none !important;
}

.lc-prechat-title {
    font-size: 14px;
    font-weight: 600;
    color: #1c140d;
    margin: 0 0 14px;
    text-align: center;
}

.lc-prechat-subtitle {
    font-size: 13px;
    font-weight: 500;
    color: #6b5d4f;
    margin: 16px 0 10px;
    text-align: center;
}

.lc-field {
    margin-bottom: 10px;
}

.lc-field input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #f4ede7;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #f8f7f5;
    color: #1c140d;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
}

.lc-field input:focus {
    border-color: #f48525;
    background: #fff;
}

.lc-field input.lc-invalid {
    border-color: #dc3545;
    background: #fff5f5;
}

.lc-dept-btn {
    display: block;
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 10px;
    background: #f8f7f5;
    border: 2px solid #f4ede7;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #1c140d;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.lc-dept-btn:hover {
    background: #f48525;
    color: #fff;
    border-color: #f48525;
}

/* Messages */
#lc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 300px;
    max-height: 380px;
    background: #f8f7f5;
}

#lc-messages.lc-hidden {
    display: none !important;
}

.lc-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.5;
}

.lc-msg-user {
    align-self: flex-end;
    background: #f48525;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.lc-msg-assistant {
    align-self: flex-start;
    background: #fff;
    color: #1c140d;
    border-bottom-left-radius: 4px;
    border: 1px solid #f4ede7;
}

.lc-msg-assistant a {
    color: #f48525;
    text-decoration: underline;
}

/* System message (session ended) */
.lc-msg-system {
    align-self: center;
    background: #f4ede7;
    color: #6b5d4f;
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 20px;
    max-width: 90%;
    text-align: center;
}

/* Product Card */
.lc-product-card {
    background: #fff;
    border: 1px solid #f4ede7;
    border-radius: 10px;
    padding: 12px;
    margin-top: 8px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.lc-product-card img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    background: #f8f7f5;
}

.lc-product-info {
    flex: 1;
    min-width: 0;
}

.lc-product-name {
    font-weight: 600;
    font-size: 13px;
    color: #1c140d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lc-product-name a {
    color: #1c140d;
    text-decoration: none;
}

.lc-product-name a:hover {
    color: #f48525;
}

.lc-product-price {
    font-weight: 700;
    color: #f48525;
    font-size: 14px;
    margin-top: 2px;
}

.lc-product-stock {
    font-size: 11px;
    color: #9a8c7c;
}

.lc-product-stock.in-stock {
    color: #28a745;
}

.lc-product-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lc-btn-cart, .lc-btn-view {
    padding: 5px 10px;
    border-radius: 6px;
    border: none;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.lc-btn-cart {
    background: #f48525;
    color: #fff;
}

.lc-btn-cart:hover {
    background: #e07a1f;
}

.lc-btn-view {
    background: #f4ede7;
    color: #1c140d;
}

.lc-btn-view:hover {
    background: #e8ddd3;
}

/* Restart Area */
.lc-restart-area {
    padding: 16px;
    text-align: center;
    border-top: 1px solid #f4ede7;
    background: #fff;
}

.lc-btn-restart {
    padding: 10px 28px;
    background: #f48525;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(244, 133, 37, 0.3);
}

.lc-btn-restart:hover {
    background: #e07a1f;
    box-shadow: 0 4px 12px rgba(244, 133, 37, 0.4);
    transform: translateY(-1px);
}

/* Typing Indicator */
#lc-typing {
    padding: 4px 16px;
    background: #f8f7f5;
}

#lc-typing.lc-hidden {
    display: none !important;
}

.lc-typing-dots {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.lc-typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #9a8c7c;
    animation: lc-bounce 1.4s infinite ease-in-out;
}

.lc-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.lc-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes lc-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Input Area */
#lc-input-area {
    border-top: 1px solid #f4ede7;
    padding: 12px;
    flex-shrink: 0;
    background: #fff;
}

#lc-input-area.lc-hidden {
    display: none !important;
}

#lc-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

#lc-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #f4ede7;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    background: #f8f7f5;
}

#lc-input:focus {
    border-color: #f48525;
    background: #fff;
}

#lc-send {
    width: 40px;
    height: 40px;
    border: none;
    background: #f48525;
    color: #fff;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

#lc-send:hover {
    background: #e07a1f;
}

#lc-send:disabled {
    background: #f4c68e;
    cursor: not-allowed;
}

/* Scrollbar */
#lc-messages::-webkit-scrollbar {
    width: 5px;
}

#lc-messages::-webkit-scrollbar-track {
    background: transparent;
}

#lc-messages::-webkit-scrollbar-thumb {
    background: #e8ddd3;
    border-radius: 3px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #livechat-widget {
        bottom: 10px;
        right: 10px;
    }

    #lc-window {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 100px);
        right: -10px;
        bottom: 70px;
        border-radius: 12px;
    }

    #lc-messages {
        max-height: calc(100vh - 280px);
    }
}
