/* =============================================================================
   HOTEL PLESNIK — CHAT WIDGET STYLES
   Font: Schibsted Grotesk (loaded via Google Fonts in HTML)
   Brand green: #00341F   Hover green: #0b8655
   ============================================================================= */


/* ── 1. CONTAINER & BUBBLE BUTTON ────────────────────────────────────────── */

@keyframes widgetSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes widgetSlideDown {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(24px) scale(0.95);
    }
}

#chat-widget-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 370px;
    height: 600px;
    display: none;
    flex-direction: column;
    background: #ffffff;
    border: none;
    border-radius: 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    font-family: 'Schibsted Grotesk', sans-serif;
    z-index: 1000;
    transform-origin: bottom right;
}

#chat-widget-container.widget-open {
    animation: widgetSlideUp 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

#chat-widget-container.widget-closing {
    animation: widgetSlideDown 0.2s ease forwards;
}

#chat-widget-bubble-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #00341F;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
    transition: background 0.25s ease;
    z-index: 1001;
}

#chat-widget-bubble-button img {
    height: 45px;
}

#chat-widget-bubble-button:hover {
    background: #000000;
}


/* ── 2. HEADER ───────────────────────────────────────────────────────────── */

#chat-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    padding: 18px 20px;
    background: #00341F;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

#chat-widget-header-icon {
    display: inline-flex;
    align-items: center;
}

#chat-widget-header-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 10px;
    color: #ffffff;
}

#chat-widget-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

#chat-widget-header-close {
    background: transparent;
    border: none;
    cursor: pointer;
}

#chat-widget-menu-wrapper {
    position: relative;
}

#chat-widget-menu-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 20px;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
    letter-spacing: 1px;
    opacity: 0.85;
    transition: opacity 0.15s ease;
}

#chat-widget-menu-btn:hover {
    opacity: 1;
}

#chat-widget-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 160px;
    background: #ffffff;
    border: 1px solid #ddd;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    z-index: 20;
}

.chat-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 11px 16px;
    text-align: left;
    background: transparent;
    border: none;
    font-size: 13px;
    font-family: 'Schibsted Grotesk', sans-serif;
    color: #00341F;
    cursor: pointer;
    transition: background 0.15s ease;
    box-sizing: border-box;
}

.chat-menu-item:hover {
    background: rgba(0, 52, 31, 0.08);
}

#chat-widget-faq-wrapper {
    position: relative;
    height: 0;
    flex-shrink: 0;
}

#chat-widget-faq-btn {
    position: absolute;
    bottom: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #00341F;
    color: #ffffff;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
    z-index: 5;
}

#chat-widget-faq-btn:hover {
    background: #0b8655;
}

#chat-widget-faq-btn img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
}

@keyframes faqSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#chat-widget-faq-panel {
    position: absolute;
    bottom: 60px;
    right: 14px;
    width: 260px;
    max-height: 340px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    background: transparent;
    border: none;
    box-shadow: none;
    z-index: 10;
    animation: faqSlideUp 0.22s ease;
    transform-origin: bottom right;
}

.faq-item {
    display: block;
    width: 100%;
    padding: 10px 14px;
    text-align: left;
    font-size: 13px;
    font-family: 'Schibsted Grotesk', sans-serif;
    color: #00341F;
    background: #ffffff;
    border: 1px solid #00341F;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    box-sizing: border-box;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.faq-item:hover {
    background: #00341F;
    color: #ffffff;
}


/* ── 3. LOGIN PANEL ──────────────────────────────────────────────────────── */

#chat-widget-login {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    padding: 28px 24px;
    background: #fafafa;
    min-height: 0;
    overflow-y: auto;
}

.chat-login-title {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    font-family: 'Schibsted Grotesk', sans-serif;
    color: #00341F;
    letter-spacing: 0.2px;
}

.chat-login-input {
    width: 100%;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid #00341F;
    border-radius: 0;
    color: #00341F;
    font-size: 14px;
    font-family: 'Schibsted Grotesk', sans-serif;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.chat-login-input:focus {
    border-color: #0b8655;
    box-shadow: 0 0 0 2px rgba(0, 52, 31, 0.12);
}

.chat-login-input::placeholder {
    color: #aaa;
    font-size: 13px;
}

.chat-login-condition {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    font-family: 'Schibsted Grotesk', sans-serif;
    color: #444;
    line-height: 1.5;
    cursor: pointer;
}

.chat-login-condition input[type="checkbox"] {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    margin-top: 2px;
    accent-color: #00341F;
    cursor: pointer;
}

.chat-login-condition a {
    color: #00341F;
    text-decoration: underline;
}

.chat-login-condition a:hover {
    color: #0b8655;
}

.chat-login-error {
    margin: 0;
    min-height: 16px;
    font-size: 12px;
    font-family: 'Schibsted Grotesk', sans-serif;
    color: #c0392b;
}

.chat-login-submit {
    width: 100%;
    padding: 12px 16px;
    margin-top: 4px;
    background-color: #00341F;
    border: none;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Schibsted Grotesk', sans-serif;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.chat-login-submit:hover:not(:disabled) {
    background-color: #0b8655;
}

.chat-login-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* ── 4. CHAT BODY ────────────────────────────────────────────────────────── */

#chat-widget-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: #fafafa;
    overflow-y: auto;
    min-height: 0;
}

#chat-text-welcome-message {
    align-self: flex-start;
    max-width: 90%;
    padding: 12px 14px;
    margin-bottom: 10px !important;
    background-color: rgba(0, 52, 31, 0.2) !important;
    color: #00341F !important;
    text-align: left;
    word-wrap: break-word;
}

#chat-widget-body h1,
#chat-widget-body h2,
#chat-widget-body h3,
#chat-widget-body h4 {
    margin: 8px 0;
    font-weight: 600;
    font-family: 'Schibsted Grotesk', sans-serif;
    color: #00341F;
    line-height: 1.3;
}

#chat-widget-body h1 { font-size: 20px; }
#chat-widget-body h2 { font-size: 18px; }
#chat-widget-body h3 { font-size: 16px; }
#chat-widget-body h4 { font-size: 14px; }

#chat-widget-body ul,
#chat-widget-body ol {
    margin-bottom: 10px;
}


/* ── 5. FOOTER & INPUT ───────────────────────────────────────────────────── */

#chat-widget-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px 0 12px;
    background: #ffffff;
    border-top: 1px solid #ddd;
}

#chat-widget-input {
    flex: 1;
    height: 40px;
    padding: 10px;
    background: #ffffff;
    border: 1px solid #00341F;
    border-radius: 0;
    color: #00341F;
    box-sizing: border-box;
}

#chat-widget-send {
    height: 40px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #00341F;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#chat-widget-send:hover {
    background-color: #0b8655;
}

#chat-widget-end {
    display: block;
    padding: 10px 25px;
    font-size: 12px;
    color: grey;
    text-align: center;
    line-height: 1.2;
    opacity: 0.5;
}

.chat-input-disabled {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.chat-input-disabled::after {
    content: "Please select an option above";
    position: absolute;
    top: -25px;
    left: 0;
    right: 0;
    font-size: 12px;
    color: #999;
    text-align: center;
}


/* ── 6. MESSAGES ─────────────────────────────────────────────────────────── */

.user-msg {
    align-self: flex-end;
    max-width: 90%;
    padding: 12px 14px;
    margin-bottom: 10px !important;
    background-color: #00341F !important;
    color: #ffffff !important;
    text-align: right;
    word-wrap: break-word;
}

.bot-msg {
    position: relative;
    align-self: flex-start;
    max-width: 90%;
    padding: 12px 14px;
    margin-bottom: 10px !important;
    background-color: rgba(0, 52, 31, 0.2) !important;
    color: #00341F !important;
    text-align: left;
    word-wrap: break-word;
}

.bot-text {
    position: relative;
    align-self: flex-start;
    max-width: 90%;
    padding: 12px 14px;
    background-color: rgba(0, 52, 31, 0.2) !important;
    color: #00341F !important;
    text-align: left;
    word-wrap: break-word;
}

.bot-copy-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    display: none;
    padding: 2px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #00341F;
    opacity: 0.5;
    line-height: 0;
    transition: opacity 0.15s ease;
}

.bot-msg:hover .bot-copy-btn,
.bot-text:hover .bot-copy-btn {
    display: block;
}

.bot-copy-btn:hover {
    opacity: 1;
}


/* ── 7. RICH CONTENT — BUTTONS ───────────────────────────────────────────── */

.bot-message-group {
    display: flex !important;
    flex-direction: column !important;
    margin: 10px 0 !important;
}

.bot-button {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center;
    max-width: 80%;
    padding: 12px 16px !important;
    margin: 6px 0 !important;
    background-color: rgba(0, 52, 31, 0.2) !important;
    border: 1px solid #00341F !important;
    color: #00341F !important;
    font-size: 14px;
    white-space: normal !important;
    word-break: break-word !important;
    box-sizing: border-box !important;
    cursor: pointer;
}

.bot-button:hover {
    background-color: #0b8655 !important;
    color: #ffffff !important;
}

.bot-button.disabled {
    opacity: 0.5;
    pointer-events: none;
}


/* ── 8. RICH CONTENT — ROOM CARD ─────────────────────────────────────────── */

.room-card {
    max-width: 80%;
    margin: 12px 0 !important;
    background: rgba(0, 52, 31, 0.2);
    border: 1px solid #00341F;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.room-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.room-card-content {
    padding: 12px;
}

.room-card-title {
    margin: 0 0 6px !important;
    font-size: 18px;
    font-family: 'Schibsted Grotesk', sans-serif;
}

.room-card-subtitle {
    margin-bottom: 20px !important;
    font-size: 14px;
    color: #555;
}

.room-card-price-wrapper {
    margin-bottom: 8px;
}

.room-card-price-label {
    font-size: 12px;
    color: #555;
}

.room-card-price {
    margin-bottom: 20px !important;
    font-weight: 600;
    color: #00341F;
}

.room-card-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px !important;
}

.room-card-button {
    display: block;
    padding: 10px 16px;
    border: 1px solid #00341F;
    color: #00341F;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.room-card-button img {
    display: inline-block;
    vertical-align: middle;
    margin-left: 10px;
}

.room-card-button:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}


/* ── 9. RICH CONTENT — DATE PICKER ──────────────────────────────────────── */

.bot-datepicker-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    max-width: 70%;
    margin-top: 10px !important;
}

.bot-datepicker-start,
.bot-datepicker-end {
    width: 200px;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}


/* ── 10. RICH CONTENT — EMAIL FORM ──────────────────────────────────────── */

.bot-email-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 70%;
    margin: 10px 0 !important;
}

.bot-name-input,
.bot-email-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    box-sizing: border-box;
}

.bot-name-input:focus,
.bot-email-input:focus {
    border-color: #00341F;
    outline: none;
}


/* ── 11. RICH CONTENT — LOADING & TABLE ─────────────────────────────────── */

.bot-message-loading img {
    width: 40px;
}

.bot-message-table {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    margin: 10px 0;
    border-collapse: collapse;
    font-size: 0.85em;
    line-height: 1.3;
}

.bot-message-table th,
.bot-message-table td {
    flex: 1 1 50%;
    padding: 4px 6px;
    border: 1px solid #ccc;
    font-size: 0.85em;
    word-break: break-word;
    box-sizing: border-box;
}


/* ── 12. RESPONSIVE ──────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    #chat-widget-container {
        width: 90%;
        height: 90%;
        bottom: 60px;
        right: 5%;
    }

    #chat-widget-bubble-button {
        margin-bottom: 60px !important;
    }
}
