/* ===================================
   Floating Chatbot Button & Widget
   Bamboo Igralni Kotiček
==================================== */

/* ===================================
   Floating Chat Button
==================================== */
.floating-chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #6f8467; /* Forest Sage */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(111, 132, 103, 0.4);
    z-index: 10001;
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.floating-chat-button:hover {
    background-color: #E1C6C0; /* Soft Peach */
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(225, 198, 192, 0.5);
}

.floating-chat-button:active {
    transform: scale(0.95);
}

.floating-chat-button i {
    font-size: 28px;
    color: #FFFFFF;
}

/* Pulse animation for attention */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 12px rgba(111, 132, 103, 0.4);
    }
    50% {
        box-shadow: 0 4px 12px rgba(111, 132, 103, 0.4), 0 0 0 10px rgba(111, 132, 103, 0.1);
    }
    100% {
        box-shadow: 0 4px 12px rgba(111, 132, 103, 0.4);
    }
}

.floating-chat-button.pulse {
    animation: pulse 2s infinite;
}

/* Hide button when widget is open (optional) */
.floating-chat-button.hidden {
    transform: scale(0);
    pointer-events: none;
}

/* ===================================
   Chat Widget Backdrop
==================================== */
.chat-widget-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.chat-widget-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* ===================================
   Chat Widget Container
==================================== */
.chat-widget {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: #FFFFFF;
    border-radius: 15px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 10002;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.chat-widget.open {
    transform: translateX(0);
}

/* ===================================
   Chat Widget Header
==================================== */
.chat-widget-header {
    background-color: #6f8467; /* Forest Sage */
    color: #FFFFFF;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 15px 15px 0 0;
}

.chat-widget-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-widget-logo {
    width: 35px;
    height: 35px;
    background-color: #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #6f8467;
    font-size: 16px;
}

.chat-widget-title {
    display: flex;
    flex-direction: column;
    color: #e0e0e0 !Important;
}

.chat-widget-title h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    color: #e0e0e0 !Important;
}

.chat-widget-title p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
    font-family: 'Roboto', sans-serif;
    color: #e0e0e0 !Important;
}

.chat-widget-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-widget-fullscreen {
    background: transparent;
    border: none;
    color: #FFFFFF;
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.chat-widget-fullscreen:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.chat-widget-fullscreen i {
    pointer-events: none;
}

.chat-widget-close {
    background: transparent;
    border: none;
    color: #FFFFFF;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.chat-widget-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* ===================================
   Chat Messages Area
==================================== */
.chat-widget-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-widget-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-widget-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-widget-messages::-webkit-scrollbar-thumb {
    background: #6f8467;
    border-radius: 3px;
}

.chat-widget-messages::-webkit-scrollbar-thumb:hover {
    background: #5a6d55;
}

/* ===================================
   Message Bubbles
==================================== */
.chat-message {
    display: flex;
    margin-bottom: 10px;
    animation: fadeInMessage 0.3s ease;
}

@keyframes fadeInMessage {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.bot {
    justify-content: flex-start;
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-message-bubble {
    /*max-width: 98%;*/
    padding: 10px 14px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.4;
    font-family: 'Roboto', sans-serif;
    word-wrap: break-word;
    box-sizing: border-box;
}

.chat-message.bot .chat-message-bubble {
    background-color: #FFFFFF;
    color: #59514B;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
    text-align: left;
}

.chat-message.user .chat-message-bubble {
    background-color: #6f8467; /*#E1C6C0;  Soft Peach */
    color:#FFFFFF;/* #59514B;*/
    border-bottom-right-radius: 4px;
    width: fit-content;
    text-align: right;
}

.chat-message-time {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 4px;
    font-family: 'Roboto', sans-serif;
}

.chat-message.bot .chat-message-time {
    text-align: left;
}

.chat-message.user .chat-message-time {
    text-align: right;
}

/* Welcome message */
.chat-welcome-message {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #59514B;
    font-size: 13px;
    padding: 15px;
    background-color: #fff;
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px dashed #6f8467;
}

.chat-welcome-icon {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
}

.chat-welcome-text {
    flex: 1;
    text-align: left;
    line-height: 1.5;
}

/* Typing indicator */
.chat-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background-color: #FFFFFF;
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    border-bottom-left-radius: 4px;
    max-width: 60px;
}

.chat-typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: #6f8467;
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite;
}

.chat-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingAnimation {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* ===================================
   Chat Input Form
==================================== */
.chat-widget-input {
    padding: 15px 20px;
    background-color: #FFFFFF;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-widget-input input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    outline: none;
    transition: border-color 0.2s ease;
}

.chat-widget-input input:focus {
    border-color: #6f8467;
}

.chat-widget-input input::placeholder {
    color: #999;
}

.chat-widget-send-button {
    width: 40px;
    height: 40px;
    background-color: #6f8467; /* Forest Sage */
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-widget-send-button:hover {
    background-color: #5a6d55;
    transform: scale(1.05);
}

.chat-widget-send-button:active {
    transform: scale(0.95);
}

.chat-widget-send-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: scale(1);
}

.chat-widget-send-button i {
    color: #FFFFFF;
    font-size: 18px;
}

/* ===================================
   Fullscreen State
==================================== */
.chat-widget.fullscreen {
    height: calc(100vh - 180px) !important;
    max-height: calc(100vh - 180px) !important;
    bottom: 90px !important;
    transition: height 0.5s ease, max-height 0.5s ease, width 0.5s ease;
}

/* Desktop fullscreen - povečaj širino za 40% */
@media (min-width: 768px) {
    .chat-widget.fullscreen {
        width: 490px;
    }
}

/* Tablet fullscreen - ohrani širino */
@media (max-width: 767.98px) and (min-width: 480px) {
    .chat-widget.fullscreen {
        width: 320px;
    }
}

/* Mobile fullscreen - ohrani širino */
@media (max-width: 479.98px) {
    .chat-widget.fullscreen {
        width: calc(100% - 20px);
        left: 10px;
        right: 10px;
    }
}

/* ===================================
   IFrame Chat Widget
==================================== */
.chat-widget-iframe {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    border-radius: 15px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    overflow: hidden;
    border: none;
}

.chat-widget-iframe.open {
    transform: translateX(0);
}

.chat-widget-iframe iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 15px;
}

/* ===================================
   Responsive Design
==================================== */

/* Tablet */
@media (max-width: 767.98px) {
    .chat-widget {
        width: 320px;
        height: 450px;
        bottom: 90px;
        right: 15px;
    }

    .floating-chat-button {
        bottom: 15px;
        right: 15px;
        width: 55px;
        height: 55px;
    }

    .floating-chat-button i {
        font-size: 26px;
    }
}

/* Mobile */
@media (max-width: 479.98px) {
    .chat-widget {
        width: calc(100% - 20px);
        height: 70vh;
        max-height: 500px;
        bottom: 80px;
        right: 10px;
        left: 10px;
    }

    .floating-chat-button {
        bottom: 10px;
        right: 10px;
        width: 50px;
        height: 50px;
    }

    .floating-chat-button i {
        font-size: 24px;
    }

    .chat-widget-messages {
        padding: 15px;
    }

    .chat-message-bubble {
        /*max-width: 98%;*/
        font-size: 13px;
    }

    .chat-widget-input {
        padding: 12px 15px;
    }
}

/* Landscape mobile fix */
@media (max-width: 767.98px) and (max-height: 500px) {
    .chat-widget {
        height: 85vh;
        max-height: 400px;
    }
}

/* ===================================
   Accessibility
==================================== */
.floating-chat-button:focus,
.chat-widget-close:focus,
.chat-widget-send-button:focus {
    outline: 2px solid #E1C6C0;
    outline-offset: 2px;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ===================================
   Floating Forms Button & Modal
==================================== */

/* Forms Button */
.floating-forms-button {
    position: fixed;
    bottom: 20px;
    right: 90px; /* Positioned left of chat button */
    width: 60px;
    height: 60px;
    background-color: #6f8467; /* Forest Sage */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(111, 132, 103, 0.4);
    z-index: 10001;
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.floating-forms-button:hover {
    background-color: #E1C6C0; /* Soft Peach */
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(225, 198, 192, 0.5);
}

.floating-forms-button:active {
    transform: scale(0.95);
}

.floating-forms-button i {
    font-size: 28px;
    color: #FFFFFF;
}

.floating-forms-button.pulse {
    animation: pulse 2s infinite;
}

/* Forms Modal Backdrop */
.forms-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10002;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.forms-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Forms Modal */
.forms-modal {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    background: #FFFFFF;
    border-radius: 15px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.2);
    z-index: 10003;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.forms-modal.open {
    transform: translateX(0);
}

/* Forms Modal Header */
.forms-modal-header {
    background-color: #6f8467; /* Forest Sage */
    color: #FFFFFF;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 15px 15px 0 0;
}

.forms-modal-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.forms-modal-logo {
    width: 35px;
    height: 35px;
    background-color: #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #6f8467;
    font-size: 16px;
}

.forms-modal-title {
    display: flex;
    flex-direction: column;
}

.forms-modal-title h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
}

.forms-modal-title p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
    font-family: 'Roboto', sans-serif;
}

.forms-modal-close {
    background: transparent;
    border: none;
    color: #FFFFFF;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.forms-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Forms Modal Body */
.forms-modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
    text-decoration: none;
    color: #59514B;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
    font-family: 'Roboto', sans-serif;
}

.form-link:hover {
    background-color: #E1C6C0; /* Soft Peach */
    color: #59514B;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(111, 132, 103, 0.2);
    text-decoration: none;
}

.form-link i {
    font-size: 28px;
    color: #6f8467;
    flex-shrink: 0;
}

.form-link:hover i {
    color: #59514B;
}

.form-link span {
    font-size: 16px;
    font-weight: 500;
}

/* ===================================
   Forms Modal Responsive Design
==================================== */

/* Tablet */
@media (max-width: 767.98px) {
    .forms-modal {
        width: 320px;
        bottom: 90px;
        right: 15px;
    }

    .floating-forms-button {
        bottom: 15px;
        right: 80px;
        width: 55px;
        height: 55px;
    }

    .floating-forms-button i {
        font-size: 26px;
    }
}

/* Mobile */
@media (max-width: 479.98px) {
    .forms-modal {
        width: calc(100% - 20px);
        bottom: 80px;
        right: 10px;
        left: 10px;
    }

    .floating-forms-button {
        bottom: 10px;
        right: 70px;
        width: 50px;
        height: 50px;
    }

    .floating-forms-button i {
        font-size: 24px;
    }

    .forms-modal-body {
        padding: 15px;
    }

    .form-link {
        padding: 12px 15px;
    }

    .form-link i {
        font-size: 24px;
    }

    .form-link span {
        font-size: 14px;
    }
}

/* Accessibility */
.floating-forms-button:focus,
.forms-modal-close:focus {
    outline: 2px solid #E1C6C0;
    outline-offset: 2px;
}
