/* ==========================================================================
   Global / Shared
   ========================================================================== */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

* {
    box-sizing: border-box;
}

/* ==========================================================================
   Chat Widget (chat.php)
   ========================================================================== */
.chat-widget-body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
    background: var(--header-bg);
    background-size: 200% 200%;
    /* animation: gradientShift 15s ease infinite; */
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    -webkit-text-size-adjust: 100%;
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.chat-widget-body ::-webkit-scrollbar {
    width: 8px;
}

.chat-widget-body .chatPanel,
.chat-widget-body .message-bubble,
.chat-widget-body .message-content,
.chat-widget-body .message-time {
    -webkit-user-select: text;
    user-select: text;
}

.chat-widget-body ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 10px;
}

.chat-widget-body ::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(69, 145, 226, 0.3), rgba(49, 130, 206, 0.3));
    border-radius: 10px;
    transition: background 0.3s ease;
}

.chat-widget-body ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(69, 145, 226, 0.5), rgba(49, 130, 206, 0.5));
}

@media (max-width: 768px) {
    .chat-widget-body ::-webkit-scrollbar {
        width: 4px;
    }
    .chat-widget-body ::-webkit-scrollbar-track {
        background: transparent;
    }
    .chat-widget-body ::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.3);
        border-radius: 2px;
    }
    .chat-widget-body {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    }
    .chat-widget-body .message-content {
        -webkit-user-select: text;
        user-select: text;
    }
    .chat-widget-body .chatPanel {
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
    }
}

.chat-widget-body .chat-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
    min-height: 100%;
    background: var(--chat-container-bg);
    border-radius: 0;
    box-shadow: var(--shadow-intense);
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.chat-widget-body .chat-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%); */
    pointer-events: none;
    z-index: 0;
}

.chat-widget-body .top-bar {
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.1) 100%);
    color: var(--welcome-text-color);
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 10;
}

.chat-widget-body .top-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: var(--header-bg);
    opacity: 0.6;
    z-index: -1;
}

.chat-widget-body .top-bar .left {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chat-widget-body .top-bar .left i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.chat-widget-body .top-bar .right .btn {
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.6);
    background: rgba(69, 145, 226, 0.85);
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(69, 145, 226, 0.4);
    color: white;
    font-size: 1.1rem;
}

.chat-widget-body .top-bar .right .btn:hover {
    transform: scale(1.1) translateY(-2px);
    background: rgba(69, 145, 226, 1);
    box-shadow: 0 8px 32px rgba(69, 145, 226, 0.6);
    border-color: rgba(255, 255, 255, 0.9);
}

.chat-widget-body .top-bar .right .btn i {
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.chat-widget-body .chatPanel {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 0.5rem;
    background: linear-gradient(to bottom, rgba(248, 249, 250, 0.6) 0%, rgba(241, 243, 245, 0.8) 100%);
    position: relative;
    border-radius: 12px 12px 0 0;
    z-index: 1;
    scrollbar-gutter: stable;
    display: flex;
    flex-direction: column;
}

.chat-widget-body .legal-footer {
    text-align: center;
    padding: 4px;
    font-size: 10px;
    color: #999;
    background: rgba(255, 255, 255, 0.9);
    width: 100%;
    flex-shrink: 0;
}

.chat-widget-body .legal-footer a {
    color: #999;
    text-decoration: none;
    font-weight: 600;
}

.chat-widget-body .legal-footer a:hover {
    text-decoration: underline;
    color: var(--primary-color);
}

.chat-widget-body .chat-footer {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 1.25rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 10;
}

.chat-widget-body .message-input-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.chat-widget-body .character-counter {
    position: absolute;
    bottom: 10px;
    right: 14px;
    font-size: 0.75rem;
    color: #6c757d;
    background: rgba(255, 255, 255, 0.95);
    padding: 3px 8px;
    border-radius: 16px;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chat-widget-body .character-counter.warning {
    color: #fd7e14;
    font-weight: 600;
    background: rgba(253, 126, 20, 0.15);
    box-shadow: 0 2px 12px rgba(253, 126, 20, 0.3);
}

.chat-widget-body .character-counter.danger {
    color: #dc3545;
    font-weight: 700;
    background: rgba(220, 53, 69, 0.15);
    box-shadow: 0 2px 12px rgba(220, 53, 69, 0.3);
    animation: pulse 0.5s ease-in-out;
}

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

.chat-widget-body .message-input-container textarea {
    width: 100%;
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: 24px;
    padding: 12px 1rem;
    padding-right: 60px;
    font-size: var(--font-size);
    line-height: 20px;
    margin: 0;
    font-family: inherit;
    resize: none;
    height: 48px;
    min-height: 48px;
    max-height: 120px;
    transition: var(--transition);
    outline: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-sizing: border-box;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    overflow-y: auto;
    overflow-x: hidden;
    touch-action: pan-y;
    overscroll-behavior: contain;
    position: relative;
    z-index: 1;
    -webkit-appearance: none;
    appearance: none;
    -webkit-overflow-scrolling: touch;
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
}

.chat-widget-body .message-input-container textarea.over-limit {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.chat-widget-body .message-input-container textarea.near-limit {
    border-color: #fd7e14;
    box-shadow: 0 0 0 3px rgba(253, 126, 20, 0.1);
}

.chat-widget-body .chat-footer textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 4px 24px rgba(69, 145, 226, 0.2), 0 0 0 4px rgba(69, 145, 226, 0.1);
    transform: translateY(-1px);
}

.chat-widget-body .chat-footer .btn {
    width: 48px;
    height: 48px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: linear-gradient(135deg, var(--primary-color) 0%, #3182ce 100%);
    color: white;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(69, 145, 226, 0.4);
    position: relative;
    overflow: hidden;
    margin: 0;
    box-sizing: border-box;
}

.chat-widget-body .chat-footer .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.chat-widget-body .chat-footer .btn:hover::before {
    left: 100%;
}

.chat-widget-body .chat-footer .btn:hover {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 12px 36px rgba(69, 145, 226, 0.5);
    background: linear-gradient(135deg, #3182ce 0%, #2c5aa0 100%);
}

.chat-widget-body .chat-footer .btn:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 16px rgba(69, 145, 226, 0.4);
}

.chat-widget-body .chat-footer .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 12px rgba(69, 145, 226, 0.2);
}

.chat-widget-body .message-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    order: 0;
    width: 100%;
}

.chat-widget-body #operator-typing,
.chat-widget-body #ai-typing,
.chat-widget-body #on-hold-status,
.chat-widget-body #transfer-status {
    order: 9999;
}

.chat-widget-body .message-user {
    align-items: flex-end;
}

.chat-widget-body .message-admin {
    align-items: flex-start;
}

.chat-widget-body .message-bubble {
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: 24px;
    font-size: var(--font-size);
    line-height: 1.6;
    word-wrap: break-word;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: block;
}

.chat-widget-body .message-bubble:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px) scale(1.01);
}

.chat-widget-body .bubble-user {
    background: var(--primary-color);
    color: var(--user-text-color);
    border-bottom-left-radius: 6px;
    box-shadow: 0 8px 32px rgba(69, 145, 226, 0.4);
    position: relative;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-align: left;
}

.chat-widget-body .bubble-user::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.1));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

.chat-widget-body .bubble-user::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: skewX(-25deg);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -50%; }
    100% { left: 150%; }
}

.chat-widget-body .bubble-admin {
    background: var(--admin-color);
    color: var(--admin-text-color);
    border-bottom-right-radius: 6px;
    box-shadow: 0 8px 32px rgba(76, 175, 80, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    text-align: left;
    position: relative;
    overflow: hidden;
}

.chat-widget-body .bubble-admin::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 50%, transparent 100%);
    border-radius: inherit;
    pointer-events: none;
}

.chat-widget-body .message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.25rem;
    text-align: inherit;
}

.chat-widget-body .loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #495057;
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.chat-widget-body .loader img {
    width: 64px;
    height: 64px;
    margin-bottom: 1.25rem;
    filter: drop-shadow(0 4px 12px rgba(69, 145, 226, 0.3));
}

.chat-widget-body .loader-text {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), #3182ce);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chat-widget-body .loader-subtext {
    font-size: 0.9rem;
    opacity: 0.7;
    color: #6c757d;
}

.chat-widget-body .chatinfo {
    border-left: 4px solid #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.15) 0%, rgba(40, 167, 69, 0.08) 100%);
    backdrop-filter: blur(10px);
    margin: 0.75rem 0;
    padding: 1rem;
    border-radius: 16px;
    color: #155724;
    font-size: 0.9rem;
    box-shadow: 0 4px 16px rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.2);
}

@media (max-width: 768px) {
    .chat-widget-body .top-bar {
        padding: 0.75rem;
    }
    .chat-widget-body .top-bar .left {
        font-size: 1rem;
    }
    .chat-widget-body .chatPanel {
        padding: 0.75rem;
    }
    .chat-widget-body .chat-footer {
        padding: 0.75rem;
    }
    .chat-widget-body .message-bubble {
        max-width: 90%;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .chat-widget-body .top-bar {
        padding: 0.5rem;
    }
    .chat-widget-body .chatPanel {
        padding: 0.5rem;
    }
    .chat-widget-body .chat-footer {
        padding: 0.5rem;
        gap: 0.25rem;
    }
    .chat-widget-body .message-bubble {
        max-width: 95%;
        padding: 0.6rem 0.8rem;
    }
    .chat-widget-body .message-input-container textarea {
        font-size: var(--font-size);
        padding-right: 50px;
    }
    .chat-widget-body .character-counter {
        font-size: 0.7rem;
        right: 8px;
        bottom: 6px;
    }
}

@keyframes pulseGlow {
    0% { box-shadow: 0 8px 24px rgba(69, 145, 226, 0.4); }
    50% { box-shadow: 0 12px 36px rgba(69, 145, 226, 0.6); }
    100% { box-shadow: 0 8px 24px rgba(69, 145, 226, 0.4); }
}

@keyframes floatButton {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

.chat-widget-body .chat-footer .btn:not(:disabled):not(.sending) {
    animation: floatButton 3s ease-in-out infinite;
}

.chat-widget-body .chat-footer .btn.sending {
    animation: pulseGlow 1.5s ease-in-out infinite;
}

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

.chat-widget-body .message-bubble {
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-widget-body .modern-typing-indicator {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.125rem 1.25rem;
    margin: 0.75rem 2.5%;
    width: 95%;
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.95) 0%, rgba(233, 236, 239, 0.95) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 24px;
    border-bottom-right-radius: 6px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
    clear: both;
}

.chat-widget-body .modern-typing-indicator::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(69, 145, 226, 0.15), transparent);
    animation: shimmer 2.5s infinite;
}

.chat-widget-body .typing-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #3182ce 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(69, 145, 226, 0.4);
    animation: pulse 2s infinite;
    position: relative;
    z-index: 1;
}

.chat-widget-body .typing-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.chat-widget-body .typing-text {
    font-size: 0.9rem;
    color: #495057;
    font-weight: 600;
}

.chat-widget-body .typing-dots {
    display: flex;
    gap: 0.375rem;
    align-items: center;
}

.chat-widget-body .typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #3182ce);
    box-shadow: 0 2px 8px rgba(69, 145, 226, 0.3);
    animation: typingDots 1.4s infinite ease-in-out;
}

.chat-widget-body .typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.chat-widget-body .typing-dots span:nth-child(2) { animation-delay: -0.16s; }
.chat-widget-body .typing-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes typingDots {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1.2); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .chat-widget-body .modern-typing-indicator::before,
    .chat-widget-body .typing-avatar,
    .chat-widget-body .typing-dots span {
        animation: none !important;
    }
}

.chat-widget-body .bubbleyou {
    background: linear-gradient(135deg, var(--admin-color) 0%, var(--admin-gradient-end) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 24px;
    border-bottom-right-radius: 6px;
    display: block;
    max-width: 98%;
    padding: 1rem 1.25rem;
    position: relative;
    font-size: 0.95rem;
    line-height: 1.6;
    box-shadow: 0 8px 32px rgba(76, 175, 80, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.2);
    word-wrap: break-word;
    word-break: break-word;
    text-align: left;
    margin: 0;
    color: var(--admin-text-color);
    overflow: hidden;
}

.chat-widget-body .bubbleyou::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 50%, transparent 100%);
    border-radius: inherit;
    pointer-events: none;
}

.chat-widget-body .bubbleme {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-gradient-end) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 24px;
    border-bottom-left-radius: 6px;
    display: block;
    max-width: 80%;
    padding: 1rem 1.25rem;
    position: relative;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--user-text-color);
    box-shadow: 0 8px 32px rgba(69, 145, 226, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
    word-wrap: break-word;
    word-break: break-word;
    text-align: left;
    margin: 0;
}

.chat-widget-body .me {
    width: 75%;
    margin: 0.75rem 0;
    clear: both;
    animation: slideInLeft 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: flex-start;
}

.chat-widget-body .you {
    width: 100%;
    margin: 0.75rem 0;
    clear: both;
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: flex-end;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

.chat-widget-body .admin {
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.chat-widget-body .user {
    color: var(--admin-text-color);
    font-weight: 600;
}

.chat-widget-body .message-bubble iframe,
.chat-widget-body .bubbleyou iframe,
.chat-widget-body .bubbleme iframe,
.chat-widget-body .bubble-ai-agent iframe {
    max-width: 100%;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    margin-top: 8px;
    display: block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.chat-widget-body .message-bubble img.chat-image,
.chat-widget-body .bubbleyou img.chat-image,
.chat-widget-body .bubbleme img.chat-image,
.chat-widget-body .bubble-ai-agent img.chat-image {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    border-radius: 12px;
    margin-top: 8px;
    display: block;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    object-fit: contain;
    background: rgba(0, 0, 0, 0.02);
}

.chat-widget-body .message-bubble img.chat-image:hover,
.chat-widget-body .bubbleyou img.chat-image:hover,
.chat-widget-body .bubbleme img.chat-image:hover,
.chat-widget-body .bubble-ai-agent img.chat-image:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    transform: scale(1.02);
    opacity: 0.95;
}

.chat-widget-body .chat-image-wrapper {
    display: block;
    margin-top: 8px;
    cursor: pointer;
    position: relative;
}

.chat-widget-body .chat-image-wrapper::after {
    content: '🔍';
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    color: white;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.chat-widget-body .chat-image-wrapper:hover::after {
    opacity: 1;
}

.chat-widget-body .message-bubble,
.chat-widget-body .bubbleyou,
.chat-widget-body .bubbleme,
.chat-widget-body .bubble-ai-agent {
    overflow: hidden;
}

.chat-widget-body .bubble-ai-agent {
    display: block;
    max-width: 85%;
    text-align: left;
    background: var(--admin-color);
    color: var(--admin-text-color);
    border-radius: 24px;
    border-bottom-right-radius: 6px;
    padding: 1rem 1.25rem;
    box-shadow: 0 8px 32px rgba(81, 138, 180, 0.35);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    word-wrap: break-word;
    word-break: break-word;
    line-height: 1.6;
    margin: 0;
    position: relative;
    overflow: hidden;
}

.chat-widget-body .bubble-ai-agent::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 50%, transparent 100%);
    border-radius: inherit;
    pointer-events: none;
}

.chat-widget-body .ai-agent-name {
    color: #FFFFFF;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    font-size: 14px;
    letter-spacing: 0.5px;
    background: rgba(255,255,255,0.15);
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
}

/* ==========================================================================
   Modern Chat Bubbles V2 (Migrated from mobile.css)
   ========================================================================== */
.chat-widget-body .chat-message-row {
    display: flex;
    align-items: flex-end;
    margin-bottom: 16px;
    width: 100%;
    animation: slideInMessage 0.3s ease-out;
}

.chat-widget-body .chat-message-row.agent-row {
    justify-content: flex-start;
}

.chat-widget-body .chat-message-row.user-row {
    justify-content: flex-end;
}

.chat-widget-body .chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chat-widget-body .chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-widget-body .chat-avatar i {
    font-size: 16px;
    color: #555;
}

.chat-widget-body .chat-content {
    max-width: 80%;
    display: flex;
    flex-direction: column;
}

.chat-widget-body .chat-header {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 4px;
    margin-left: 4px;
    font-weight: 600;
}

.chat-widget-body .chat-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Fix for buttons inside chat bubbles */
.chat-widget-body .chat-bubble button,
.chat-widget-body .chat-bubble input[type="button"],
.chat-widget-body .chat-bubble input[type="submit"],
.chat-widget-body .chat-bubble .btn,
.chat-widget-body .chat-bubble a.btn {
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
    height: auto;
    min-height: 30px;
    padding: 8px 12px;
    margin: 4px 0;
    display: inline-block;
    line-height: 1.4;
    box-sizing: border-box;
}

/* Agent Bubble (Darker Green than AI) */
.chat-widget-body .chat-bubble.agent {
    background: linear-gradient(135deg, var(--admin-color) 0%, var(--admin-gradient-end) 100%);
    color: var(--admin-text-color);
    border-bottom-left-radius: 4px;
    border: none;
    box-shadow: 0 4px 12px rgba(27, 94, 32, 0.2);
}

.chat-widget-body .chat-bubble.agent a {
    color: var(--admin-text-color);
    text-decoration: underline;
}

/* User Bubble (Blue) */
.chat-widget-body .chat-bubble.user {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-gradient-end) 100%);
    color: var(--user-text-color);
    border-bottom-right-radius: 4px;
    font-weight: normal;
}

/* AI Agent Bubble (Gradient Green - Darker) */
.chat-widget-body .chat-bubble.ai {
    background: linear-gradient(135deg, var(--ai-color) 0%, var(--ai-gradient-end) 100%);
    color: var(--ai-text-color);
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 12px rgba(46, 160, 67, 0.2);
    border: none;
}

.chat-widget-body .chat-bubble.ai a {
    color: var(--ai-text-color);
    text-decoration: underline;
}

.chat-widget-body .chat-timestamp {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}

.chat-widget-body .agent-row .chat-timestamp {
    text-align: left;
}

/* ==========================================================================
   Closed Page (closed.php)
   ========================================================================== */
.closed-body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    background-color: #f8f9fa;
    color: #212529;
}

.closed-body .skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    z-index: 1000;
    font-weight: 600;
}

.closed-body .skip-link:focus {
    top: 0;
}

.closed-body .container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    padding: 1rem;
    box-sizing: border-box;
}

.closed-body .card {
    width: 100%;
    max-width: 600px;
    min-height: 400px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.closed-body .card-body {
    padding: 3rem 2rem;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.closed-body .card-title {
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 1.5rem 0;
    color: #1a365d;
    line-height: 1.2;
}

.closed-body .card-subtitle {
    font-size: 1.25rem;
    font-weight: 400;
    margin: 0 0 2rem 0;
    color: #2d3748;
    line-height: 1.3;
}

.closed-body .card-text {
    font-size: 1.125rem;
    margin: 1rem 0;
    line-height: 1.6;
    color: #2d3748;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.closed-body .success-icon {
    font-size: 3rem;
    color: #0C6A33;
    margin-bottom: 1rem;
    display: inline-block;
    line-height: 1;
}

.closed-body .feedback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1rem;
}

.closed-body .feedback-overlay.show {
    opacity: 1;
    visibility: visible;
}

.closed-body .feedback-modal {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-radius: 24px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
    max-width: 420px;
    width: 100%;
    padding: 2rem;
    text-align: center;
    position: relative;
    transform: scale(0.8) translateY(40px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.closed-body .feedback-overlay.show .feedback-modal {
    transform: scale(1) translateY(0);
}

.closed-body .feedback-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4591E2 0%, #3182ce 50%, #667eea 100%);
    border-radius: 24px 24px 0 0;
}

.closed-body .feedback-header {
    margin-bottom: 1.5rem;
}

.closed-body .feedback-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(135deg, #4591E2, #3182ce);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.closed-body .feedback-header p {
    color: #718096;
    font-size: 1rem;
    margin: 0;
    line-height: 1.5;
}

.closed-body .rating-container {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.closed-body .star-rating {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.closed-body .star {
    width: 48px;
    height: 48px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: rgba(0, 0, 0, 0.05);
    border: 2px solid rgba(0, 0, 0, 0.1);
    color: #cbd5e0;
}

.closed-body .star:hover {
    transform: scale(1.15) translateY(-4px);
    box-shadow: 0 8px 32px rgba(69, 145, 226, 0.4);
    background: rgba(69, 145, 226, 0.1);
    border-color: #4591E2;
}

.closed-body .star.selected,
.closed-body .star.hover-selected {
    color: #fbbf24;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-color: #fbbf24;
    box-shadow: 0 8px 32px rgba(251, 191, 36, 0.4);
}

.closed-body .star.selected {
    transform: scale(1.1);
}

.closed-body .face-rating {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.closed-body .face {
    width: 52px;
    height: 52px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: rgba(0, 0, 0, 0.05);
    border: 3px solid rgba(0, 0, 0, 0.1);
}

.closed-body .face:hover {
    transform: scale(1.2) translateY(-4px);
    box-shadow: 0 8px 32px rgba(69, 145, 226, 0.4);
}

.closed-body .face.selected,
.closed-body .face.hover-selected {
    border-color: #4591E2;
    box-shadow: 0 8px 32px rgba(69, 145, 226, 0.5);
    transform: scale(1.15);
}

.closed-body .face[data-rating="1"] { color: #e53e3e; background: linear-gradient(135deg, #fed7d7, #feb2b2); }
.closed-body .face[data-rating="2"] { color: #dd6b20; background: linear-gradient(135deg, #feebc8, #fbd38d); }
.closed-body .face[data-rating="3"] { color: #d69e2e; background: linear-gradient(135deg, #fefcbf, #f6e05e); }
.closed-body .face[data-rating="4"] { color: #38a169; background: linear-gradient(135deg, #c6f6d5, #9ae6b4); }
.closed-body .face[data-rating="5"] { color: #00a86b; background: linear-gradient(135deg, #b8f5d1, #68d391); }

.closed-body .face.selected[data-rating="1"],
.closed-body .face.hover-selected[data-rating="1"] { border-color: #e53e3e; }
.closed-body .face.selected[data-rating="2"],
.closed-body .face.hover-selected[data-rating="2"] { border-color: #dd6b20; }
.closed-body .face.selected[data-rating="3"],
.closed-body .face.hover-selected[data-rating="3"] { border-color: #d69e2e; }
.closed-body .face.selected[data-rating="4"],
.closed-body .face.hover-selected[data-rating="4"] { border-color: #38a169; }
.closed-body .face.selected[data-rating="5"],
.closed-body .face.hover-selected[data-rating="5"] { border-color: #00a86b; }

.closed-body .text-feedback-section {
    margin: 1.5rem 0;
}

.closed-body .text-feedback-section label {
    display: block;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.75rem;
    text-align: left;
    font-size: 0.95rem;
}

.closed-body .text-feedback-section textarea {
    width: 100%;
    min-height: 100px;
    max-height: 200px;
    padding: 1rem;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    outline: none;
}

.closed-body .text-feedback-section textarea:focus {
    border-color: #4591E2;
    box-shadow: 0 4px 24px rgba(69, 145, 226, 0.2), 0 0 0 4px rgba(69, 145, 226, 0.1);
    background: rgba(255, 255, 255, 0.95);
}

.closed-body .text-feedback-section textarea::placeholder {
    color: #a0aec0;
    font-style: italic;
}

.closed-body .feedback-char-counter {
    text-align: right;
    font-size: 0.8rem;
    color: #718096;
    margin-top: 0.5rem;
}

.closed-body .feedback-char-counter.warning {
    color: #dd6b20;
    font-weight: 600;
}

.closed-body .feedback-char-counter.danger {
    color: #e53e3e;
    font-weight: 700;
}

.closed-body .feedback-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: center;
}

.closed-body .feedback-btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

.closed-body .feedback-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.closed-body .feedback-btn:hover::before {
    left: 100%;
}

.closed-body .feedback-btn-submit {
    background: linear-gradient(135deg, #4591E2 0%, #3182ce 100%);
    color: white;
    box-shadow: 0 8px 24px rgba(69, 145, 226, 0.4);
}

.closed-body .feedback-btn-submit:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 36px rgba(69, 145, 226, 0.5);
}

.closed-body .feedback-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.closed-body .feedback-btn-skip {
    background: rgba(0, 0, 0, 0.05);
    color: #718096;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.closed-body .feedback-btn-skip:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #4a5568;
    transform: translateY(-2px);
}

.closed-body .feedback-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.closed-body .feedback-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.closed-body .feedback-thank-you {
    text-align: center;
    padding: 2rem;
}

.closed-body .feedback-thank-you h3 {
    color: #38a169;
    font-size: 1.5rem;
    margin: 0 0 1rem 0;
}

.closed-body .feedback-thank-you p {
    color: #718096;
    font-size: 1rem;
    margin: 0;
}

.closed-body .checkmark {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #38a169, #48bb78);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    animation: checkmarkPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes checkmarkPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

@media (prefers-contrast: high) {
    .closed-body .card {
        border: 2px solid #000;
        box-shadow: none;
    }
    .closed-body .card-title {
        color: #000;
    }
    .closed-body .card-subtitle,
    .closed-body .card-text {
        color: #000;
    }
    .closed-body .success-icon {
        color: #000;
    }
    .closed-body .feedback-modal {
        background: white;
        border: 3px solid black;
    }
    .closed-body .star, .closed-body .face {
        border-color: black;
    }
    .closed-body .feedback-btn-submit {
        background: #0066cc;
    }
}

.closed-body .card:focus-within {
    outline: 3px solid #005fcc;
    outline-offset: 2px;
}

.closed-body .star:focus,
.closed-body .face:focus,
.closed-body .feedback-btn:focus {
    outline: 3px solid #4591E2;
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .closed-body .container {
        padding: 0.5rem;
    }
    .closed-body .card {
        min-height: 350px;
    }
    .closed-body .card-body {
        padding: 2rem 1.5rem;
    }
    .closed-body .card-title {
        font-size: 1.75rem;
    }
    .closed-body .card-subtitle {
        font-size: 1.125rem;
    }
    .closed-body .card-text {
        font-size: 1rem;
    }
    .closed-body .success-icon {
        font-size: 2.5rem;
    }
    .closed-body .feedback-modal {
        margin: 1rem;
        padding: 1.5rem;
        max-width: none;
    }
    .closed-body .star, .closed-body .face {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
    .closed-body .face {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }
    .closed-body .rating-container {
        gap: 0.5rem;
        margin: 1.5rem 0;
    }
    .closed-body .star-rating, .closed-body .face-rating {
        gap: 0.25rem;
    }
    .closed-body .feedback-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    .closed-body .feedback-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .closed-body .container {
        padding: 0.25rem;
    }
    .closed-body .card-body {
        padding: 1.5rem 1rem;
    }
    .closed-body .card-title {
        font-size: 1.5rem;
    }
    .closed-body .card-subtitle {
        font-size: 1rem;
    }
    .closed-body .card-text {
        font-size: 0.9375rem;
    }
    .closed-body .success-icon {
        font-size: 2rem;
    }
}

@media print {
    .closed-body .skip-link {
        display: none;
    }
    .closed-body .card {
        box-shadow: none;
        border: 1px solid #000;
    }
}

.closed-body .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Help Page (help.php)
   ========================================================================== */
.help-body {
    --primary-color: #199600;
    --primary-dark: #147300;
    --secondary-color: #0d6efd;
    --danger-color: #960000;
    --text-muted: #6c757d;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    padding: 2rem 0;
}

.help-body .hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 1rem;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.help-body .hero-section h1 {
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 2.5rem;
}

.help-body .hero-section p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    opacity: 0.95;
}

.help-body .card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.help-body .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.help-body .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 3px solid var(--primary-color);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.help-body .card-header i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.help-body .card-body {
    padding: 1.5rem;
}

.help-body .btn-primary {
    background: var(--primary-color);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.help-body .btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(25, 150, 0, 0.3);
}

.help-body .btn-outline-primary {
    border: 2px solid white;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.help-body .btn-outline-primary:hover {
    background: white;
    color: var(--primary-color);
}

.help-body .btn-secondary {
    background: var(--text-muted);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.help-body .btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

.help-body .alert-info {
    background-color: #e7f3ff;
    border: none;
    border-left: 4px solid #0d6efd;
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
}

.help-body .icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 50%;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.help-body .feature-list {
    list-style: none;
    padding: 0;
}

.help-body .feature-list li {
    padding: 0.75rem 0;
    padding-left: 2rem;
    position: relative;
}

.help-body .feature-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.2rem;
}

.help-body .ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 0.5rem;
}

.help-body .feature-highlight {
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.help-body .tech-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 0.5rem;
    font-size: 1.25rem;
    margin-right: 0.75rem;
}

@media (max-width: 768px) {
    .help-body .hero-section h1 {
        font-size: 2rem;
    }
    .help-body {
        padding: 1rem 0;
    }
}

/* ==========================================================================
   Pre-Chat (prechat/index.php)
   ========================================================================== */
.prechat-body {
    height: 100%;
    margin: 0;
    padding: 5px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.prechat-body .chat-container {
    max-width: 600px;
    margin: 40px auto;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.prechat-body .chat-box {
    height: calc(100vh - 100px);
    max-height: 90vh;
    overflow-y: auto;
    padding-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.prechat-body .chat-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
}

.prechat-body .chat-bubble {
    padding: 10px 15px;
    border-radius: 20px;
    max-width: 75%;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.prechat-body .bot-message {
    background: #e9ecef;
}

.prechat-body .user-message-container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-end;
    width: 100%;
}

.prechat-body .user-message {
    background: #007bff;
    color: white;
    text-align: left;
}

.prechat-body .avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
    flex-shrink: 0;
}

.prechat-body #faqButtons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.prechat-body .faq-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(20px);
}

.prechat-body .faq-btn:hover {
    background-color: #0056b3;
}

.prechat-body .fade-in {
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
}

.prechat-body .typing-indicator {
    display: none;
    font-style: italic;
    color: gray;
    padding-left: 40px;
}

.prechat-body #helpButton {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease-in-out, transform 1s ease-in-out;
}

.prechat-body #helpButton.show {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Main / Login (main.php) - AI Bypass Page
   ========================================================================== */
.main-body-ai-bypass {
    font-family: Arial, sans-serif; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    height: 100vh; 
    margin: 0;
    background: linear-gradient(135deg, #ffffffff 0%, #91a4acff 100%);
}

.main-body-ai-bypass .ready-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 400px;
}

.main-body-ai-bypass .ready-icon {
    font-size: 3em;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

.main-body-ai-bypass .spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #518AB4;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
    display: none;
}

.main-body-ai-bypass .spinner.active {
    display: block;
}

.main-body-ai-bypass .status-text {
    color: #666;
    margin-top: 15px;
    font-size: 0.9em;
}

/* Error Page Styles */
.error-page-body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    height: 100vh;
    margin: 0;
    overflow: hidden;
}

.error-page-body .error-container {
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 500px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    width: 100%;
    box-sizing: border-box;
}

.error-page-body .error-icon {
    font-size: 4em;
    color: #ff6b6b;
    margin-bottom: 20px;
}

.error-page-body h1 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.error-page-body p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.error-page-body .tech-details {
    background: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 15px;
    margin: 20px 0;
    text-align: left;
    border-radius: 4px;
}

/* Thanks Page Styles */
.thanks-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f8f9fa;
}

.thanks-body .thank-you-box {
    text-align: center;
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
}

/* Security Error Page Styles */
.security-error-body {
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

.security-error-body .error-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 500px;
}

.security-error-body .error-icon {
    font-size: 3em;
    color: #e74c3c;
    margin-bottom: 20px;
}

.security-error-body h1 {
    color: #e74c3c;
    margin-bottom: 10px;
}

.security-error-body p {
    color: #666;
    line-height: 1.6;
}
