/* Integrated Toilets+ AI Chatbot Styles */
/* Combines contact options UI with AI chat functionality */
/* Version: 1.0.0 */

/* Chat Widget Styles */
.chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

/* Speech Bubble */
.chat-speech-bubble {
    position: absolute;
    bottom: 15px;
    right: 75px;
    background: #fff;
    color: #000738;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.chat-speech-bubble.visible {
    opacity: 1;
    transform: translateY(0);
}

.chat-speech-bubble::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -8px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid #fff;
}

.chat-widget-container.chat-open .chat-speech-bubble {
    display: none;
}

.chat-widget-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #e1001b;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    padding: 0 !important;
}

.chat-widget-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    background: #e1001b;
}

.chat-widget-button:focus, .chat-widget-button:active {
    background: #e1001b;
}

.chat-widget-button svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.chat-widget-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 400px;
    height: 450px;
    background: #000738;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chat-widget-window.open {
    display: flex;
}

.chat-widget-button .icon-close {
    display: none;
}

svg.icon-close {
    width: 20px;
    height: 20px;
}

.chat-widget-button .icon-open {
    display: flex;
}

.chat-widget-container.chat-open .chat-widget-button .icon-close {
    display: flex;
}

.chat-widget-container.chat-open .chat-widget-button .icon-open {
    display: none;
}

.chat-widget-header {
    background: #000738;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    height: 80px;
    gap: 20px;
}

.chat-widget-logo {
    height: 100%;
    position: relative;
}

.chat-widget-logo img {
    height: 100%;
}

.chat-widget-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-avatar {
    width: 35px;
    height: 35px;
    position: relative;
    flex-shrink: 0;
}

.chat-header-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.chat-header-avatar::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: absolute;
    background: #22c55e;
    border: 2px solid #000738;
    z-index: 99;
    bottom: 0;
    right: 0;
}

.chat-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
    font-family: 'Montserrat', sans-serif;
}

.chat-header-text p {
    margin: 2px 0 0 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Montserrat', sans-serif;
}

.chat-widget-back {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0 !important;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    transition: opacity 0.2s;
}

.chat-widget-back:hover {
    opacity: 0.8;
}

.chat-widget-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 24px !important;
    padding: 0 !important;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-widget-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #fff;
}

.chat-message {
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-message.user {
    flex-direction: row-reverse;
}

.chat-message-avatar img {
    width: 32px;
    height: 32px;
}

.chat-message.user .chat-message-avatar {
    display: none;
}

.chat-message-content {
    max-width: 70%;
    padding: 16px 18px;
    border-radius: 10px;
    background: #1A1C38;
    font-size: 14px;
    color: #fff;
    font-family: 'Montserrat';
    font-weight: 500;
}

.chat-message.user .chat-message-content {
    background: #e1001b;
    color: white;
}

.chat-message.typing .chat-message-content {
    padding: 16px;
}

.typing-indicator {
    display: flex;
    gap: 4px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e1001b;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.chat-widget-input-container {
    display: flex;
    flex-wrap: nowrap;
    padding: 12px;
    background: white;
    align-items: center;
    justify-content: flex-start;
    border-top: solid 1px #73737621;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
    user-select: none;
}

.chat-widget-input-container:active {
    cursor: grabbing;
}

.chat-widget-input-wrapper {
    display: flex;
    gap: 8px;
    width: 100%;
}

.chat-widget-input {
    flex: 1;
    padding: 12px 16px;
    border-radius: 24px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

input#chatInput {
    border: 0;
}

.chat-widget-input:focus {
    border-color: #e1001b;
}

.chat-widget-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e1001b;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0px !important;
}

.chat-widget-send:hover {
    background: #e1001b;
}

.chat-widget-send:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.chat-widget-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.chat-suggestion-btn {
    padding: 8px 14px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-suggestion-btn:hover {
    background: #e1001b;
    color: white;
    border-color: #e1001b;
}

/* Message options (clickable buttons) */
.message-options {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px;
    margin-top: 12px;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(225, 0, 27, 0.3) transparent;
}

.message-options::-webkit-scrollbar {
    height: 6px;
}

.message-options::-webkit-scrollbar-track {
    background: transparent;
}

.message-options::-webkit-scrollbar-thumb {
    background: rgba(225, 0, 27, 0.3);
    border-radius: 3px;
}

.message-options::-webkit-scrollbar-thumb:hover {
    background: rgba(225, 0, 27, 0.5);
}

.option-button {
    border: 2px solid #e1001b !important;
    border-radius: 99px !important;
    padding: 12px 20px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #000322;
    transition: all 0.2s ease;
    text-align: center;
    display: inline-block;
    white-space: nowrap !important;
    flex-shrink: 0;
    cursor: pointer;
    background: white;
}

.option-button:hover:not(:disabled) {
    background: #e1001b;
    color: #ffffff;
    box-shadow: 0 4px 8px rgba(225, 0, 27, 0.2);
}

.option-button:active:not(:disabled) {
    transform: translateY(0);
}

.option-button.selected {
    background: #e1001b;
    color: #ffffff;
}

.option-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f0f0f0;
    border-color: #d0d0d0;
    color: #666;
}

.option-button.disabled:not(.selected) {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
}

/* Animation for options appearing */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-options .option-button {
    animation: slideInUp 0.3s ease forwards;
}

.message-options .option-button:nth-child(1) { animation-delay: 0.05s; }
.message-options .option-button:nth-child(2) { animation-delay: 0.1s; }
.message-options .option-button:nth-child(3) { animation-delay: 0.15s; }
.message-options .option-button:nth-child(4) { animation-delay: 0.2s; }
.message-options .option-button:nth-child(5) { animation-delay: 0.25s; }

/* Contact Options Screen */
.contact-options-screen {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-options-screen h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    text-align: center;
}

.contact-faq-link {
    display: block;
    text-align: center;
    padding: 14px 20px;
    background: #f5f5f5;
    color: #000738;
    text-decoration: none;
    border-radius: 8px;
    font-family: 'Montserrat';
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.contact-faq-link:hover {
    background: #E1001B;
    color: white;
    border-color: #E1001B;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(225, 0, 27, 0.2);
}

.contact-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px 24px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.14);
    box-shadow: 2px 2px 15px 0 rgba(0, 0, 0, 0.10);
}

.contact-option-chevron {
    margin-left: 12px;
    font-size: 18px;
    color: #E1001B;
    flex-shrink: 0;
}

.contact-option:hover{
    border-color: #E1001B;
    box-shadow: 0 4px 12px rgba(225, 0, 27, 0.15);
    transform: translateY(-2px);
}

.contact-option-content {
    flex: 1;
    font-family: 'Montserrat';
}

.contact-option-title {
    font-size: 16px;
    font-weight: 700;
    color: #000738;
    margin-bottom: 4px;
}

.contact-option-description {
    font-size: 14px;
    color: #737376;
    font-weight: 500;
}

@media (max-width: 767px) {
    .chat-widget-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 250px);
    }
    
    .option-button {
        padding: 10px 14px;
        font-size: 13px;
    }

    .contact-option {
        padding: 16px;
    }

    .contact-option-icon {
        font-size: 28px;
    }

    .contact-option-title {
        font-size: 15px;
    }

    .contact-option-description {
        font-size: 13px;
    }
}

/* Disclaimer under first message */
.chat-disclaimer-text {
    font-size: 11px;
    color: #888;
    margin: 4px 0 12px 0;
    padding: 0;
    line-height: 1.3;
    max-width: 85%;
}

.chat-disclaimer-text a {
    color: #888;
    text-decoration: underline;
}

/* Careers link styling */
.chat-message a {
    color: var(--e-global-color-secondary, #e1001b);
    text-decoration: underline;
}
