/**
 * Chat Widget - Merged CSS Bundle
 * This file combines all chat styling into a single file.
 * 
 * Sections included (in order):
 * 1. chat_style_1.css - Global styles, layout, input area, suggestion bar, toolbar, pickers, avatars
 * 2. chat_style_2.css - Messages area, message bubbles, reactions, status indicators
 * 3. chat_style_3.css - Picker details, lightbox, responsive breakpoints
 */

/* ============================================================================
   SECTION 1: GLOBAL STYLES, LAYOUT, INPUT AREA (from chat_style_1.css)
   ============================================================================ */
/* chat_style_1.css */

/* Global Styles (Minimal) */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: #f0f2f5;
    color: #1c1e21;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
}
.container {
    width: 90%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 15px;
}
a {
    text-decoration: none;
    color: #9b59b6;
    cursor: pointer;
}
a:hover {
    text-decoration: underline;
}

/* Profile Page Layout */
.profile-page-layout {
    display: grid;
    grid-template-columns: 430px 1fr; /* Default for larger screens */
    gap: 25px;
    padding: 10px 0 25px 0;
    width: 100%;
}

/* Profile Sidebar (Left - for gift & mode switcher) */
.profile-sidebar {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    height: fit-content;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.profile-interested-section {
    margin-top: 0;
    padding-top: 0;
}
.interaction-buttons-horizontal {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-top: 10px;
    margin-bottom: 20px;
}
.interaction-icons .icon-button {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.interaction-icons .icon-button svg {
    width: 35px;
    height: 35px;
    transition: fill 0.2s ease-in-out, stroke 0.2s ease-in-out;
}
.icon-gift {
    fill: none;
    stroke: #1c1e21;
    stroke-width: 1.5;
}
.icon-button.is-filled-gift .icon-gift {
    fill: #2196F3;
    stroke: #1565C0;
}

.mode-switcher-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 20px;
    padding-bottom: 15px;
    margin-top: 25px;
    margin-bottom: 0;
    width: 100%;
    box-sizing: border-box;
    border-top: 1px solid #eef;
    flex-wrap: wrap;
    gap: 20px;
}

.time-delay-group {
    display: flex;
    align-items: center;
}
.time-delay-group label {
    font-size: 0.9em;
    color: #4b4f56;
    margin-right: 8px;
    font-weight: 500;
    white-space: nowrap;
}
#time-delay-select {
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #ced4da;
    font-size: 0.9em;
    background-color: white;
    min-width: 50px;
    text-align: center;
    margin-right: 3px;
}
.time-delay-group .time-delay-unit {
    font-size: 0.9em;
    color: #4b4f56;
    margin-left: 3px;
    font-weight: 500;
    white-space: nowrap;
}

.mode-switch-group {
    display: flex;
    align-items: center;
}
.mode-label {
    font-size: 0.95em;
    color: #4b4f56;
    margin: 0 10px;
    cursor: pointer;
    font-weight: 500;
    transition: color 0.3s ease, font-weight 0.3s ease;
    line-height: 26px;
}
.mode-label.active-mode {
    color: #007bff;
    font-weight: bold;
}
.mode-label:not(.active-mode) {
    color: #6c757d;
}

.mode-switch {
    width: 50px;
    height: 26px;
    background-color: #bdc3c7;
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    margin: 0 5px;
}
.mode-switch.premium-active {
    background-color: #76c7c0;
}
.mode-switch-knob {
    width: 22px;
    height: 22px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    position: absolute;
    top: 2px;
    left: 2px;
    transition: left 0.25s ease-in-out;
}
.mode-switch.premium-active .mode-switch-knob {
    left: calc(100% - 22px - 2px);
}


/* Profile Main Content (Right - for chat) */
.profile-main-content {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Chat System Shell & Header */
button:disabled, .input-area-action-icon:disabled, textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
}
.chat-embed-wrapper {
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    max-height: 135vh;
}
.chat-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border-radius: 8px;
    flex-grow: 1;
    overflow: hidden;
}
.chat-header {
    padding: 12px 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0; /* This border will now be directly above #messages-area if tabs are removed */
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.chat-header-contact-info {
    display: flex;
    align-items: center;
}
.chat-header-contact-info #active-contact-avatar {
    margin-right: 10px;
    border-radius: 8px;
}
.chat-header-name-status {
    display: flex;
    flex-direction: column;
}
.chat-header-contact-info #current-chat-name {
    font-size: 1.05em;
    color: #333;
    font-weight: bold;
}
.status-line {
    display: flex;
    align-items: center;
    margin-top: 2px;
}
.online-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    flex-shrink: 0;
    transition: background-color 0.3s ease;
}
#chat-contact-status.online-status {
    font-size: 0.8em;
    color: #28a745;
    font-weight: 500;
}
#chat-contact-status.offline-status {
    font-size: 0.8em;
    color: #6c757d;
    font-weight: normal;
}
.chat-header-main-title-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.chat-header-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #4b4f56;
    margin-bottom: 2px;
}
.chat-header-slogan {
    font-size: 0.8em;
    color: #6c757d;
    font-weight: normal;
    margin-top: 0px;
    display: block;
    text-align: right;
}

/* Chat View Tabs Styles REMOVED */

/* Photo View Grid Styles (within #messages-area) REMOVED as photo features are out for now
.photo-column { ... }
.photo-column-header { ... }
.photo-view-divider { ... }
#messages-area.photo-view .photo-item { ... }
#messages-area.photo-view .photo-item img { ... }
*/

/* Input Area Shell */
.input-area.new-input-area-style {
    display: flex;
    flex-direction: column;
    padding: 8px;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
    background-color: #fff;
    position: relative;
}
.primary-input-actions-row {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 4px;
}
.message-input-field-group {
    display: flex;
    flex-grow: 1;
    align-items: center;
    border: 1.5px solid #adb5bd;
    border-radius: 26px;
    background-color: #fff;
    padding: 0 10px;
    height: 73px;
    position: relative;
    margin-right: 8px;
}
#message-input {
    flex-grow: 1;
    border: none;
    background-color: transparent;
    outline: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    font-size: 15px;
    color: #333;
    padding: 12px 5px 12px 10px;
    height: 49px;
    min-height: 49px;
    line-height: 1.5;
    resize: none;
}
#message-input::placeholder {
    color: #8e8e93;
}
.input-area-action-icon {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    color: #000;
}
.input-area-action-icon svg {
    width: 29px;
    height: 29px;
    stroke-width: 1.5;
}
#input-area-sticker-icon {
    margin-left: 4px;
    margin-right: 4px;
}
.input-controls-row {
    display: flex;
    align-items: center;
}
.input-area-send-btn-styled, #cancel-edit-btn {
    background-color: #007aff;
    color: white;
    padding: 0 18px;
    border: none;
    border-radius: 26px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    flex-shrink: 0;
    height: 73px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}
.input-area-send-btn-styled:hover {
    background-color: #005ecb;
}
#cancel-edit-btn {
    background-color: #6c757d;
}
#cancel-edit-btn:hover {
    background-color: #5a6268;
}
.input-area-viewer-avatar {
    width: 73px;
    height: 73px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #ddd;
}

/* Suggestion Bar Shell & Item Styling */
.suggestion-bar-container {
    display: flex;
    align-items: stretch;
    padding: 4px 0px;
    background-color: #f8f9fa;
    border-radius: 18px;
    box-sizing: border-box;
    min-height: 38px;
    width: 100%;
    margin-bottom: 0;
}
.suggestions-left {
    display: flex;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 4px;
    padding: 2px 6px;
    align-items: center;
    flex-grow: 1;
    flex-basis: 0;
    min-width: 0;
}
.suggestion-bar-divider {
    width: 1px;
    background-color: #ced4da;
    margin: 4px 0;
    flex-shrink: 0;
}
.suggestions-right {
    display: flex;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 4px;
    padding: 2px 6px;
    align-items: center;
    flex-grow: 1;
    flex-basis: 0;
    min-width: 0;
}
.suggestion-bar-container > .suggestions-left:only-child,
.suggestion-bar-container > .suggestions-right:only-child {
    flex-basis: 100%;
}
.suggestion-bar-container .suggestion-bar-placeholder {
    font-size: 0.85em;
    color: #6c757d;
    padding: 0 10px;
    width: 100%;
    text-align: center;
    font-style: italic;
    user-select: none;
    line-height: 30px;
}
.suggestion-item {
    padding: 6px 10px;
    font-size: 0.85em;
    color: #007bff;
    background-color: #e7f1ff;
    border: 1px solid #b8d6fb;
    border-radius: 15px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: inline-block;
    flex-shrink: 0;
    margin: 0;
    white-space: nowrap;
    line-height: 1.4;
    text-align: center;
}
.suggestion-item:hover, .suggestion-item:focus {
    background-color: #cfe2ff;
    color: #0056b3;
    outline: none;
}
.suggestion-item.emoji-suggestion {
    font-size: 1.2em;
    padding: 4px 8px;
    line-height: 1;
}
.suggestions-left::-webkit-scrollbar, .suggestions-right::-webkit-scrollbar { height: 3px; }
.suggestions-left::-webkit-scrollbar-thumb, .suggestions-right::-webkit-scrollbar-thumb { background: #ced4da; border-radius: 10px; }
.suggestions-left::-webkit-scrollbar-thumb:hover, .suggestions-right::-webkit-scrollbar-thumb:hover { background: #adb5bd; }


/* Chat Toolbar Shell */
.chat-toolbar {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding: 8px 15px;
    background-color: #fff;
    border-top: 1px solid #e9e9e9;
    flex-shrink: 0;
}
.chat-toolbar button {
    background: none;
    border: none;
    color: #606770;
    padding: 5px 8px;
    cursor: pointer;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 70px;
}
.chat-toolbar button svg {
    width: 28px;
    height: 28px;
    margin-bottom: 3px;
    stroke: #868e96;
    fill: none;
}
.chat-toolbar button:hover svg {
    stroke: #343a40;
}
.toolbar-icon-label {
    font-size: 10px;
    margin-top: 4px;
    color: #606770;
    display: block;
    line-height: 1.1;
}
.chat-toolbar button:hover .toolbar-icon-label {
    color: #1c1e21;
}
.chat-toolbar button#toggle-receipts-button.receipts-active svg {
    stroke: #007bff;
}
.chat-toolbar button#toggle-receipts-button.receipts-active .toolbar-icon-label {
    color: #007bff;
}

/* Base Picker Panel Styling (common to emoji, sticker, reaction pickers) */
#emoji-picker-panel,
#sticker-picker-panel,
#reaction-emoji-picker-panel {
    display: none;
    position: absolute;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    z-index: 1010;
    overflow: hidden;
}
#emoji-picker-panel.show,
#sticker-picker-panel.show {
    display: flex;
    flex-direction: column;
}
#sticker-picker-panel {
    width: 280px;
    max-width: 90vw;
}
#sticker-picker-panel.show {
    display: flex;
    flex-direction: column;
}

.emoji-picker-header {
    padding: 8px 10px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}
#reaction-emoji-picker-panel .emoji-picker-header {
    display: flex;
    align-items: center;
}
#emoji-search-input,
.reaction-emoji-search-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 18px;
    border: 1px solid #ced4da;
    font-size: 0.95em;
    box-sizing: border-box;
    outline: none;
}
#emoji-search-input:focus,
.reaction-emoji-search-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}
#reaction-emoji-picker-panel .reaction-emoji-search-input {
    flex-grow: 1;
    width: auto;
    padding: 8px 10px;
    font-size: 0.9em;
}

/* Avatars (General) */
.contact-avatar {
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: white;
    overflow: hidden;
    flex-shrink: 0;
    background-color: #7879F1;
}
.contact-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.contact-list-header-avatar-size {
    width: 60px;
    height: 60px;
    font-size: 1.8em;
    border-radius: 8px;
}
.message-user-avatar-size {
    width: 50px;
    height: 50px;
    font-size: 1.4em;
    margin-right: 8px;
    align-self: flex-start;
}
/* ============================================================================
   SECTION 2: MESSAGES AREA, BUBBLES, REACTIONS (from chat_style_2.css)
   ============================================================================ */
/* chat_style_2.css */

/* Messages Area - General */
#messages-area {
    padding: 15px;
    overflow-y: auto;    
    background-color: #ffffff;
    /* display: flex; */ /* Temporarily removed to simplify; children are block elements */
    /* flex-direction: column; */ /* Temporarily removed */

    min-height: 80px;    
    /* max-height: 500px; */   /* TEMPORARILY COMMENTED OUT FOR DIAGNOSTICS */
    
    position: relative;
    flex-grow: 1;        
    flex-shrink: 1;      
    flex-basis: 0%;      /* Try 0% to force growth based on available space */
}

/* For centering the placeholder when #messages-area is effectively empty */
#messages-area:not(.has-messages) {
    display: flex; /* Add display:flex here specifically for centering the placeholder */
    justify-content: center;
    align-items: center;
}

/* Default alignment when messages are present (message divs will stack as block elements) */
#messages-area.has-messages:not(.photo-view) {
    /* justify-content: flex-start; */ /* Not needed if #messages-area is not display:flex */
    /* align-items: initial;      */ /* Not needed if #messages-area is not display:flex */
}

#messages-area .message-placeholder {
    color: #888;
    text-align: center;
}

/* Individual Message Styling */
.message {
    display: flex;
    margin-bottom: 5px;
    max-width: 100%;
    position: relative;
}
.message.sent {
    justify-content: flex-end;
}
.message.received {
    justify-content: flex-start;
}
.message-details {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    position: relative;
    overflow: visible;
}
.message.sent .message-details {
    align-items: flex-end;
}
.message.received .message-details {
    align-items: flex-start;
    padding-bottom: 18px;
}
.message.received .message-details.has-no-hover-timestamp,
.message.message-type-surprise .message-details {
    padding-bottom: 0;
}

/* Message Sender Name */
.message-sender-name {
    font-size: 0.8em;
    font-weight: bold;
    margin-bottom: 4px;
    color: #555;
    padding: 0 5px;
}
.edited-text-indicator {
    font-size: 0.85em;
    color: #6c757d;
    font-style: italic;
    margin: 0 3px;
}

/* Message Bubble Base Styling */
.message-bubble-base {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    padding: 8px 12px;
    border-radius: 18px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    font-size: 15px;
    position: relative;
    margin-bottom: 0px;
}
.message-bubble-base .message-text-content {
    white-space: pre-line;
    overflow-wrap: break-word;
    word-break: break-word;
}
.message-bubble-sent {
    background-color: #007bff;
    color: white;
    border-bottom-right-radius: 5px;
}
.message-bubble-received {
    background-color: #f0f2f5;
    color: #1c1e21;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 5px;
}
.message-bubble-base.message-bubble-emoji-only {
    font-size: 2em;
    line-height: 1.2;
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
}
.message-bubble-base.message-bubble-emoji-only .message-text-content {
    font-size: inherit;
}
.message-bubble-base.message-bubble-emoji-only.image-only { 
    font-size: 15px; 
    line-height: 1.4;
}

/* Quoted Text Block */
.message-quote-block {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    background-color: #e9ecef;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 4px solid #adb5bd;
    font-size: 0.9em;
    color: #495057;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.message.sent .message-bubble-base .message-quote-block {
    background-color: #d1e7ff;
    border-left-color: #0056b3;
    color: #004085;
}

/* Message Status */
.message-status-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 1px;
    padding-right: 5px;
    height: 16px;
}
.message-status-container .message-timestamp {
    font-size: 0.7em;
    color: #6c757d;
    position: static;
    opacity: 0;
    transition: opacity 0.15s ease-in-out;
}
.message.sent .message-details:hover .message-status-container .message-timestamp {
    opacity: 1;
}
.message-receipts svg {
    width: 14px;
    height: 14px;
    stroke-width: 1.7;
    vertical-align: middle;
}
.receipt-delivered svg { stroke: #adb5bd; }
.receipt-read svg { stroke: #007bff; }
.chat-panel.hide-read-receipts .message-receipts {
    display: none !important;
}
.message.received .message-details .message-timestamp-hover {
    font-size: 0.7em;
    color: #888;
    padding: 0 5px;
    position: absolute;
    bottom: 3px;
    left: 5px;
    opacity: 0;
    transition: opacity 0.15s ease-in-out;
    white-space: nowrap;
    z-index: 1;
}
.message.received .message-details:hover .message-timestamp-hover {
    opacity: 1;
}

/* Deleted Message Placeholder */
.message-bubble-base.deleted-placeholder {
    background-color: #f0f2f5;
    color: #65676b;
    font-style: italic;
    font-size: 0.9em;
    border: 1px solid #e0e0e0;
    padding: 6px 10px;
    text-align: left;
    min-height: initial;
    display: inline-block;
}
.message.sent .message-bubble-base.deleted-placeholder {
    background-color: #e9eaf3;
}
.deleted-message-info-timestamp {
    font-size: 0.7em;
    color: #888;
    padding: 0 5px;
    position: absolute;
    bottom: -15px;
    opacity: 0;
    transition: opacity 0.15s ease-in-out;
    white-space: nowrap;
    z-index: 1;
}
.message .message-details:hover .deleted-message-info-timestamp { opacity: 1; }
.message.sent .message-details:hover .deleted-message-info-timestamp { right: 5px; left: auto; }
.message.received .message-details:hover .deleted-message-info-timestamp { left: 5px; right: auto; }

/* Special Message Types: Surprise */
.message.message-type-surprise {
    justify-content: center;
    margin-top: 15px;
    margin-bottom: 15px;
}
.message.message-type-surprise .message-details {
    align-items: center;
    max-width: 90%;
}
.message.message-type-surprise .message-sender-name { display: none; }
.message-bubble-base.message-surprise {
    background-color: #e8dff5;
    color: #333;
    border: 1px solid #c8b0e0;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 10px 15px;
    border-radius: 18px;
    gap: 10px;
}
.message-surprise .surprise-text { order: 2; }
.message-surprise .surprise-icon { font-size: 2.2em; line-height: 1; order: 1; }

/* Images and Stickers in Messages */
.message-bubble-base .chat-image { 
    display: block;
    max-width: 200px;  
    max-height: 180px; 
    width: auto;       
    height: auto;      
    object-fit: cover; 
    border-radius: 10px; 
    margin-top: 5px;
    cursor: pointer;
    border: 1px solid #eee; 
}
.message-bubble-base.image-only {
    padding: 5px !important;
    background-color: transparent !important;
    border: none !important;
    display: inline-block; 
    line-height: 0; 
}
.message-bubble-base .chat-sticker-image { 
    max-width: 100px;
    max-height: 100px;
    display: block;
}

/* Photo Comment Message Type */
.message-bubble-base.message-photo-comment {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 12px !important;
}
.message.sent .message-bubble-base.message-photo-comment {
    background-color: #007bff;
    color: white;
}
.message.sent .message-bubble-base.message-photo-comment .photo-comment-text {
    color: white;
}
.photo-comment-text {
    flex-grow: 1;
    word-wrap: break-word;
}
.photo-comment-thumbnail-link {
    display: block;
    flex-shrink: 0;
}
.photo-comment-thumbnail { 
    max-width: 80px;
    max-height: 70px;
    border-radius: 6px;
    border: 1px solid #ccc;
    object-fit: cover;
    cursor: pointer;
    display: block;
}

/* REACTION/ACTION BAR STYLES */
.message-reaction-options, .message-actions-menu {
    display: none;
    position: absolute;
    bottom: calc(100% + 2px);
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 4px 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    z-index: 10;
    white-space: nowrap;
    align-items: center;
    gap: 2px;
    left: 50%;
    transform: translateX(-50%);
}
.message.sent .message-details:hover .message-actions-menu,
.message.received .message-details:hover .message-reaction-options {
    display: flex;
}
.message.sent .message-actions-menu {
    left: auto;
    right: 0;
    transform: translateX(0);
}
.message.received .message-reaction-options {
    transform: translateX(-30%); 
}

.reaction-bar-divider {
    width: 1px;
    height: 16px;
    background-color: #ccc;
    margin: 0 6px;
    align-self: center;
}

.reaction-option-btn, .message-action-item {
    background: none; border: none; padding: 2px 4px; cursor: pointer;
    border-radius: 4px; display: flex; align-items: center;
    justify-content: center; position: relative;
}
.reaction-option-btn:hover, .message-action-item:hover { background-color: #f0f2f5; }
.message-action-item svg { width: 18px; height: 18px; color: #555; }
.message-action-item:hover svg { color: #1c1e21; }
.reaction-option-btn { font-size: 20px; } 
.reaction-option-btn .reaction-emoji-text { display: inline-block; transition: transform 0.2s ease-in-out; }
.reaction-option-btn:hover .reaction-emoji-text { transform: rotate(20deg) scale(1.25); }
.reaction-option-btn svg { width: 18px; height: 18px; fill: #555; stroke: none; } 
.reaction-option-btn.more-reactions-btn svg { fill: none; stroke: #555; stroke-width: 1.5; }
.reaction-option-btn:hover svg { fill: #1c1e21; }
.reaction-option-btn.more-reactions-btn:hover svg { fill: none; stroke: #1c1e21; }

/* --- UNIFIED TOOLTIP STYLES --- */
.custom-reaction-tooltip {
    visibility: hidden; opacity: 0; position: absolute;
    bottom: calc(100% + 5px);
    left: 50%; transform: translateX(-50%);
    background-color: rgba(45, 52, 62, 0.92);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;   
    padding: 4px 7px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 100;
    transition: opacity 0.1s ease-in-out, visibility 0.1s ease-in-out;
    pointer-events: none;
    line-height: 1.3;
}

.reaction-option-btn:hover .custom-reaction-tooltip,
.message-action-item:hover .custom-reaction-tooltip {
    visibility: visible;
    opacity: 1;
}
/* --- END OF UNIFIED TOOLTIP STYLES --- */

/* Displayed Reactions below message bubble */
.message-reactions-display {
    display: flex; flex-wrap: wrap; gap: 4px;
    margin-top: -10px; 
    padding: 0 5px; max-width: 100%; position: relative; z-index: 1;
}
.message.sent .message-reactions-display { justify-content: flex-end; margin-right: 0; }
.message.received .message-reactions-display { justify-content: flex-start; margin-left: 0; } 

.reaction-item {
    font-size: 13px; padding: 2px 6px; background-color: #e9ebee;
    border-radius: 10px; border: 1px solid #ddd; cursor: pointer;
    display: flex; align-items: center;
}
.reaction-item.user-reacted { background-color: #d0e4ff; border-color: #007bff; }
.reaction-count { font-size: 0.85em; margin-left: 3px; color: #606770; }
/* ============================================================================
   SECTION 3: PICKER DETAILS, LIGHTBOX, RESPONSIVE (from chat_style_3.css)
   ============================================================================ */
/* chat_style_3.css */

/* Picker Panel Content Details (Grids, Search, Footer Tabs) */
.emoji-picker-content { 
    flex-grow: 1;
    overflow-y: auto;
    padding: 5px 10px 10px 10px;
}
#reaction-emoji-picker-panel .reaction-picker-content { 
    padding: 5px 10px 10px 10px;
}
.emoji-category-section {
    margin-top: 10px;
}
.emoji-category-section:first-child {
    margin-top: 5px;
}
.emoji-category-title {
    font-size: 0.8em;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 8px;
    text-transform: uppercase;
    padding-left: 5px;
}
.emoji-picker-footer { 
    display: flex;
    border-top: 1px solid #e0e0e0;
    padding: 5px;
    background-color: #f8f9fa;
    overflow-x: auto; 
    flex-shrink: 0;
    justify-content: space-around;
}
#reaction-emoji-picker-panel .reaction-picker-footer { 
    padding: 5px;
}
.emoji-category-tab {
    font-size: 20px; 
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 6px;
    text-align: center;
    color: #868e96;
    opacity: 0.7;
    filter: grayscale(1); 
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
    flex-grow: 1; 
    max-width: 50px; 
}
.emoji-category-tab:hover {
    background-color: #e9ecef;
    color: #495057;
    opacity: 1;
    filter: grayscale(0);
}
.emoji-category-tab.active-category-tab {
    color: #007bff;
    background-color: #e7f1ff;
    opacity: 1;
    filter: grayscale(0);
}

/* Reaction Picker Specifics */
#reaction-emoji-picker-panel { 
    position: fixed; 
}
#reaction-emoji-picker-panel.quick-reaction-view {
    width: auto; 
    min-width: 260px; 
    max-width: 300px;
}
#reaction-emoji-picker-panel.full-reaction-view {
    width: 320px; 
    height: auto;
    max-height: 400px; 
    display: flex; 
    flex-direction: column;
}
.quick-reaction-grid-container { 
    padding: 10px;
}
.quick-reaction-grid { 
    display: grid;
    grid-template-columns: repeat(7, 1fr); 
    gap: 5px;
    justify-items: center;
}
.full-reaction-emoji-picker { 
    display: none; 
    flex-direction: column;
    width: 100%;
    height: 100%;
}
#reaction-emoji-picker-panel.full-reaction-view .full-reaction-emoji-picker {
    display: flex; 
}
.reaction-picker-back-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    padding: 0 10px 0 5px;
    cursor: pointer;
    color: #555;
    line-height: 1;
    align-self: center; 
}
.reaction-picker-back-btn:hover {
    color: #000;
}
.emoji-grid { 
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(32px, 1fr)); 
    gap: 5px;
}
#reaction-emoji-picker-panel .emoji-grid { 
    max-height: none;
}
#reaction-emoji-picker-panel.full-reaction-view .reaction-picker-content {
    flex-grow: 1; 
    overflow-y: auto;
}
.emoji-item { 
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
    font-size: 24px; 
    padding: 5px;
    text-align: center;
    cursor: pointer;
    border-radius: 4px;
}
.emoji-item:hover {
    background-color: #f0f2f5; 
}

/* Sticker Picker Content - GIPHY Powered */
.sticker-picker-header {
    padding: 10px 12px 8px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    background: linear-gradient(to bottom, rgba(255,255,255,0.98), rgba(248,250,252,0.98));
}

.sticker-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.sticker-search-wrapper .sticker-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #9ca3af;
    pointer-events: none;
    z-index: 2;
}

.sticker-search-wrapper .sticker-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 36px 10px 42px !important;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
    text-indent: 0;
}

.sticker-search-wrapper .sticker-search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.sticker-search-wrapper .sticker-search-input::placeholder {
    color: #9ca3af;
}

.sticker-search-wrapper .sticker-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: none;
    background: #e5e7eb;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: background-color 0.2s;
    z-index: 2;
}

.sticker-search-clear:hover {
    background: #d1d5db;
    color: #374151;
}

/* Quick Category Buttons */
.sticker-quick-categories {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sticker-quick-categories::-webkit-scrollbar {
    display: none;
}

.sticker-quick-cat-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.15s, background-color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sticker-quick-cat-btn:hover {
    background: #e5e7eb;
    transform: scale(1.1);
}

.sticker-quick-cat-btn:active {
    transform: scale(0.95);
}

.sticker-picker-body {
    max-height: 280px;
    overflow-y: auto;
    padding: 8px 0;
    background: #fafafa;
}

.sticker-grid {
    padding: 0 10px;
}

.sticker-section-title {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 12px 6px;
    margin: 0;
}

.sticker-items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 0 4px 8px;
}

.sticker-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    transition: transform 0.15s, background-color 0.15s;
    padding: 4px;
    background: white;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.sticker-item:hover {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    transform: scale(1.05);
}

.sticker-item:active {
    transform: scale(0.98);
}

.sticker-gif {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

/* Loading State */
.sticker-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.sticker-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: sticker-spin 0.8s linear infinite;
}

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

.sticker-loading-text {
    margin-top: 12px;
    font-size: 13px;
    color: #6b7280;
}

/* No Results */
.sticker-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    text-align: center;
}

.sticker-no-results-icon {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.6;
}

.sticker-no-results-text {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 6px;
}

.sticker-no-results-hint {
    font-size: 12px;
    color: #9ca3af;
}

/* GIPHY Attribution Footer */
.sticker-picker-footer {
    padding: 6px 12px;
    border-top: 1px solid rgba(0,0,0,0.1);
    background: #f8fafc;
}

.giphy-attribution {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    color: #6b7280;
    font-size: 11px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.giphy-attribution:hover {
    opacity: 1;
}

.giphy-logo {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

/* Chat sticker display (in messages) - for GIF stickers */
.message-bubble-base .chat-sticker-image { 
    max-width: 150px;
    max-height: 150px;
    border-radius: 8px;
}

.message-bubble-base.sticker-only {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 4px !important;
}

/* Dark mode support for sticker picker */
.dark-mode #sticker-picker-panel {
    background-color: #2d2d2d;
    border-color: #444;
}

.dark-mode .sticker-picker-body {
    background-color: #262626;
}

.dark-mode .sticker-picker-header {
    background: linear-gradient(to bottom, rgba(45,45,45,0.98), rgba(38,38,38,0.98));
    border-bottom-color: rgba(255,255,255,0.1);
}

.dark-mode .sticker-search-wrapper .sticker-search-input {
    background: #333;
    border-color: #444;
    color: #e5e7eb;
}

.dark-mode .sticker-search-wrapper .sticker-search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.dark-mode .sticker-search-wrapper .sticker-search-input::placeholder {
    color: #6b7280;
}

.dark-mode .sticker-search-wrapper .sticker-search-clear {
    background: #444;
    color: #9ca3af;
}

.dark-mode .sticker-search-wrapper .sticker-search-clear:hover {
    background: #555;
    color: #d1d5db;
}

.dark-mode .sticker-quick-cat-btn {
    background: #3a3a3a;
}

.dark-mode .sticker-quick-cat-btn:hover {
    background: #4a4a4a;
}

.dark-mode .sticker-section-title {
    color: #9ca3af;
}

.dark-mode .sticker-item {
    background: #333;
    border-color: #444;
}

.dark-mode .sticker-item:hover {
    background-color: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
}

.dark-mode .sticker-no-results-text,
.dark-mode .sticker-loading-text {
    color: #9ca3af;
}

.dark-mode .sticker-no-results-hint {
    color: #6b7280;
}

.dark-mode .sticker-picker-footer {
    background: #2a2a2a;
    border-top-color: rgba(255,255,255,0.1);
}

.dark-mode .giphy-attribution {
    color: #9ca3af;
}

/* Standard User Delay Overlay */
#standard-user-delay-overlay {
    position: absolute; 
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(233, 236, 239, 0.92); 
    z-index: 5; 
    display: none; 
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 26px; 
    padding: 10px;
    box-sizing: border-box;
    color: #495057;
    font-size: 0.9em;
    cursor: default; 
}
#standard-user-delay-overlay p {
    margin: 0 0 5px 0;
    line-height: 1.3;
}
#standard-user-delay-timer {
    font-weight: bold;
    font-size: 1.2em;
    color: #007bff;
}

/* Lightbox Styles */
.lightbox-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 2000; 
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease;
    display: flex; justify-content: center; align-items: center;
}
.lightbox-overlay.show { opacity: 1; visibility: visible; }
.lightbox-container {
    position: relative; display: flex; justify-content: center; align-items: center;
    width: 90vw; height: 85vh; 
}
.lightbox-content {
    position: relative; width: 100%; height: 100%;
    display: flex; justify-content: center; align-items: center;
    overflow: hidden; 
    cursor: zoom-in;
}
#lightbox-image {
    display: block; max-width: 100%; max-height: 100%;
    object-fit: contain; border-radius: 4px;
    transition: transform 0.3s ease-out;
    transform-origin: center center;
}
.lightbox-content.zoomed { cursor: grab; overflow: auto; }
.lightbox-content.zoomed #lightbox-image { transform: scale(2); max-width: none; max-height: none; cursor: zoom-out; }
.lightbox-close, .lightbox-prev, .lightbox-next {
    position: absolute; color: white; font-size: 30px; font-weight: bold;
    cursor: pointer; user-select: none; transition: color 0.2s ease;
    z-index: 2010; 
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { color: #bbb; }
.lightbox-close {
    top: -10px; right: -10px; font-size: 40px;
    background-color: rgba(0,0,0,0.4); border-radius: 50%;
    width: 40px; height: 40px; line-height: 38px; text-align: center;
}
.lightbox-prev, .lightbox-next {
    top: 50%; transform: translateY(-50%); padding: 16px;
    background-color: rgba(0,0,0,0.3);
}
.lightbox-prev { left: -50px; border-radius: 3px 0 0 3px; }
.lightbox-next { right: -50px; border-radius: 0 3px 3px 0; }
.lightbox-caption {
    position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%);
    color: #f1f1f1; font-size: 14px; padding: 8px 12px;
    background-color: rgba(0,0,0,0.5); border-radius: 3px; z-index: 2010;
}
.lightbox-comment-area {
    position: absolute; bottom: 60px; left: 10%; right: 10%; width: 80%;
    display: none; 
    gap: 10px; align-items: center; padding: 12px; padding-right: 50px; 
    background-color: rgba(0,0,0,0.75); border-radius: 5px; z-index: 2015;
    box-sizing: border-box;
}
#lightbox-comment-area-close-btn {
    position: absolute; top: 10px; right: 10px; width: 28px; height: 28px;
    font-size: 28px; font-weight: bold; color: #ccc; cursor: pointer;
    line-height: 28px; text-align: center; z-index: 2016; transition: color 0.2s ease;
}
#lightbox-comment-area-close-btn:hover { color: #fff; }
#lightbox-comment-input {
    flex-grow: 1; padding: 10px; border-radius: 4px; border: 1px solid #444;
    background-color: #222; color: #eee; resize: none;
    min-height: 38px; font-size: 14px;
}
#lightbox-comment-input::placeholder { color: #888; }
#lightbox-send-comment-btn {
    padding: 10px 18px; border-radius: 4px; border: none;
    background-color: #9b59b6; color: white; cursor: pointer;
    font-weight: 500; font-size: 14px; flex-shrink: 0;
}
#lightbox-send-comment-btn:hover { background-color: #8a4aa0; }
.lightbox-comment-sent-thankyou {
    position: absolute; bottom: 60px; left: 10%; right: 10%; width: 80%;
    padding: 15px; background-color: rgba(40, 167, 69, 0.85);
    color: white; text-align: center; border-radius: 5px; z-index: 2014;
    box-sizing: border-box; font-size: 14px; font-weight: 500;
}

/* Media Queries for Responsiveness */
@media (max-width: 1100px) {
    .profile-page-layout { grid-template-columns: 380px 1fr; }
}
@media (max-width: 992px) {
    .profile-page-layout { grid-template-columns: 320px 1fr; }
}

@media (max-width: 768px) {
    .profile-page-layout { grid-template-columns: 1fr; gap: 20px; padding: 0; }
    .profile-sidebar { margin-bottom: 20px; }

    .mode-switcher-container { padding-top: 15px; padding-bottom: 10px; flex-direction: column; align-items: center; }
    .time-delay-group { margin-right: 0; margin-bottom: 15px; }
    .mode-switch-group { margin-bottom: 0; }
    .time-delay-group label, .time-delay-group .time-delay-unit { font-size: 0.85em; }
    #time-delay-select { font-size: 0.8em; }
    #standard-user-delay-overlay { font-size: 0.85em; padding: 8px; border-radius: 24px; }
    #standard-user-delay-timer { font-size: 1.1em; }
    .mode-label { font-size: 0.9em; margin: 0 8px; }
    .mode-switch { width: 44px; height: 24px; border-radius: 12px;}
    .mode-switch-knob { width: 20px; height: 20px; }
    .mode-switch.premium-active .mode-switch-knob { left: calc(100% - 20px - 2px); }

    .chat-embed-wrapper { border-radius: 0; border: none; box-shadow: none; max-height: none; height: 100vh; }
    .chat-panel { max-height: 100vh; height: 100vh; border-radius: 0; }
    #messages-area { min-height: 60px; } 
    .chat-header-title { display: block; }
    .chat-header-slogan { font-size: 0.75em; text-align: left; }
    .primary-input-actions-row { margin-bottom: 2px; }
    .message-input-field-group { height: 62px; padding: 0 8px; border-radius: 24px; border-width: 1.5px; margin-right: 6px; }
    #message-input { font-size: 14px; padding: 10px 4px 10px 8px; min-height: 42px; height: 42px; }
    .input-area-action-icon svg { width: 26px; height: 26px; }
    #input-area-sticker-icon { margin-left: 3px; margin-right: 3px; }
    .input-area-send-btn-styled, #cancel-edit-btn { padding: 0 15px; font-size: 15px; height: 62px; border-radius: 24px; }
    #cancel-edit-btn { margin-left: 0; margin-right: 6px;} 
    .input-area-viewer-avatar { width: 62px; height: 62px; border-radius: 6px; }
    .suggestion-bar-container { min-height: 36px; margin-top: 0; margin-bottom: 4px; flex-wrap: wrap; }
    .suggestions-left, .suggestions-right { max-width: 100%; flex-basis: auto; }
    .suggestion-bar-divider { display: none; }
    .suggestion-bar-container:not(:has(.suggestion-bar-divider)) .suggestions-left,
    .suggestion-bar-container:not(:has(.suggestion-bar-divider)) .suggestions-right {
        padding-left: 6px; padding-right: 6px;
    }
    .suggestion-bar-placeholder { font-size: 0.8em; line-height: 28px; }
    .suggestion-item { font-size: 0.8em; padding: 5px 8px; }
    .suggestion-item.emoji-suggestion { font-size: 1.1em; padding: 3px 7px; }

    .message-bubble-base { font-size: 14px; }
    .message-bubble-base.message-bubble-emoji-only { font-size: 1.8em; line-height: 1.1; }
    .message-bubble-base.message-surprise{ padding: 10px 15px; }
    .message-bubble-base.deleted-placeholder { padding: 6px 10px; }
    .message-bubble-base.image-only { padding: 5px !important; }
    .message-surprise .surprise-icon { font-size: 2.0em; }
    .message-reaction-options, .message-actions-menu {
        bottom: calc(100% + 4px); padding: 2px 6px; gap: 1px;
    }
    /* Tooltip size for mobile corrected */
    .custom-reaction-tooltip { font-size: 0.65rem; padding: 2px 5px; } 
    .reaction-option-btn svg, .message-action-item svg { width: 16px; height: 16px; }
    .reaction-item { font-size: 12px; padding: 1px 4px; }
    .message-status-container { margin-top: 0px; padding-right: 3px; height: 14px; }
    .message-status-container .message-timestamp { font-size: 0.65em; }
    .message-receipts svg { width: 12px; height: 12px; stroke-width: 1.6; }
    .edited-text-indicator { font-size: 0.75em; }
    .message.received .message-details { padding-bottom: 16px; }
    .deleted-message-info-timestamp { font-size: 0.65em; bottom: -14px; }


    .chat-toolbar button svg { width: 24px; height: 24px; }
    #emoji-picker-panel, #sticker-picker-panel {
        width: calc(100% - 16px); max-width: 320px;
        left: auto; right: auto; bottom: auto; 
    }
    #reaction-emoji-picker-panel {
        width: calc(100% - 40px); max-width: 280px;
    }
    #reaction-emoji-picker-panel.full-reaction-view {
        max-width: 320px;
    }
    .emoji-grid { grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); }
    .emoji-item { font-size: 22px; }

    /* Photo tab specific mobile styles are removed as the tab is removed */

    /* Lightbox Mobile Styles */
    .lightbox-prev, .lightbox-next { padding: 10px; font-size: 24px; left: 5px; right: 5px; }
    .lightbox-prev {left: 5px;} .lightbox-next {right: 5px;} 
    .lightbox-close { font-size: 30px; top:5px; right: 10px; width: 30px; height:30px; line-height:28px;}
    .lightbox-container { width: 95vw; height: 90vh;}
    .lightbox-caption { bottom: 10px; font-size: 12px; }
    .lightbox-comment-area {
        bottom: 45px; left: 5%; right: 5%; width: 90%;
        padding: 10px; padding-right: 40px; 
    }
    #lightbox-comment-input { padding: 8px; font-size: 13px; }
    #lightbox-send-comment-btn { padding: 8px 12px; font-size: 13px; }
    #lightbox-comment-area-close-btn {
        top: 8px; right: 8px; width: 24px; height: 24px;
        font-size: 24px; line-height: 24px;
    }
    .lightbox-comment-sent-thankyou { bottom: 45px; font-size: 13px; padding: 12px; }
}

/* ============================================================================
   POP-OUT CHAT STYLES - Modal frame only, content uses original CSS
   ============================================================================ */

/* Pop-out button in main chat */
.popout-chat-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(100, 100, 100, 0.15);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 10;
    padding: 0;
}

.popout-chat-btn:hover {
    background: rgba(100, 100, 100, 0.25);
    transform: scale(1.05);
}

.popout-chat-btn svg {
    width: 18px;
    height: 18px;
    stroke: #555;
    stroke-width: 2;
    fill: none;
}

/* Pop-out modal overlay */
.popout-chat-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9998;
}

.popout-chat-overlay.active {
    display: block;
}

/* Pop-out modal container */
.popout-chat-modal {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 480px;
    height: 600px;
    min-width: 320px;
    min-height: 400px;
    max-width: 95vw;
    max-height: 95vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    overflow: hidden;
    flex-direction: column;
    transition: all 0.3s ease;
}

.popout-chat-modal.active {
    display: flex;
}

.popout-chat-modal.fullscreen {
    top: 10px !important;
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    width: calc(100% - 20px) !important;
    height: calc(100% - 20px) !important;
    max-width: none !important;
    max-height: none !important;
}

.popout-chat-modal.fullscreen .resize-handle {
    display: none;
}

/* Resize handles */
.popout-chat-modal .resize-handle {
    position: absolute;
    background: transparent;
    z-index: 10;
}
.popout-chat-modal .resize-handle-n { top: 0; left: 10px; right: 10px; height: 8px; cursor: n-resize; }
.popout-chat-modal .resize-handle-s { bottom: 0; left: 10px; right: 10px; height: 8px; cursor: s-resize; }
.popout-chat-modal .resize-handle-e { right: 0; top: 10px; bottom: 10px; width: 8px; cursor: e-resize; }
.popout-chat-modal .resize-handle-w { left: 0; top: 10px; bottom: 10px; width: 8px; cursor: w-resize; }
.popout-chat-modal .resize-handle-nw { top: 0; left: 0; width: 14px; height: 14px; cursor: nw-resize; }
.popout-chat-modal .resize-handle-ne { top: 0; right: 0; width: 14px; height: 14px; cursor: ne-resize; }
.popout-chat-modal .resize-handle-sw { bottom: 0; left: 0; width: 14px; height: 14px; cursor: sw-resize; }
.popout-chat-modal .resize-handle-se { bottom: 0; right: 0; width: 14px; height: 14px; cursor: se-resize; }

/* Content container - holds cloned chat panel */
.popout-chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* The moved chat panel fills the content area */
.popout-chat-content .chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 0; /* Override any border-radius from original */
}

/* Ensure pickers appear above other modal content */
.popout-chat-content #emoji-picker-panel.show,
.popout-chat-content #sticker-picker-panel.show {
    z-index: 200;
}

/* Modal controls - overlaid on top of content */
.popout-modal-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    pointer-events: none; /* Let clicks pass through to content below */
    z-index: 100;
}

/* Invisible drag handle over the header area */
.popout-drag-handle {
    position: absolute;
    top: 0;
    left: 0;
    right: 60px; /* Leave space for close button */
    height: 50px; /* Match approximate header height */
    cursor: move;
    pointer-events: auto;
}

.popout-chat-modal.fullscreen .popout-drag-handle {
    cursor: default;
}

/* Fullscreen toggle button - bottom right corner, subtle until hover */
.popout-fullscreen-toggle {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, opacity 0.2s;
    pointer-events: auto;
    z-index: 20;
    padding: 0;
    opacity: 0.3;
}

.popout-fullscreen-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
    opacity: 1;
}

.popout-fullscreen-toggle svg {
    width: 16px;
    height: 16px;
    stroke: #666;
    stroke-width: 2;
    fill: none;
}

/* Dark mode */
body.dark-mode .popout-chat-modal {
    background: #1e1e3f;
}

body.dark-mode .popout-fullscreen-toggle {
    opacity: 0.4;
}

body.dark-mode .popout-fullscreen-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    opacity: 1;
}

body.dark-mode .popout-chat-btn {
    background: rgba(150, 150, 150, 0.2);
}

body.dark-mode .popout-chat-btn:hover {
    background: rgba(150, 150, 150, 0.35);
}

body.dark-mode .popout-chat-btn svg,
body.dark-mode .popout-fullscreen-toggle svg {
    stroke: #aaa;
}

/* Mobile */
@media (max-width: 768px) {
    .popout-chat-modal {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 80vh;
        border-radius: 16px 16px 0 0;
    }
    
    .popout-chat-modal.fullscreen {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        border-radius: 0;
    }
}