/**
 * AI Pulse Directory - Live Support Chat Widget Stylesheet
 * High-end glassmorphism design with fluid micro-interactions and mobile responsiveness.
 */

/* Floating Launcher Trigger */
.aip-chat-launcher {
    position: fixed;
    bottom: 26px;
    right: 26px;
    z-index: 10000004 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    box-shadow: 0 10px 30px -4px rgba(99, 102, 241, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
    cursor: pointer;
    border: none;
    outline: none;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

.aip-chat-launcher:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 16px 36px -4px rgba(99, 102, 241, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.25) inset;
}

.aip-chat-launcher:active {
    transform: scale(0.96);
}

.aip-chat-launcher-icon,
.aip-chat-launcher-close {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.aip-chat-launcher-icon svg,
.aip-chat-launcher-close svg {
    width: 28px;
    height: 28px;
}

.aip-chat-launcher-close {
    opacity: 0;
    transform: rotate(-90deg) scale(0.6);
}

.aip-chat-launcher.is-active .aip-chat-launcher-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0.6);
}

.aip-chat-launcher.is-active .aip-chat-launcher-close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Pulsing Online Ring */
.aip-chat-pulse {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: #10b981;
    border-radius: 50%;
    /*border: 3px solid #080b12;*/
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
}

.aip-chat-pulse::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #10b981;
    opacity: 0.6;
    animation: aipChatPulseAnim 2s infinite ease-out;
}

@keyframes aipChatPulseAnim {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* Launcher Unread Badge */
.aip-chat-badge {
    position: absolute;
    top: -6px;
    left: -6px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: #ef4444;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    line-height: 22px;
    text-align: center;
    border-radius: 12px;
    border: 2px solid #080b12;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.6);
    display: none;
    animation: aipBadgeBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes aipBadgeBounce {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

/* Tooltip on Launcher hover */
.aip-chat-tooltip {
    position: absolute;
    right: 74px;
    background: #0f172a;
    color: #f8fafc;
    padding: 7px 13px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.aip-chat-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -5px;
    transform: translateY(-50%);
    border-width: 5px 0 5px 5px;
    border-style: solid;
    border-color: transparent transparent transparent #0f172a;
}

.aip-chat-launcher:hover .aip-chat-tooltip {
    opacity: 1;
    transform: translateX(0);
}

/* Chatbox Window Container */
.aip-chat-window {
    position: fixed;
    bottom: 98px;
    right: 26px;
    width: 390px;
    max-width: calc(100vw - 32px);
    height: 610px;
    max-height: calc(100vh - 120px);
    background: #0d121f;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(99, 102, 241, 0.25) inset;
    display: flex;
    flex-direction: column;
    z-index: 10000005 !important;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(24px) scale(0.95);
    transform-origin: bottom right;
    transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), 
                visibility 0.28s ease,
                width 0.25s ease,
                height 0.25s ease;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #f8fafc;
}

.aip-chat-window.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Fullscreen Mode */
.aip-chat-window.is-fullscreen {
    bottom: 0 !important;
    right: 0 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    border: none !important;
    transform: none !important;
    z-index: 10000010 !important;
    box-shadow: none !important;
}

.aip-chat-window.is-fullscreen .aip-chat-header {
    border-radius: 0;
    padding: 16px 28px;
}

.aip-chat-window.is-fullscreen .aip-chat-messages-container {
    padding: 24px calc(max(20px, (100vw - 860px) / 2));
}

.aip-chat-window.is-fullscreen .aip-chat-composer {
    padding-left: calc(max(20px, (100vw - 860px) / 2));
    padding-right: calc(max(20px, (100vw - 860px) / 2));
}

.aip-chat-window.is-fullscreen .aip-chat-status-bar {
    padding-left: calc(max(20px, (100vw - 860px) / 2));
    padding-right: calc(max(20px, (100vw - 860px) / 2));
}

.aip-chat-window.is-fullscreen .aip-chat-start-scroll {
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
}

/* Minimized Docked Mode */
.aip-chat-window.is-minimized {
    height: 64px !important;
    min-height: 64px !important;
    max-height: 64px !important;
    overflow: hidden !important;
    border-radius: 18px !important;
    cursor: pointer;
    box-shadow: 0 14px 40px -6px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(99, 102, 241, 0.3) inset !important;
    transform: none !important;
}

.aip-chat-window.is-minimized .aip-chat-header {
    border-bottom: none !important;
    cursor: pointer;
}

.aip-chat-window.is-minimized .aip-chat-view,
.aip-chat-window.is-minimized .aip-chat-status-bar,
.aip-chat-window.is-minimized .aip-chat-composer,
.aip-chat-window.is-minimized .aip-chat-typing {
    display: none !important;
}

/* Header */
.aip-chat-header {
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(168, 85, 247, 0.2) 100%), #111726;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    user-select: none;
}

.aip-chat-agent-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.aip-chat-avatar-wrap {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.aip-chat-avatar-wrap img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.aip-chat-online-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #10b981;
    border: 2px solid #111726;
}

.aip-chat-title-wrap {
    min-width: 0;
}

.aip-chat-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}

.aip-chat-subtitle {
    font-size: 12px;
    color: #94a3b8;
    margin: 2px 0 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.aip-chat-subtitle-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
}

.aip-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.aip-chat-btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    padding: 0;
}

.aip-chat-btn-icon:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

.aip-chat-btn-icon svg {
    width: 16px;
    height: 16px;
}

/* View Containers */
.aip-chat-view {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    position: relative;
}

.aip-chat-view.is-active {
    display: flex;
}

/* START / ONBOARDING VIEW */
.aip-chat-start-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 20px 18px;
}

.aip-chat-start-scroll::-webkit-scrollbar,
.aip-chat-messages-container::-webkit-scrollbar {
    width: 5px;
}

.aip-chat-start-scroll::-webkit-scrollbar-thumb,
.aip-chat-messages-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.aip-chat-welcome-banner {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 18px;
}

.aip-chat-welcome-banner h3 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.aip-chat-welcome-banner p {
    margin: 0;
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.5;
}

/* User identity banner (if logged in) */
.aip-chat-user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 16px;
}

.aip-chat-user-badge-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #10b981;
    color: #080b12;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.aip-chat-user-badge-info {
    min-width: 0;
    flex: 1;
}

.aip-chat-user-badge-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aip-chat-user-badge-email {
    font-size: 11.5px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Form Groups */
.aip-chat-form-group {
    margin-bottom: 14px;
}

.aip-chat-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 6px;
}

.aip-chat-label span.req {
    color: #f43f5e;
}

.aip-chat-input,
.aip-chat-select,
.aip-chat-textarea {
    width: 100%;
    background: #141b2d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13.5px;
    color: #f8fafc;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.aip-chat-input:focus,
.aip-chat-select:focus,
.aip-chat-textarea:focus {
    border-color: #6366f1;
    background: #172036;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.aip-chat-select option {
    background: #0f172a;
    color: #f8fafc;
}

.aip-chat-textarea {
    resize: none;
    height: 80px;
    line-height: 1.45;
}

/* Start Screen Attachment */
.aip-chat-attach-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 14px;
}

.aip-chat-attach-picker:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: #6366f1;
}

.aip-chat-attach-picker svg {
    width: 18px;
    height: 18px;
    color: #818cf8;
    flex-shrink: 0;
}

.aip-chat-attach-text {
    font-size: 12.5px;
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* Submit Start Chat Button */
.aip-chat-btn-submit {
    width: 100%;
    padding: 12px 18px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 8px 20px -4px rgba(99, 102, 241, 0.4);
}

.aip-chat-btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px -4px rgba(99, 102, 241, 0.55);
}

.aip-chat-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ACTIVE CHAT VIEW */
.aip-chat-status-bar {
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 11.5px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.aip-chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #0a0e1a;
}

/* Message Item */
.aip-chat-msg {
    display: flex;
    flex-direction: column;
    max-width: 82%;
    animation: aipMsgSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes aipMsgSlideIn {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}

.aip-chat-msg.is-user {
    align-self: flex-end;
    align-items: flex-end;
}

.aip-chat-msg.is-admin,
.aip-chat-msg.is-bot {
    align-self: flex-start;
    align-items: flex-start;
}

.aip-chat-msg-sender {
    font-size: 10.5px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.aip-chat-admin-badge {
    background: #6366f1;
    color: #ffffff;
    font-size: 9.5px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    text-transform: uppercase;
}

/* Bubble */
.aip-chat-bubble {
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    padding: 8px 13px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.45;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: normal !important;
    position: relative;
    box-sizing: border-box;
    margin: 0;
    height: auto !important;
    min-height: 0 !important;
}

.aip-chat-bubble .aip-chat-text {
    display: inline;
    margin: 0;
    padding: 0;
    line-height: inherit;
}

.aip-chat-bubble > div {
    margin: 0;
    padding: 0;
}

.aip-chat-bubble p {
    margin: 0 0 6px 0;
    line-height: inherit;
}

.aip-chat-bubble p:last-child {
    margin-bottom: 0;
}

.aip-chat-msg.is-user .aip-chat-bubble {
    background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.aip-chat-msg.is-admin .aip-chat-bubble {
    background: #172036;
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.aip-chat-msg.is-bot .aip-chat-bubble {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: #e2e8f0;
    border-bottom-left-radius: 4px;
}

.aip-chat-msg-time {
    font-size: 10px;
    color: #64748b;
    margin-top: 3px;
    padding: 0 2px;
}

/* Attachment inside Bubble */
.aip-chat-attachment-card {
    margin-top: 8px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #f8fafc;
    transition: background 0.2s ease;
}

.aip-chat-attachment-card:hover {
    background: rgba(0, 0, 0, 0.4);
}

.aip-chat-attachment-thumb {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    display: block;
    margin-top: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: transform 0.2s ease;
}

.aip-chat-attachment-thumb:hover {
    transform: scale(1.02);
}

.aip-chat-attachment-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.aip-chat-attachment-info {
    min-width: 0;
    flex: 1;
}

.aip-chat-attachment-name {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aip-chat-attachment-meta {
    font-size: 10.5px;
    color: #94a3b8;
}

/* Typing Indicator */
.aip-chat-typing {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: #172036;
    border-radius: 14px;
    align-self: flex-start;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 4px;
}

.aip-chat-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #818cf8;
    animation: aipTypingBounce 1.4s infinite ease-in-out both;
}

.aip-chat-typing span:nth-child(1) { animation-delay: -0.32s; }
.aip-chat-typing span:nth-child(2) { animation-delay: -0.16s; }

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

/* Active Chat Composer Footer */
.aip-chat-composer {
    padding: 10px 14px 14px;
    background: #111726;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}

/* Pending Attachment Preview Tray */
.aip-chat-composer-tray {
    display: none;
    align-items: center;
    justify-content: space-between;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    padding: 6px 10px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #e2e8f0;
}

.aip-chat-tray-info {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.aip-chat-tray-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.aip-chat-tray-remove {
    background: none;
    border: none;
    color: #f87171;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    padding: 0 4px;
    outline: none;
}

/* Input Row */
.aip-chat-composer-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: #172036;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 6px 8px 6px 12px;
    transition: border-color 0.2s ease;
}

.aip-chat-composer-row:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.aip-chat-msg-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #f8fafc;
    font-size: 13.5px;
    outline: none;
    max-height: 90px;
    min-height: 22px;
    resize: none;
    padding: 4px 0;
    line-height: 1.4;
    font-family: inherit;
}

.aip-chat-msg-input::placeholder {
    color: #64748b;
}

.aip-chat-btn-clip,
.aip-chat-btn-send {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.aip-chat-btn-clip {
    background: transparent;
    color: #94a3b8;
}

.aip-chat-btn-clip:hover {
    color: #818cf8;
    background: rgba(255, 255, 255, 0.06);
}

.aip-chat-btn-send {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.4);
}

.aip-chat-btn-send:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 14px rgba(99, 102, 241, 0.55);
}

.aip-chat-btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Lightbox preview for full images */
.aip-chat-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(8px);
    z-index: 10000020 !important;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.aip-chat-lightbox.is-open {
    display: flex;
}

.aip-chat-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    object-fit: contain;
}

.aip-chat-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
    font-size: 20px;
    transition: background 0.2s ease;
}

.aip-chat-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Mobile Screen Breakpoints */
@media (max-width: 480px) {
    .aip-chat-launcher {
        bottom: 18px;
        right: 18px;
        width: 54px;
        height: 54px;
    }

    .aip-chat-window {
        bottom: 0;
        right: 0;
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        border: none;
    }

    .aip-chat-window.is-minimized {
        bottom: 14px !important;
        right: 14px !important;
        left: 14px !important;
        width: auto !important;
        max-width: none !important;
        height: 60px !important;
        min-height: 60px !important;
        max-height: 60px !important;
        border-radius: 16px !important;
    }

    .aip-chat-header {
        padding-top: max(16px, env(safe-area-inset-top));
    }

    .aip-chat-composer {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
}
