/* Chatbox Component Styles - Unique and Self-Contained */

/* Chat Floating Icon/Button */
.chatbox-floating-icon {
    position: fixed;
    z-index: 10000;
    max-width: fit-content;
    padding: 0.5rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background-color,bottom 0.3s ease;
}

.chatbox-floating-icon:hover {
    background-color: #f3f4f6;
}

/* Chat Floating Icon - Relative Container */
.chatbox-floating-icon .chatbox-relative {
    position: relative;
}

/* Profile Image in Floating Icon */
.chatbox-floating-icon .chatbox-profile-img-small {
    width: 3rem;
    height: 3rem;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    object-fit: cover;
}

/* Status Point Container */
.chatbox-status-point {
    position: relative;
}

/* Status Indicator Dot */
.chatbox-status-dot {
    position: absolute;
    bottom: 0;
    width: 1rem;
    height: 1rem;
    border-radius: 9999px;
    border: 2px solid #ffffff;
}

.chatbox-status-dot-offline {
    background-color: #9ca3af;
}

.chatbox-status-dot-online {
    background-color: #4ade80;
}

/* Status Dot Position for Floating Icon */
.chatbox-floating-icon .chatbox-status-dot {
    left: 35px;
}

/* Text Container in Floating Icon */
.chatbox-floating-icon .chatbox-text-container {
    margin-right: 2rem;
}

/* Heading in Floating Icon */
.chatbox-floating-icon .chatbox-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    letter-spacing: -0.025em;
    color: #374151;
    margin: 0;
}

.chatbox-floating-icon .chatbox-heading p {
    padding-right: 1.25rem;
    margin: 0;
    font-size: 18px;
}

/* User Status Text */
.chatbox-user-status {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: capitalize;
    margin: 0;
}
.chatbox-header .chatbox-user-status {
    color: #ffffff;
}

/* Chatbox Container */
.chatbox-container {
    position: fixed;
    z-index: 10000;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    width: 500px;
    display: none;
}

.chatbox-container.chatbox-visible {
    display: block;
}

/* Chatbox Header */
.chatbox-header {
    padding: 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: linear-gradient(45deg, #D46300, #F28C28);
    border-radius: 0.5rem 0.5rem 0 0;
}

.chatbox-header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Profile Image in Chatbox */
.chatbox-profile-img-large {
    width: 3.5rem;
    height: 3.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    object-fit: cover;
}

/* Status Dot Position for Chatbox */
.chatbox-container .chatbox-status-dot {
    left: 40px;
    width: 1.25rem;
    height: 1.25rem;
}

/* Chatbox Header Text */
.chatbox-header-text {
    margin-right: 2rem;
}

.chatbox-header-title {
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    letter-spacing: -0.025em;
    color: white;
    margin: 0;
}

.chatbox-header-title p {
    margin: 0;
}

/* Close Button */
.chatbox-close-btn {
    cursor: pointer;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.chatbox-close-btn path {
    fill: currentColor;
    color: #374151;
}

.chatbox-close-btn:hover path {
    color: #111827;
}

/* Warning Banner */
.chatbox-warning-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #dc2626;
    background-color: #fee2e2;
    padding: 0.75rem;
}

.chatbox-warning-banner svg {
    width: 1.75rem;
    height: 1.75rem;
    color: #dc2626;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.chatbox-warning-banner span {
    font-weight: 600;
}

/* Chatbox Body */
.chatbox-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Textarea */
.chatbox-textarea {
    width: 100%;
    height: 250px;
    padding: 1.5rem;
    border: none;
    overflow-y: auto;
    resize: none;
    font-family: inherit;
    font-size: inherit;
    outline: none;
}

.chatbox-textarea::placeholder {
    color: #9ca3af;
}

/* Error Message */
.chatbox-error-msg {
    color: #dc2626;
    padding: 0 1.5rem;
    margin: 0;
    font-size: 0.875rem;
}

/* Suggestion Messages Container */
.chatbox-suggestions {
    padding: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    flex-wrap: wrap;
}

/* Suggestion Message Item */
.chatbox-suggestion-msg {
    border: 1px solid #e5e7eb;
    font-size: 0.875rem;
    color: #1f2937;
    font-weight: 500;
    cursor: pointer;
    border-radius: 9999px;
    padding: 0.3rem 1rem;
    margin: 0;
    background: #f0f0f0;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    line-height: 1.2rem;
}

.chatbox-suggestion-msg:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
}

/* Footer Section */
.chatbox-footer {
    padding: 0.5rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbox-footer-text {
    font-weight: 500;
    color: #374151;
    margin: 0;
}

/* Send Button */
.chatbox-send-btn {
    color: #ffffff;
    background-color: #1d4ed8;
    font-weight: 500;
    border-radius: 9999px;
    font-size: 0.875rem;
    padding: 1rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    line-height: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.chatbox-send-btn:hover {
    background-color: #1e40af;
}

.chatbox-send-btn:focus {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.3);
}

/* Send Button SVG Icon */
.chatbox-send-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: currentColor;
}

/* Success Message Container */
.chatbox-success-container {
    padding: 1.5rem;
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.chatbox-success-container.chatbox-visible {
    display: flex !important;
}

.chatbox-success-content {
    width: 100%;
}

.chatbox-success-inner {
    text-align: center;
}

.chatbox-success-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    display: block;
}

.chatbox-success-title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: #374151;
    margin: 0 0 0.5rem 0;
}

.chatbox-success-text {
    color: #4b5563;
    font-weight: 500;
    margin-top: 0.5rem;
    margin: 0.5rem 0 0 0;
}

/* Success Buttons Container */
.chatbox-success-buttons {
    margin-top: 2rem;
    padding-top: 2rem;
    width: 100%;
}

/* Got It Button */
.chatbox-gotit-btn {
    color: #ffffff;
    background-color: #1d4ed8;
    width: 100%;
    font-weight: 500;
    border-radius: 9999px;
    padding: 0.75rem 1.5rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.chatbox-gotit-btn:hover {
    background-color: #1e40af;
}

.chatbox-gotit-btn:focus {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.3);
}

/* View Message Link */
.chatbox-view-message-link {
    padding: 0.625rem 1.25rem;
    width: 100%;
    font-weight: 500;
    text-align: center;
    color: #111827;
    background-color: #ffffff;
    border-radius: 9999px;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    display: block;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    outline: none;
}

.chatbox-view-message-link:hover {
    background-color: #f3f4f6;
    color: #1d4ed8;
}

.chatbox-view-message-link:focus {
    z-index: 10;
    box-shadow: 0 0 0 4px rgba(243, 244, 246, 0.5);
}

/* Message Notification */
chatbox{
    #incomming-msg-notification {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        padding: 0.75rem;
        border: 1px solid #e5e7eb;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
        background-color: #ffffff;
        border-radius: 0.5rem;
        position: fixed;
        right: 30px;
        bottom: 30px;
        min-width: 300px;
        transition: 0.2s all ease-in-out;
    }

    #incomming-msg-notification.hidden {
        display: none;
    }

    #msg-not-redirect-link {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        text-decoration: none;
        color: inherit;
        flex: 1;
    }

    #incomming-msg-notification .icon {
        background-color: #1d4ed8;
        color: #ffffff;
        border-radius: 9999px;
        border: 1px solid #1d4ed8;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 2.5rem;
        height: 2.5rem;
        flex-shrink: 0;
    }

    #incomming-msg-notification .icon svg {
        width: 24px;
        height: 24px;
    }

    .incomming-msg-para {
        margin: 0;
        font-size: 0.875rem;
        color: #374151;
        font-weight: 500;
    }

    #remove-notification {
        cursor: pointer;
        flex-shrink: 0;
        color: #6b7280;
        transition: color 0.2s ease;
    }

    #remove-notification:hover {
        color: #374151;
    }
}

/* Utility Classes */
.chatbox-hidden {
    display: none !important;
}

.chatbox-visible {
    display: block !important;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .chatbox-container {
        width: calc(100% - 2rem);
        left: 1rem !important;
        right: 1rem !important;
        bottom: 1rem !important;
        top: auto !important;
        max-width: 500px;
        max-height: calc(100vh - 2rem);
        display: flex;
        flex-direction: column;
    }
    
    .chatbox-container.chatbox-visible {
        display: flex !important;
    }
    
    /* Chatbox Header Mobile */
    .chatbox-header {
        padding: 1rem;
        gap: 0.75rem;
        flex-shrink: 0;
    }
    
    .chatbox-header-content {
        gap: 0.75rem;
        min-width: 0;
        flex: 1;
    }
    
    .chatbox-profile-img-large {
        width: 3rem;
        height: 3rem;
    }
    
    .chatbox-container .chatbox-status-dot {
        left: 35px;
        width: 1rem;
        height: 1rem;
    }
    
    .chatbox-header-text {
        margin-right: 0.5rem;
        min-width: 0;
        flex: 1;
    }
    
    .chatbox-header-title {
        font-size: 1rem;
        gap: 0.5rem;
    }
    
    .chatbox-header-title p {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .chatbox-user-status {
        font-size: 0.8125rem;
    }
    
    .chatbox-close-btn {
        width: 28px;
        height: 28px;
        flex-shrink: 0;
    }
    
    /* Warning Banner Mobile */
    .chatbox-warning-banner {
        padding: 0.625rem;
        font-size: 0.6875rem;
        flex-shrink: 0;
    }
    
    .chatbox-warning-banner svg {
        width: 1.5rem;
        height: 1.5rem;
        margin-right: 0.5rem;
    }
    
    /* Chatbox Body Mobile - Scrollable */
    .chatbox-body {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Textarea Mobile */
    .chatbox-textarea {
        padding: 1rem;
        height: 150px;
        flex-shrink: 0;
        font-size: 0.9375rem;
    }
    
    /* Error Message Mobile */
    .chatbox-error-msg {
        padding: 0 1rem;
        font-size: 0.8125rem;
    }
    
    /* Suggestions Mobile */
    .chatbox-suggestions {
        padding: 1rem;
        gap: 0.75rem;
        flex-shrink: 0;
    }
    
    .chatbox-suggestion-msg {
        font-size: 0.8125rem;
        padding: 0.4375rem 0.875rem;
    }
    
    /* Footer Mobile */
    .chatbox-footer {
        padding: 0.875rem 1rem;
        gap: 0.5rem;
        flex-shrink: 0;
    }
    
    .chatbox-footer-text {
        font-size: 0.8125rem;
        width: 100%;
    }
    
    .chatbox-send-btn {
        font-size: 0.8125rem;
        margin-right: 0;
        margin-bottom: 0;
        min-width: 44px;
        min-height: 44px;
        gap: 0.375rem;
    }
    
    .chatbox-send-btn svg {
        width: 18px;
        height: 18px;
    }
    
    /* Success Container Mobile */
    .chatbox-success-container {
        padding: 1rem;
    }
    
    .chatbox-success-icon {
        width: 80px;
        height: 80px;
        margin-bottom: 1rem;
    }
    
    .chatbox-success-title {
        font-size: 1.25rem;
    }
    
    .chatbox-success-text {
        font-size: 0.9375rem;
    }
    
    .chatbox-success-buttons {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
    }
    
    .chatbox-gotit-btn,
    .chatbox-view-message-link {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .chatbox-floating-icon {
        left: 1rem !important;
        right: auto;
        max-width: calc(100vw - 2rem);
        padding: 0.375rem;
        gap: 0.75rem;
    }
    
    .chatbox-floating-icon .chatbox-profile-img-small {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .chatbox-floating-icon .chatbox-text-container {
        margin-right: 0.5rem;
        min-width: 0;
        flex: 1;
    }
    
    .chatbox-floating-icon .chatbox-heading p {
        font-size: 16px;
        padding-right: 0.75rem;
    }
    
    .chatbox-floating-icon .chatbox-user-status {
        font-size: 0.75rem;
    }
    
    .chatbox-floating-icon .chatbox-status-dot {
        left: 28px;
        width: 0.875rem;
        height: 0.875rem;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .chatbox-container {
        width: calc(100% - 1rem);
        left: 0.5rem !important;
        right: 0.5rem !important;
        bottom: 0.5rem !important;
        max-height: calc(100vh - 1rem);
    }
    
    .chatbox-header {
        padding: 0.875rem;
    }
    
    .chatbox-profile-img-large {
        width: 2.75rem;
        height: 2.75rem;
    }
    
    .chatbox-container .chatbox-status-dot {
        left: 30px;
        width: 0.875rem;
        height: 0.875rem;
    }
    
    .chatbox-header-title {
        font-size: 0.9375rem;
    }
    
    .chatbox-user-status {
        font-size: 0.75rem;
    }
    
    .chatbox-warning-banner {
        padding: 0.5rem;
        font-size: 0.625rem;
    }
    
    .chatbox-warning-banner svg {
        width: 1.25rem;
        height: 1.25rem;
        margin-right: 0.375rem;
    }
    
    /* Chatbox Body Mobile - Scrollable */
    .chatbox-body {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
        -webkit-overflow-scrolling: touch;
    }
    
    .chatbox-textarea {
        padding: 0.875rem;
        height: 130px;
        flex-shrink: 0;
        font-size: 0.875rem;
    }
    
    .chatbox-error-msg {
        padding: 0 0.875rem;
        font-size: 0.75rem;
    }
    
    .chatbox-suggestions {
        padding: 0.875rem;
        gap: 0.625rem;
    }
    
    .chatbox-suggestion-msg {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
    
    .chatbox-footer {
        padding: 0.75rem 0.875rem;
    }
    
    .chatbox-footer-text {
        font-size: 0.75rem;
    }
    
    .chatbox-send-btn {
        font-size: 0.75rem;
        min-width: 44px;
        min-height: 44px;
        gap: 0.3125rem;
    }
    
    .chatbox-send-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .chatbox-success-icon {
        width: 70px;
        height: 70px;
    }
    
    .chatbox-success-title {
        font-size: 1.125rem;
    }
    
    .chatbox-success-text {
        font-size: 0.875rem;
    }
    
    .chatbox-floating-icon {
        padding: 0.25rem;
        gap: 0.5rem;
    }
    
    .chatbox-floating-icon .chatbox-profile-img-small {
        width: 2.25rem;
        height: 2.25rem;
    }
    
    .chatbox-floating-icon .chatbox-heading p {
        font-size: 14px;
        padding-right: 0.5rem;
    }
    
    .chatbox-floating-icon .chatbox-user-status {
        font-size: 0.6875rem;
    }
    
    .chatbox-floating-icon .chatbox-status-dot {
        left: 25px;
        width: 0.75rem;
        height: 0.75rem;
    }
}

/* Very small screens - hide text, show only icon */
@media (max-width: 360px) {
    .chatbox-container {
        width: 100%;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: 0 !important;
        max-height: 100vh;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
    }
    
    .chatbox-header {
        padding: 0.75rem;
    }
    
    .chatbox-profile-img-large {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .chatbox-container .chatbox-status-dot {
        left: 28px;
        width: 0.75rem;
        height: 0.75rem;
    }
    
    .chatbox-header-title {
        font-size: 0.875rem;
    }
    
    .chatbox-user-status {
        font-size: 0.6875rem;
    }
    
    .chatbox-close-btn {
        width: 26px;
        height: 26px;
    }
    
    .chatbox-warning-banner {
        padding: 0.5rem;
        font-size: 0.625rem;
    }
    
    .chatbox-warning-banner svg {
        width: 1.125rem;
        height: 1.125rem;
        margin-right: 0.375rem;
    }
    
    /* Chatbox Body Mobile - Scrollable */
    .chatbox-body {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
        -webkit-overflow-scrolling: touch;
    }
    
    .chatbox-textarea {
        padding: 0.75rem;
        height: 120px;
        flex-shrink: 0;
        font-size: 0.8125rem;
    }
    
    .chatbox-error-msg {
        padding: 0 0.75rem;
        font-size: 0.6875rem;
    }
    
    .chatbox-suggestions {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .chatbox-suggestion-msg {
        font-size: 0.6875rem;
        padding: 0.3125rem 0.625rem;
    }
    
    .chatbox-footer {
        padding: 0.625rem 0.75rem;
    }
    
    .chatbox-footer-text {
        font-size: 0.6875rem;
    }
    
    .chatbox-send-btn {
        font-size: 0.6875rem;
        min-width: 44px;
        min-height: 44px;
        gap: 0.25rem;
    }
    
    .chatbox-send-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .chatbox-success-container {
        padding: 0.75rem;
    }
    
    .chatbox-success-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 0.875rem;
    }
    
    .chatbox-success-title {
        font-size: 1rem;
    }
    
    .chatbox-success-text {
        font-size: 0.8125rem;
    }
    
    .chatbox-success-buttons {
        margin-top: 1.25rem;
        padding-top: 1.25rem;
    }
    
    .chatbox-gotit-btn,
    .chatbox-view-message-link {
        padding: 0.5625rem 1rem;
        font-size: 0.8125rem;
    }
    
    .chatbox-floating-icon .chatbox-text-container {
        display: none;
    }
    
    .chatbox-floating-icon {
        padding: 0.5rem;
    }
    
    .chatbox-floating-icon .chatbox-profile-img-small {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .chatbox-floating-icon .chatbox-status-dot {
        left: 28px;
        width: 0.875rem;
        height: 0.875rem;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 640px) and (orientation: landscape) {
    .chatbox-container {
        max-height: calc(100vh - 1rem);
        bottom: 0.5rem !important;
    }
    
    /* Chatbox Body Landscape - Scrollable */
    .chatbox-body {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
        -webkit-overflow-scrolling: touch;
    }
    
    .chatbox-textarea {
        height: 100px;
        flex-shrink: 0;
    }
    
    .chatbox-header {
        padding: 0.75rem;
    }
    
    .chatbox-suggestions {
        padding: 0.75rem;
    }
    
    .chatbox-footer {
        padding: 0.625rem 1rem;
    }
    
    .chatbox-send-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .chatbox-send-btn svg {
        width: 18px;
        height: 18px;
    }
}

