/* ChatSWA Public Styles */

#chatswa-chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2147483647 !important;
}

#chatswa-chat-bubble {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

#chatswa-chat-bubble .closed {
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

#chatswa-chat-bubble:after {
    content: "\f075"; 
    font-family: 'FontAwesome';
    font-size: 24px;
    color: #fff;
}

#chatswa-chat-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 450px;
    max-width: 90vw;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: none;
}

#chatswa-chat-window.open {
    display: block;
    animation-duration: 0.3s;
}

#chatswa-chat-log {
    height: 450px;
    overflow-y: auto;
    padding: 10px;
    background: #f9f9f9;
    border: none;
}

.chatswa-message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    max-width: 80%;
    clear: both;
    font-size: 16px;
    white-space: pre-line;
}


.user-message {
    background-color: var(--chatswa-theme-primary);
    color: #fff;
    float: right;
}

.bot-message {
    background-color: #e5e5e5;
    color: #333;
}



#chatswa-message {
    flex: 1;
    padding: 8px;
    border: none;
    border-bottom: 1px solid #ccc;
    /* border-radius: 4px; */
}




.fade-animation {
    animation-name: fadeIn;
}

.slide-animation {
    animation-name: slideIn;
}

.zoom-animation {
    animation-name: zoomIn;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

@keyframes zoomIn {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}



#chatswa-chat-form {
    border-top: 1px solid #ebebeb;
    padding: 12px 15px;
    background: #fff;
    display: flex;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.01);
}

.input-wrapper { 
    display: flex;
    flex-grow: 1; 
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    background: #f9f9f9;
    transition: all 0.2s ease;
}

.input-wrapper:focus-within {
    border-color: var(--chatswa-theme-primary);
    background: #fff;
    box-shadow: 0 0 0 2px rgba(139, 90, 43, 0.08);
}

#chatswa-message {
    flex-grow: 1; 
    padding: 11px 15px;
    border: none !important;
    border-radius: 0; 
    box-sizing: border-box; 
    background: transparent;
    font-size: 15px;
    line-height: 1.4;
    resize: none;
    height: 45px;
    min-height: 45px;
    max-height: 100px;
    outline: none !important;
    font-family: inherit;
    transition: background-color 0.2s ease;
    overflow-y: hidden;
}

#chatswa-message:hover {
    background: rgba(0,0,0,0.01);
}

#chatswa-message:focus {
    background: transparent;
}

#chatswa-send-btn {
    width: 45px;
    height: 45px;
    min-width: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background-color: var(--chatswa-theme-primary);
    color: #fff;
    border: none;
    border-radius: 0; 
    cursor: pointer;
    margin: 0;
    transition: background-color 0.2s ease;
    align-self: flex-end;
}

#chatswa-send-btn svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
    fill: none;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#chatswa-send-btn:hover svg {
    transform: translate(2px, -2px) scale(1.05);
}

.search-results {
    list-style: none;
    padding: 0;
    /* margin-left: 4px; */
    /* margin: 0; */
    margin-top: 4px;
}

.search-results li {
    margin-bottom: 7px;
    /* border: 1px solid; */
}

.search-results a {
    display: inline-block;
    padding: 2px 6px;
    background-color: #edf6ff;
    border-radius: 4px;
    text-decoration: none;
    color: #424242;
    transition: background-color 0.3s ease;
    font-size: 14px;
    border: 1px solid #a4e0fb;
}

.search-results a:hover {
    background-color: #e0e0e0; 
}

.bot-message {
    background-color: #e5e5e5;
    color: #333;
    clear: both; 
}

.bot-message .search-results { 
    margin-top: 10px;
    padding-left: 15px; 
}

.chatswa-message-container {
    position: relative;
    float: left;
}

.chatswa-more {
    margin: 0;
    padding: 0;
    font-size: 14px;
    font-weight: bold;
}

.chatswa-message-container {
    opacity: 0;
    transform: translateY(20px); 
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.chatswa-message-container.show {
    opacity: 1;
    transform: translateY(0);
}

.chatswa-loader {
    width: 40px;
    aspect-ratio: 2;
    --_g: no-repeat radial-gradient(circle closest-side, #ccc 90%, #fff); /* Changed color to light gray (#ccc) */
    background: 
        var(--_g) 0%    50%,
        var(--_g) 50%   50%,
        var(--_g) 100% 50%;
    background-size: calc(100%/3) 50%;
    animation: l3 1s infinite linear;
}

@keyframes l3 {
    20% { background-position: 0%    0%, 50%   50%, 100%  50%; }
    40% { background-position: 0% 100%, 50%    0%, 100%  50%; }
    60% { background-position: 0%   50%, 50% 100%, 100%   0%; }
    80% { background-position: 0%   50%, 50%   50%, 100% 100%; }
}

/* Markdown Parsed Elements Styling */
.bot-message p {
    margin: 0 0 8px 0;
}
.bot-message p:last-child {
    margin-bottom: 0;
}
.bot-message ul, .bot-message ol {
    margin: 8px 0 8px 0;
    padding-left: 24px;
    list-style-type: disc;
}
.bot-message li {
    margin-bottom: 4px;
}
.bot-message a {
    color: #0073aa;
    text-decoration: underline;
    word-break: break-all;
}
.bot-message a:hover {
    color: #005177;
}
.bot-message strong {
    font-weight: 600;
}

/* Product Card Styling */
.chatswa-product-card {
    display: flex;
    flex-direction: row;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    gap: 12px;
    align-items: center;
}

.chatswa-product-image {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatswa-product-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.chatswa-product-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block;
    margin: 0 !important;
    padding: 0 !important;
}

.chatswa-product-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chatswa-product-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}

.chatswa-product-title a {
    color: #333;
    text-decoration: none !important;
}

.chatswa-product-title a:hover {
    color: var(--chatswa-theme-primary);
}

.chatswa-product-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--chatswa-theme-primary);
}

.chatswa-product-price ins {
    text-decoration: none;
}

.chatswa-product-price del {
    color: #999;
    font-weight: 400;
    font-size: 12px;
    margin-right: 4px;
}

.chatswa-btn-view {
    display: inline-block;
    padding: 6px 12px;
    background-color: var(--chatswa-theme-primary);
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    align-self: flex-start;
    margin-top: 4px;
    transition: filter 0.2s;
}

.chatswa-btn-view:hover {
    color: #fff !important;
    filter: brightness(0.9);
}

/* Premium Zaglavlje (Header) Stilovi */
#chatswa-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #fff;
    border-bottom: 1px solid #ebebeb;
    position: relative;
    z-index: 10006;
}

.chatswa-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatswa-header-logo-container {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: #f7f5f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e8e3d9;
    flex-shrink: 0;
}

#chatswa-header-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.chatswa-header-logo-placeholder {
    font-size: 16px;
    font-weight: 700;
    color: var(--chatswa-theme-primary, #8b5a2b);
    font-family: 'Outfit', 'Inter', sans-serif;
}

.chatswa-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chatswa-header-title {
    font-size: 15px;
    font-weight: 700;
    color: #2c2c2c;
    font-family: 'Outfit', 'Inter', sans-serif;
    line-height: 1.2;
}

.chatswa-header-status {
    font-size: 11px;
    color: #757575;
    display: flex;
    align-items: center;
    gap: 5px;
    line-height: 1;
}

/* Online status indicator s pulsirajućim efektom */
.chatswa-status-dot {
    width: 7px;
    height: 7px;
    background-color: #2ec866;
    border-radius: 50%;
    display: inline-block;
    position: relative;
}

.chatswa-status-dot::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #2ec866;
    animation: chatswa-pulse 1.8s infinite ease-in-out;
}

@keyframes chatswa-pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(2.5); opacity: 0; }
}

#chatswa-close-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    margin: 0;
    box-shadow: none;
    position: static;
}

#chatswa-close-btn:hover {
    background: #f5f5f5;
    color: #2c2c2c;
    transform: scale(1.05);
    box-shadow: none;
}

#chatswa-close-btn svg {
    display: block;
    width: 16px;
    height: 16px;
}

/* Suggested Prompts (Predložena pitanja) Stilovi */
#chatswa-suggested-prompts-container {
    padding: 12px;
    background: #fff;
    border: 1px solid #f0ebe0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(139, 90, 43, 0.05);
}

.chatswa-suggested-title {
    font-size: 12px;
    font-weight: 700;
    color: #8b5a2b; /* topla smeđa brand boja */
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chatswa-suggested-title-icon {
    font-size: 14px;
}

.chatswa-suggested-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chatswa-suggested-btn {
    background: #faf8f5;
    border: 1px solid #e8dfd3;
    color: #664d34;
    padding: 10px 14px;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    width: 100%;
    font-family: inherit;
    line-height: 1.3;
}

.chatswa-suggested-btn:hover {
    background: #f3edd8;
    border-color: #d6c3a6;
    color: #4d3822;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(139, 90, 43, 0.08);
}

.chatswa-suggested-btn:active {
    transform: translateY(0);
}

/* Disclaimer / Notice s Tooltipom */
.chatswa-notice-container {
    position: relative;
    padding: 8px 10px;
    border-top: 1px solid #ebebeb;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10005;
}

.chatswa-notice-trigger {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #999;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
    font-family: inherit;
    font-weight: 500;
}

.chatswa-notice-trigger:hover {
    color: #666;
}

.chatswa-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    width: 14px;
    height: 14px;
    transition: color 0.2s;
}

.chatswa-notice-trigger:hover .chatswa-info-icon {
    color: #777;
}

.chatswa-info-icon svg {
    width: 12px;
    height: 12px;
}

.chatswa-notice-tooltip {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: rgba(40, 40, 40, 0.95);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.4;
    white-space: normal;
    box-sizing: border-box;
    width: calc(100% - 24px);
    max-width: calc(100% - 24px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10010;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.08);
}

.chatswa-notice-tooltip a {
    color: #a8cdff;
    text-decoration: underline;
}

.chatswa-notice-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(40, 40, 40, 0.95);
}

.chatswa-notice-container:hover .chatswa-notice-tooltip,
.chatswa-notice-tooltip.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* Poboljšani stilovi za chat-window kontejner */
#chatswa-chat-window {
    width: 400px;
    bottom: 80px;
    border-radius: 12px;
    border: 1px solid #eaeaea;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
}

/* Mobilna Responzivnost (Full-screen) */
@media (max-width: 768px) {
    #chatswa-chat-container {
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        pointer-events: none;
    }
    
    #chatswa-chat-bubble {
        bottom: 20px;
        right: 20px;
        pointer-events: auto;
    }
    
    #chatswa-chat-window {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100% !important;
        max-height: 100% !important;
        border: none;
        border-radius: 0;
        display: none;
        flex-direction: column;
        z-index: 10009;
        pointer-events: auto;
        box-shadow: none;
    }
    
    #chatswa-chat-window.open {
        display: flex !important;
    }
    
    #chatswa-chat-log {
        flex: 1;
        height: auto !important;
        padding: 15px;
    }
    
    #chatswa-chat-header {
        padding: 15px 20px;
        border-radius: 0;
    }
    
    #chatswa-chat-form {
        padding: 10px;
        background: #fff;
    }
    
    #chatswa-message {
        height: 50px !important;
        font-size: 16px !important; /* sprječava automatsko zumiranje na iOS-u */
    }
    
    #chatswa-send-btn {
        width: 50px !important;
        height: 50px !important;
    }
    
    .chatswa-notice-tooltip {
        width: 90%;
        white-space: normal;
    }
}

/* Premium Stilizacija sučelja za slanje transkripta na e-mail */
.chatswa-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

#chatswa-email-toggle-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    margin: 0;
    box-shadow: none;
}

#chatswa-email-toggle-btn:hover {
    background: #f5f5f5;
    color: #2c2c2c;
    transform: scale(1.05);
}

#chatswa-email-toggle-btn.active {
    background: rgba(0, 0, 0, 0.05);
    color: var(--chatswa-theme-primary);
}

#chatswa-email-toggle-btn svg {
    display: block;
    width: 16px;
    height: 16px;
}

#chatswa-email-panel {
    position: absolute;
    top: 68px; /* Pozicionirano neposredno ispod zaglavlja */
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10007;
    border-bottom: 1px solid #eaeaea;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(-15px);
    pointer-events: none;
}

#chatswa-email-panel.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.chatswa-email-panel-content {
    padding: 15px 20px;
}

.chatswa-email-panel-content h4 {
    margin: 0 0 6px 0;
    font-size: 14px;
    font-weight: 700;
    color: #2c2c2c;
    font-family: 'Outfit', 'Inter', sans-serif;
}

.chatswa-email-panel-content p {
    margin: 0 0 12px 0;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.chatswa-email-input-wrapper {
    display: flex;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    background: #fff;
    transition: all 0.2s ease;
}

.chatswa-email-input-wrapper:focus-within {
    border-color: var(--chatswa-theme-primary);
    box-shadow: 0 0 0 2px rgba(139, 90, 43, 0.08);
}

#chatswa-email-input {
    flex-grow: 1;
    padding: 8px 12px;
    border: none !important;
    outline: none !important;
    background: transparent;
    font-size: 13.5px;
    height: 36px;
    box-sizing: border-box;
    font-family: inherit;
}

#chatswa-email-submit-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--chatswa-theme-primary);
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    transition: background-color 0.2s;
}

#chatswa-email-submit-btn:hover {
    filter: brightness(0.9);
}

#chatswa-email-submit-btn svg {
    width: 14px;
    height: 14px;
    stroke: #fff;
    fill: none;
}

.chatswa-email-status {
    margin-top: 8px;
    font-size: 11.5px;
    font-weight: 500;
    min-height: 16px;
    transition: all 0.2s ease;
}

.chatswa-email-status.success {
    color: #2ec866;
}

.chatswa-email-status.error {
    color: #d63638;
}

.chatswa-email-status.loading {
    color: #666;
}

/* Premium stilovi za inline formu za slanje transkripta na e-mail */
.chatswa-email-offer-container {
    background-color: #faf8f5;
    border: 1px solid #e8dfd3;
    border-radius: 8px;
    padding: 12px;
    margin: 8px 0;
    box-shadow: 0 4px 10px rgba(139, 90, 43, 0.05);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chatswa-email-offer-container p {
    margin: 0 0 4px 0 !important;
    font-size: 13px !important;
    font-weight: 500;
    color: #4d3822;
    line-height: 1.4;
}

.chatswa-inline-email-form {
    display: flex;
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
}

.chatswa-email-input-wrapper {
    display: flex;
    width: 100%;
    border-radius: 6px;
    border: 1px solid #d6c3a6;
    overflow: hidden;
    background: #fff;
    transition: all 0.2s ease;
}

.chatswa-email-input-wrapper:focus-within {
    border-color: var(--chatswa-theme-primary);
    box-shadow: 0 0 0 2px rgba(139, 90, 43, 0.08);
}

.chatswa-inline-email-input {
    flex-grow: 1;
    border: none !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    height: 36px !important;
    outline: none !important;
    background: transparent !important;
    box-sizing: border-box !important;
    color: #333 !important;
    font-family: inherit;
}

.chatswa-inline-email-submit-btn {
    width: 38px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--chatswa-theme-primary);
    color: #fff;
    border: none !important;
    cursor: pointer;
    margin: 0 !important;
    padding: 0 !important;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.chatswa-inline-email-submit-btn:hover {
    filter: brightness(0.9);
}

.chatswa-inline-email-submit-btn svg {
    width: 14px;
    height: 14px;
    stroke: #fff;
    fill: none;
}

.chatswa-inline-email-status {
    font-size: 11px;
    font-weight: 500;
    min-height: 14px;
    transition: all 0.2s ease;
}

.chatswa-inline-email-status.success {
    color: #2ec866;
}

.chatswa-inline-email-status.error {
    color: #d63638;
}

.chatswa-inline-email-status.loading {
    color: #666;
}

/* Premium stilovi za brze gumbe (Da/Ne) kod neaktivnosti */
.chatswa-inactivity-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    width: 100%;
}

.chatswa-inactivity-btn {
    flex: 1;
    background: #fff;
    border: 1px solid #d6c3a6;
    color: #664d34;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    display: inline-block;
    font-family: inherit;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chatswa-inactivity-btn:hover {
    background: var(--chatswa-theme-primary);
    border-color: var(--chatswa-theme-primary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(139, 90, 43, 0.1);
}

.chatswa-inactivity-btn:active {
    transform: translateY(0);
}