/* Smart FAQ Chatbot - Modern Design */

/* Base Styles */
#sfc-chatbot,
#sfc-chat-bubble {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    box-sizing: border-box;
    z-index: 999999;
}

/* Chat Bubble */
#sfc-chat-bubble {
    position: fixed;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#sfc-chat-bubble:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
}

#sfc-chat-bubble svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: white;
    stroke-width: 2;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Bubble Size Variations */
.sfc-bubble-small {
    width: 40px !important;
    height: 40px !important;
}

.sfc-bubble-small svg {
    width: 20px !important;
    height: 20px !important;
}

.sfc-bubble-large {
    width: 60px !important;
    height: 60px !important;
}

.sfc-bubble-large svg {
    width: 28px !important;
    height: 28px !important;
}

/* Chat Window */
#sfc-chatbot {
    position: fixed;
    width: 350px;
    height: 500px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Chat Width Variations */
.sfc-width-narrow {
    width: 300px !important;
}

.sfc-width-wide {
    width: 400px !important;
}

/* Chat Header */
.sfc-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 16px;
    position: relative;
    overflow: hidden;
}

.sfc-chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

.sfc-chat-title {
    flex: 1;
    margin-right: 10px;
    position: relative;
    z-index: 1;
}

.sfc-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

.sfc-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Chat Messages */
.sfc-chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
}

.sfc-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.sfc-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.sfc-chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.sfc-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.sfc-message {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.sfc-user-message {
    align-items: flex-end;
}

.sfc-bot-message {
    align-items: flex-start;
}

.sfc-message-content {
    max-width: 80%;
    padding: 16px 20px;
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
}

.sfc-user-message .sfc-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.sfc-bot-message .sfc-message-content {
    background: white;
    color: #333;
    border: 1px solid #e1e5e9;
    border-bottom-left-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Typing Indicator */
.sfc-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
}

.sfc-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c1c1c1;
    animation: typing 1.4s infinite ease-in-out;
}

.sfc-typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.sfc-typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Chat Input */
.sfc-chat-input {
    padding: 20px 24px;
    background: white;
    border-top: 1px solid #e1e5e9;
    display: flex;
    gap: 12px;
    align-items: center;
    position: relative;
}

.sfc-chat-input::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #e1e5e9 50%, transparent 100%);
}

#sfc-user-input {
    flex: 1;
    border: 2px solid #e1e5e9;
    border-radius: 24px;
    padding: 12px 20px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

#sfc-user-input:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#sfc-send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 24px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 70px;
    position: relative;
    overflow: hidden;
}

#sfc-send-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

#sfc-send-btn:hover::before {
    left: 100%;
}

#sfc-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

#sfc-send-btn:active {
    transform: translateY(0);
}

/* Read More Link */
.sfc-read-more {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    display: inline-block;
    margin-top: 12px;
    padding: 8px 16px;
    border-radius: 16px;
    background: rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.sfc-read-more:hover {
    background: rgba(102, 126, 234, 0.15);
    text-decoration: none;
    color: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

/* Position Variations */
.sfc-chat-bottom-right {
    bottom: 20px;
    right: 20px;
}

.sfc-chat-bottom-left {
    bottom: 20px;
    left: 20px;
}

.sfc-chat-top-right {
    top: 20px;
    right: 20px;
}

.sfc-chat-top-left {
    top: 20px;
    left: 20px;
}

/* Bubble Position Variations */
#sfc-chat-bubble.sfc-chat-bottom-right {
    bottom: 20px;
    right: 20px;
}

#sfc-chat-bubble.sfc-chat-bottom-left {
    bottom: 20px;
    left: 20px;
}

#sfc-chat-bubble.sfc-chat-top-right {
    top: 20px;
    right: 20px;
}

#sfc-chat-bubble.sfc-chat-top-left {
    top: 20px;
    left: 20px;
}

/* Chat Position Variations */
#sfc-chatbot.sfc-chat-bottom-right {
    bottom: 20px;
    right: 20px;
}

#sfc-chatbot.sfc-chat-bottom-left {
    bottom: 20px;
    left: 20px;
}

#sfc-chatbot.sfc-chat-top-right {
    top: 20px;
    right: 20px;
}

#sfc-chatbot.sfc-chat-top-left {
    top: 20px;
    left: 20px;
}

/* Shadow Variations */
.sfc-shadow-none {
    box-shadow: none !important;
}

.sfc-shadow-soft {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.sfc-shadow-medium {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2) !important;
}

.sfc-shadow-strong {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3) !important;
}

/* Border Radius Variations */
.sfc-radius-none {
    border-radius: 0 !important;
}

.sfc-radius-small {
    border-radius: 8px !important;
}

.sfc-radius-medium {
    border-radius: 12px !important;
}

.sfc-radius-large {
    border-radius: 20px !important;
}

.sfc-radius-round {
    border-radius: 25px !important;
}

/* Shortcode Button */
.sfc-shortcode-container {
    text-align: center;
    margin: 20px 0;
}

.sfc-shortcode-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.sfc-shortcode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

.sfc-animate-in {
    animation: fadeIn 0.3s ease-out;
}

.sfc-animate-out {
    animation: fadeOut 0.3s ease-in;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #sfc-chatbot {
        width: calc(100vw - 20px);
        height: calc(100vh - 40px);
        max-width: none;
        max-height: none;
        border-radius: 12px;
        position: fixed;
        top: 20px !important;
        left: 10px !important;
        right: 10px !important;
        bottom: 20px !important;
    }
    
    /* Mobile positioning - respect admin settings but ensure visibility */
    #sfc-chatbot.sfc-chat-bottom-right {
        bottom: 20px !important;
        right: 10px !important;
        left: 10px !important;
        top: 20px !important;
    }
    
    #sfc-chatbot.sfc-chat-bottom-left {
        bottom: 20px !important;
        left: 10px !important;
        right: 10px !important;
        top: 20px !important;
    }
    
    #sfc-chatbot.sfc-chat-top-right {
        top: 20px !important;
        right: 10px !important;
        left: 10px !important;
        bottom: 20px !important;
    }
    
    #sfc-chatbot.sfc-chat-top-left {
        top: 20px !important;
        left: 10px !important;
        right: 10px !important;
        bottom: 20px !important;
    }
    
    .sfc-width-narrow {
        width: calc(100vw - 20px);
    }
    
    .sfc-width-wide {
        width: calc(100vw - 20px);
    }
    
    #sfc-chat-bubble {
        width: 50px;
        height: 50px;
    }
    
    #sfc-chat-bubble.sfc-chat-bottom-right {
        bottom: 10px;
        right: 10px;
        left: auto;
        top: auto;
    }
    
    #sfc-chat-bubble.sfc-chat-bottom-left {
        bottom: 10px;
        left: 10px;
        right: auto;
        top: auto;
    }
    
    #sfc-chat-bubble.sfc-chat-top-right {
        top: 10px;
        right: 10px;
        left: auto;
        bottom: auto;
    }
    
    #sfc-chat-bubble.sfc-chat-top-left {
        top: 10px;
        left: 10px;
        right: auto;
        bottom: auto;
    }
    
    .sfc-chat-header {
        padding: 16px 20px;
        font-size: 15px;
    }
    
    .sfc-chat-messages {
        padding: 16px 20px;
        height: calc(100vh - 200px);
        max-height: none;
    }
    
    .sfc-chat-input {
        padding: 16px 20px;
    }
    
    .sfc-message-content {
        max-width: 90%;
        font-size: 15px;
        padding: 14px 18px;
    }
    
    #sfc-user-input {
        padding: 10px 16px;
        font-size: 15px;
    }
    
    #sfc-send-btn {
        padding: 10px 20px;
        font-size: 15px;
        min-width: 60px;
    }
    
    .sfc-close-btn {
        width: 28px;
        height: 28px;
        font-size: 20px;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    #sfc-chatbot {
        width: calc(100vw - 16px);
        height: calc(100vh - 32px);
        border-radius: 10px;
        position: fixed;
        top: 16px !important;
        left: 8px !important;
        right: 8px !important;
        bottom: 16px !important;
    }
    
    /* Mobile positioning for small screens */
    #sfc-chatbot.sfc-chat-bottom-right {
        bottom: 16px !important;
        right: 8px !important;
        left: 8px !important;
        top: 16px !important;
    }
    
    #sfc-chatbot.sfc-chat-bottom-left {
        bottom: 16px !important;
        left: 8px !important;
        right: 8px !important;
        top: 16px !important;
    }
    
    #sfc-chatbot.sfc-chat-top-right {
        top: 16px !important;
        right: 8px !important;
        left: 8px !important;
        bottom: 16px !important;
    }
    
    #sfc-chatbot.sfc-chat-top-left {
        top: 16px !important;
        left: 8px !important;
        right: 8px !important;
        bottom: 16px !important;
    }
    
    #sfc-chat-bubble {
        width: 45px;
        height: 45px;
    }
    
    #sfc-chat-bubble.sfc-chat-bottom-right {
        bottom: 8px;
        right: 8px;
        left: auto;
        top: auto;
    }
    
    #sfc-chat-bubble.sfc-chat-bottom-left {
        bottom: 8px;
        left: 8px;
        right: auto;
        top: auto;
    }
    
    #sfc-chat-bubble.sfc-chat-top-right {
        top: 8px;
        right: 8px;
        left: auto;
        bottom: auto;
    }
    
    #sfc-chat-bubble.sfc-chat-top-left {
        top: 8px;
        left: 8px;
        right: auto;
        bottom: auto;
    }
    
    .sfc-chat-header {
        padding: 14px 16px;
        font-size: 14px;
    }
    
    .sfc-chat-messages {
        padding: 14px 16px;
        height: calc(100vh - 180px);
        max-height: none;
    }
    
    .sfc-chat-input {
        padding: 14px 16px;
        gap: 8px;
    }
    
    .sfc-message-content {
        max-width: 95%;
        font-size: 14px;
        padding: 12px 16px;
    }
    
    #sfc-user-input {
        padding: 8px 14px;
        font-size: 14px;
    }
    
    #sfc-send-btn {
        padding: 8px 16px;
        font-size: 14px;
        min-width: 50px;
    }
    
    .sfc-close-btn {
        width: 24px;
        height: 24px;
        font-size: 18px;
    }
}

/* Extra Small Mobile Devices */
@media (max-width: 360px) {
    #sfc-chatbot {
        width: calc(100vw - 12px);
        height: calc(100vh - 24px);
        border-radius: 8px;
        position: fixed;
        top: 12px !important;
        left: 6px !important;
        right: 6px !important;
        bottom: 12px !important;
    }
    
    /* Mobile positioning for extra small screens */
    #sfc-chatbot.sfc-chat-bottom-right {
        bottom: 12px !important;
        right: 6px !important;
        left: 6px !important;
        top: 12px !important;
    }
    
    #sfc-chatbot.sfc-chat-bottom-left {
        bottom: 12px !important;
        left: 6px !important;
        right: 6px !important;
        top: 12px !important;
    }
    
    #sfc-chatbot.sfc-chat-top-right {
        top: 12px !important;
        right: 6px !important;
        left: 6px !important;
        bottom: 12px !important;
    }
    
    #sfc-chatbot.sfc-chat-top-left {
        top: 12px !important;
        left: 6px !important;
        right: 6px !important;
        bottom: 12px !important;
    }
    
    #sfc-chat-bubble {
        width: 40px;
        height: 40px;
    }
    
    #sfc-chat-bubble.sfc-chat-bottom-right {
        bottom: 6px;
        right: 6px;
        left: auto;
        top: auto;
    }
    
    #sfc-chat-bubble.sfc-chat-bottom-left {
        bottom: 6px;
        left: 6px;
        right: auto;
        top: auto;
    }
    
    #sfc-chat-bubble.sfc-chat-top-right {
        top: 6px;
        right: 6px;
        left: auto;
        bottom: auto;
    }
    
    #sfc-chat-bubble.sfc-chat-top-left {
        top: 6px;
        left: 6px;
        right: auto;
        bottom: auto;
    }
    
    .sfc-chat-header {
        padding: 12px 14px;
        font-size: 13px;
    }
    
    .sfc-chat-messages {
        padding: 12px 14px;
        height: calc(100vh - 160px);
        max-height: none;
    }
    
    .sfc-chat-input {
        padding: 12px 14px;
        gap: 6px;
    }
    
    .sfc-message-content {
        max-width: 98%;
        font-size: 13px;
        padding: 10px 14px;
    }
    
    #sfc-user-input {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    #sfc-send-btn {
        padding: 6px 14px;
        font-size: 13px;
        min-width: 45px;
    }
    
    .sfc-close-btn {
        width: 22px;
        height: 22px;
        font-size: 16px;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    #sfc-chatbot {
        height: calc(100vh - 60px);
        max-height: 400px;
    }
    
    .sfc-chat-header {
        padding: 12px 16px;
    }
    
    .sfc-chat-messages {
        padding: 12px 16px;
    }
    
    .sfc-chat-input {
        padding: 12px 16px;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    #sfc-chatbot,
    #sfc-chat-bubble {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    #sfc-chat-bubble:hover {
        transform: scale(1.05);
    }
    
    #sfc-send-btn:hover {
        transform: translateY(-1px);
    }
    
    .sfc-read-more:hover {
        transform: none;
    }
    
    /* Increase touch targets */
    #sfc-send-btn {
        min-height: 44px;
    }
    
    .sfc-close-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    #sfc-user-input {
        min-height: 44px;
    }
}

/* iPhone Specific Optimizations */
@media screen and (max-width: 414px) and (max-height: 896px) {
    #sfc-chatbot {
        width: calc(100vw - 16px);
        height: calc(100vh - 32px);
        max-height: none;
        position: fixed;
        top: 16px !important;
        left: 8px !important;
        right: 8px !important;
        bottom: 16px !important;
    }
    
    #sfc-chat-bubble {
        width: 48px;
        height: 48px;
    }
    
    .sfc-chat-header {
        padding: 16px 18px;
        font-size: 15px;
    }
    
    .sfc-chat-messages {
        padding: 16px 18px;
        color: #333333 !important;
        height: calc(100vh - 180px);
        max-height: none;
    }
    
    .sfc-chat-input {
        padding: 16px 18px;
        gap: 10px;
    }
    
    .sfc-message-content {
        max-width: 92%;
        font-size: 15px;
        padding: 14px 16px;
        line-height: 1.4;
        color: #333333 !important;
    }
    
    /* Ensure bot message text is visible on iPhone */
    .sfc-bot-message .sfc-message-content {
        color: #333333 !important;
        background-color: #ffffff !important;
        border-color: #e1e5e9 !important;
    }
    
    #sfc-user-input {
        padding: 12px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
        min-height: 44px;
        color: #333333 !important;
        background-color: #f8f9fa !important;
        border-color: #e1e5e9 !important;
    }
    
    #sfc-user-input:focus {
        color: #333333 !important;
        background-color: #ffffff !important;
        border-color: #667eea !important;
    }
    
    #sfc-send-btn {
        padding: 12px 20px;
        font-size: 16px;
        min-width: 60px;
        min-height: 44px;
    }
    
    .sfc-close-btn {
        width: 32px;
        height: 32px;
        font-size: 22px;
        min-height: 44px;
        min-width: 44px;
    }
}

/* iPhone SE and smaller devices */
@media screen and (max-width: 375px) and (max-height: 667px) {
    #sfc-chatbot {
        width: calc(100vw - 12px);
        height: calc(100vh - 24px);
        max-height: none;
        position: fixed;
        top: 12px !important;
        left: 6px !important;
        right: 6px !important;
        bottom: 12px !important;
    }
    
    #sfc-chat-bubble {
        width: 44px;
        height: 44px;
    }
    
    .sfc-chat-header {
        padding: 14px 16px;
        font-size: 14px;
    }
    
    .sfc-chat-messages {
        padding: 14px 16px;
        color: #333333 !important;
        height: calc(100vh - 160px);
        max-height: none;
    }
    
    .sfc-chat-input {
        padding: 14px 16px;
        gap: 8px;
    }
    
    .sfc-message-content {
        max-width: 95%;
        font-size: 14px;
        padding: 12px 14px;
        line-height: 1.3;
        color: #333333 !important;
    }
    
    /* Ensure bot message text is visible on iPhone SE */
    .sfc-bot-message .sfc-message-content {
        color: #333333 !important;
        background-color: #ffffff !important;
        border-color: #e1e5e9 !important;
    }
    
    #sfc-user-input {
        padding: 10px 14px;
        font-size: 16px;
        min-height: 44px;
        color: #333333 !important;
        background-color: #f8f9fa !important;
        border-color: #e1e5e9 !important;
    }
    
    #sfc-user-input:focus {
        color: #333333 !important;
        background-color: #ffffff !important;
        border-color: #667eea !important;
    }
    
    #sfc-send-btn {
        padding: 10px 16px;
        font-size: 16px;
        min-width: 50px;
        min-height: 44px;
    }
    
    .sfc-close-btn {
        width: 28px;
        height: 28px;
        font-size: 20px;
        min-height: 44px;
        min-width: 44px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    #sfc-chatbot {
        background: #1a1a1a;
        color: #ffffff;
    }
    
    .sfc-chat-messages {
        background: #2a2a2a;
    }
    
    .sfc-bot-message .sfc-message-content {
        background: #333333;
        color: #ffffff;
        border-color: #444444;
    }
    
    #sfc-user-input {
        background: #333333;
        color: #ffffff;
        border-color: #444444;
    }
    
    .sfc-chat-input {
        background: #1a1a1a;
        border-top-color: #444444;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    #sfc-chatbot,
    #sfc-chat-bubble,
    .sfc-close-btn,
    #sfc-send-btn,
    .sfc-shortcode-btn {
        transition: none;
    }
    
    .sfc-typing-indicator span {
        animation: none;
    }
}

/* Focus Styles */
#sfc-user-input:focus,
#sfc-send-btn:focus,
.sfc-close-btn:focus,
.sfc-shortcode-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    #sfc-chatbot {
        border: 2px solid #000000;
    }
    
    .sfc-chat-header {
        background: #000000;
    }
    
    .sfc-user-message .sfc-message-content {
        background: #000000;
    }
    
    .sfc-bot-message .sfc-message-content {
        background: #ffffff;
        border: 2px solid #000000;
    }
} 


/* === Chatbot Mobile Display Fixes === */

/* Ensure maximum z-index and pointer events */
#sfc-chatbot,
#sfc-chat-bubble {
    z-index: 2147483647 !important;
    pointer-events: auto !important;
}

/* Mobile-specific fixes that respect admin position settings */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        overscroll-behavior: contain;
    }

    /* Ensure proper sizing and positioning while respecting admin settings */
    #sfc-chatbot {
        max-width: 95vw !important;
        max-height: 90vh !important;
        width: 95vw !important;
        height: auto !important;
        /* Let JavaScript control visibility - don't force display: none */
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Position-specific adjustments for mobile */
    #sfc-chatbot.sfc-chat-bottom-right {
        bottom: 10px !important;
        right: 10px !important;
        left: auto !important;
        top: auto !important;
    }

    #sfc-chatbot.sfc-chat-bottom-left {
        bottom: 10px !important;
        left: 10px !important;
        right: auto !important;
        top: auto !important;
    }

    #sfc-chatbot.sfc-chat-top-right {
        top: 10px !important;
        right: 10px !important;
        left: auto !important;
        bottom: auto !important;
    }

    #sfc-chatbot.sfc-chat-top-left {
        top: 10px !important;
        left: 10px !important;
        right: auto !important;
        bottom: auto !important;
    }

    /* Bubble positioning that respects admin settings */
    #sfc-chat-bubble.sfc-chat-bottom-right {
        bottom: 10px !important;
        right: 10px !important;
        left: auto !important;
        top: auto !important;
    }

    #sfc-chat-bubble.sfc-chat-bottom-left {
        bottom: 10px !important;
        left: 10px !important;
        right: auto !important;
        top: auto !important;
    }

    #sfc-chat-bubble.sfc-chat-top-right {
        top: 10px !important;
        right: 10px !important;
        left: auto !important;
        bottom: auto !important;
    }

    #sfc-chat-bubble.sfc-chat-top-left {
        top: 10px !important;
        left: 10px !important;
        right: auto !important;
        bottom: auto !important;
    }

    /* Ensure input field has proper styling on mobile */
    #sfc-user-input {
        color: #333333 !important;
        background-color: #f8f9fa !important;
        border-color: #e1e5e9 !important;
    }

    #sfc-user-input:focus {
        color: #333333 !important;
        background-color: #ffffff !important;
        border-color: #667eea !important;
    }

    /* Ensure bot message text is visible on mobile */
    .sfc-bot-message .sfc-message-content {
        color: #333333 !important;
        background-color: #ffffff !important;
        border-color: #e1e5e9 !important;
    }

    /* Ensure all text in chat is visible */
    .sfc-chat-messages {
        color: #333333 !important;
    }

    .sfc-message-content {
        color: #333333 !important;
    }

    /* Ensure user message text is visible */
    .sfc-user-message .sfc-message-content {
        color: #ffffff !important;
        background-color: #667eea !important;
    }
}

@media (max-width: 480px) {
    .sfc-chat-messages {
        max-height: 60vh !important;
        overflow-y: auto !important;
        color: #333333 !important;
    }

    /* Ensure touch-friendly sizing */
    #sfc-user-input {
        font-size: 16px !important; /* Prevent iOS zoom */
        min-height: 44px !important;
        color: #333333 !important;
        background-color: #f8f9fa !important;
        border-color: #e1e5e9 !important;
    }

    #sfc-user-input:focus {
        color: #333333 !important;
        background-color: #ffffff !important;
        border-color: #667eea !important;
    }

    #sfc-send-btn {
        min-height: 44px !important;
    }

    .sfc-close-btn {
        min-width: 44px !important;
        min-height: 44px !important;
    }

    /* Ensure all text is visible */
    .sfc-message-content {
        color: #333333 !important;
    }

    /* Ensure bot message text is visible on small mobile */
    .sfc-bot-message .sfc-message-content {
        color: #333333 !important;
        background-color: #ffffff !important;
        border-color: #e1e5e9 !important;
    }

    /* Ensure user message text is visible */
    .sfc-user-message .sfc-message-content {
        color: #ffffff !important;
        background-color: #667eea !important;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    #sfc-chatbot {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }

    #sfc-chat-bubble {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
}

/* Force display on problematic mobile browsers - ONLY for bubble */
@media (max-width: 768px) {
    /* Only force bubble visibility, not chat panel */
    #sfc-chat-bubble:not(.sfc-hidden) {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* === Additional Mobile Text Color Fixes === */

/* Force text colors on all mobile devices */
@media (max-width: 768px) {
    /* Input field colors */
    #sfc-user-input,
    #sfc-user-input::placeholder {
        color: #333333 !important;
        background-color: #f8f9fa !important;
    }
    
    #sfc-user-input:focus,
    #sfc-user-input:focus::placeholder {
        color: #333333 !important;
        background-color: #ffffff !important;
    }
    
    /* Bot message colors */
    .sfc-bot-message .sfc-message-content,
    .sfc-bot-message .sfc-message-content * {
        color: #333333 !important;
        background-color: #ffffff !important;
    }
    
    /* User message colors */
    .sfc-user-message .sfc-message-content,
    .sfc-user-message .sfc-message-content * {
        color: #ffffff !important;
        background-color: #667eea !important;
    }
    
    /* General text colors */
    .sfc-chat-messages,
    .sfc-chat-messages *,
    .sfc-message-content,
    .sfc-message-content * {
        color: #333333 !important;
    }
    
    /* Chat title color */
    .sfc-chat-title {
        color: #333333 !important;
    }
    
    /* Read more link color */
    .sfc-read-more {
        color: #667eea !important;
    }
    
    .sfc-read-more:hover {
        color: #5a67d8 !important;
    }
}

/* iPhone-specific text color fixes */
@media screen and (max-width: 414px) and (max-height: 896px) {
    #sfc-user-input,
    #sfc-user-input::placeholder {
        color: #333333 !important;
        background-color: #f8f9fa !important;
    }
    
    .sfc-bot-message .sfc-message-content {
        color: #333333 !important;
        background-color: #ffffff !important;
    }
    
    .sfc-user-message .sfc-message-content {
        color: #ffffff !important;
        background-color: #667eea !important;
    }
}

@media screen and (max-width: 375px) and (max-height: 667px) {
    #sfc-user-input,
    #sfc-user-input::placeholder {
        color: #333333 !important;
        background-color: #f8f9fa !important;
    }
    
    .sfc-bot-message .sfc-message-content {
        color: #333333 !important;
        background-color: #ffffff !important;
    }
    
    .sfc-user-message .sfc-message-content {
        color: #ffffff !important;
        background-color: #667eea !important;
    }
}
