﻿#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 250px;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/*Menu*/
.form-group-sm label {
    max-width: 100%;
    margin-bottom: 1px;
    font-weight: normal;
    font-size: 12px;
    color: #225d9e;
}

a.nav-link, a.blzclick {
    cursor: pointer;
}


/*Validation*/

.field-validation-error {
    font-size: 11px;
    color: #ed5565;
}

.input-validation-error {
    border-color: #dc3545;
}
.form-control.invalid {
    border-color: #dc3545;
}

ul.validation-errors {
    padding: 10px 35px;
    border: 1px solid transparent;
    border-radius: 4px;
    background-color: #f2dede;
    border-color: #ebccd1;
}

ul > li.validation-message {
    color: #a94442;
    font-size: 13px;
}

.validation-summary-valid {
    display: none;
}

.validation-summary-errors {
    color: #ed5565;
    font-size: 13px;
}


/*tools*/

.expandToBottom {
    min-height: calc(100vh - 360px);
}

@media (max-width: 1199.98px) {
    .expandToBottom {
        min-height: calc(100vh - 440px);
    }
}


/*Modals*/
@media (min-width: 992px) {

    .modal-lg,
    .modal-xl {
        max-width: 800px;
    } 
}

@media (min-width: 1200px) {
    .modal-xl {
        max-width: 1140px;
    }
}


/*Chat Bubble*/

.chat-bubble-root {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: inherit;
}

.chat-fab {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #225d9e, #1a4a80);
    color: #fff;
    font-size: 22px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    margin-top: 12px;
}

.chat-fab:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.chat-fab-open {
    background: linear-gradient(135deg, #5a6268, #444b52);
}

.chat-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ed5565;
    color: #fff;
    font-size: 11px;
    line-height: 1;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #fff;
}

.chat-window {
    width: 340px;
    max-width: calc(100vw - 32px);
    height: 480px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.25);
    animation: chat-window-pop 0.18s ease-out;
}

@keyframes chat-window-pop {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-header {
    background: linear-gradient(135deg, #225d9e, #1a4a80);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

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

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.chat-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}

.chat-subtitle {
    font-size: 11px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #46c37b;
    display: inline-block;
}

.chat-close-btn {
    background: transparent;
    border: none;
    color: #fff;
    opacity: 0.85;
    font-size: 15px;
    cursor: pointer;
    padding: 4px 6px;
}

.chat-close-btn:hover {
    opacity: 1;
}

.chat-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 14px 12px;
    background: #f4f6f8;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-msg-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 100%;
}

.chat-msg-row-user {
    justify-content: flex-end;
}

.chat-msg-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #225d9e;
    color: #fff;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-msg-bubble {
    max-width: 75%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-msg-bot {
    background: #fff;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.chat-msg-user {
    background: #225d9e;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-msg-admin {
    background: #fff3cd;
    color: #665a1e;
    border-bottom-left-radius: 4px;
}

.chat-msg-admin-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    opacity: 0.75;
    margin-bottom: 2px;
}

.chat-msg-avatar-admin {
    background: #e8a317;
}

.chat-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 14px;
}

.chat-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #b6bfc7;
    display: inline-block;
    animation: chat-typing-bounce 1.2s infinite ease-in-out;
}

.chat-typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.chat-typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes chat-typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

.chat-action-pill {
    align-self: center;
    font-size: 11.5px;
    padding: 4px 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0 auto;
}

.chat-action-pill-ok {
    background: #e3f6ea;
    color: #1f8a4c;
}

.chat-action-pill-error {
    background: #fde8e8;
    color: #c0392b;
}

.chat-part-card {
    background: #fff;
    border: 1px solid #e8ebee;
    border-radius: 10px;
    padding: 8px 10px;
    margin: 2px 0 2px 34px;
    font-size: 12.5px;
}

.chat-part-card-title {
    font-weight: 600;
    color: #225d9e;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-part-supplier {
    padding: 6px 0;
    border-top: 1px solid #f0f2f4;
}

.chat-part-supplier:first-of-type {
    border-top: none;
}

.chat-part-supplier-name {
    font-weight: 600;
    color: #333;
}

.chat-part-desc {
    font-weight: 400;
    color: #6b7480;
    margin-left: 4px;
}

.chat-part-supplier-empty {
    color: #9aa3ad;
    font-style: italic;
}

.chat-part-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 3px 0 3px 8px;
    color: #444;
}

.chat-part-loc {
    flex: 1 1 auto;
}

.chat-part-qty {
    color: #6b7480;
}

.chat-part-price {
    font-weight: 600;
    color: #1f8a4c;
    min-width: 60px;
    text-align: right;
}

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
    background: #f4f6f8;
    border-top: 1px solid #e8ebee;
    flex-shrink: 0;
}

.chat-suggestion-chip {
    border: 1px solid #225d9e;
    color: #225d9e;
    background: #fff;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 12.5px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.chat-suggestion-chip:hover {
    background: #225d9e;
    color: #fff;
}

.chat-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
    border-top: 1px solid #e8ebee;
    flex-shrink: 0;
}

.chat-input {
    flex: 1 1 auto;
    border: 1px solid #dfe3e7;
    border-radius: 20px;
    padding: 9px 15px;
    font-size: 13.5px;
    outline: none;
}

.chat-input:focus {
    border-color: #225d9e;
}

.chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #225d9e;
    color: #fff;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: opacity 0.15s ease;
}

.chat-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .chat-bubble-root {
        right: 12px;
        bottom: 12px;
    }

    .chat-window {
        width: calc(100vw - 24px);
    }
}