.messages_counter {
    float: right;
    background: var(--messages-counter-bg);
    border-radius: 3px;
    padding: 1px;
    padding-right: 3px;
    padding-left: 3px;
    color: #fff;
    margin: 5px;
}

.box-body {
    background-color: var(--common_page_background);
    border-left: 1px solid var(--box-border-color);
    border-right: 1px solid var(--box-border-color);
    line-height: 140%;
    display: block;
    padding: 10px;
}

.box-body .prompt_header {
    padding: 20px;
    font-size: 14px;
    line-height: 18px;
    text-align: center;;
}

.box-body .choice {
    padding: 0 0 0px;
    height: 28px;
}

.box-body .button_register {
    width: 175px;
    float: left;
    display: block;
}

.box-body .button_login {
    width: 175px;
    float: right;
    display: block;
}

.box-footer {

    border: 1px solid var(--box-border-color);
    border-top: 0;
    display: block;
}

.box-footer .controls {

    padding: 8px 5px;
    background-color: var(--box-controls-bg);
    border-top: 1px solid var(--box-controls-border);
}

.box-footer .controls button {

    font-size: 11px;
    margin-left: 5px;
}

.box-footer .controls button {

    font-size: 11px;
    margin-left: 5px;
}

.box-menu-item {

    display: block;
    height: 42px;
    line-height: 42px;
    color: var(--side_menu_text_color);
    font-weight: bold;
    font-size: 11px;
    padding-left: 20px;
    text-decoration:none
}

.box-menu-item:hover{

    background-color: var(--side_menu_li_hover);
    color: var(--side_menu_text_color_hover);
    text-decoration:none
}

.access-mode-show-on-stream, .access-mode-not-show-on-stream {

    cursor: pointer;
}

.new-post-form-container {

}

.new-post-form-container .card-subtitle {

    font-weight: normal;
    font-size: 13px;
    color: #F76D9B;
}




/* Styles for Blurred "Who Liked Me" Page */
.likes-container {
    position: relative;
}

.blurred-container .standard-page.items-container {
    filter: blur(8px);
    -webkit-filter: blur(8px);
    pointer-events: none; /* Prevents clicking on blurred items */
    opacity: 0.6;
}

.subscribe-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    background: var(--overlay-background);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.subscribe-overlay h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: var(--overlay-text-primary);
}

.subscribe-overlay p {
    font-size: 16px;
    margin-bottom: 25px;
    color: var(--overlay-text-secondary);
}

.subscribe-overlay .btn-primary {
    padding: 12px 30px;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
}


/* Styles for Blurred "Guests" Page */
/* --- Subscription Blurring Styles --- */

.cardview-container.items-container {
    position: relative;
    border-radius: .25rem;
    overflow: hidden;
}

.items-view.blurred {
    filter: blur(8px);
    -webkit-filter: blur(8px);
    pointer-events: none; /* Prevents clicking on blurred items */
    user-select: none;   /* Prevents selecting text on blurred items */
}

.subscribe-overlay {
    position: absolute;
    background-color: var(--overlay-background);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    z-index: 10;
}

.subscribe-overlay h2 {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--overlay-text-primary);
}

.subscribe-overlay p {
    font-size: 1rem;
    color: var(--overlay-text-secondary);
    margin-top: 10px;
    margin-bottom: 20px;
}

/* --- New Photo Upload Grid Styles --- */

/* The main grid container */
.photo-upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr; /* 3 equal columns */
    grid-template-rows: 1fr 1fr;     /* 2 equal rows */
    grid-gap: 15px;
    margin-top: 15px;

    /* This defines the layout based on the image you sent */
    grid-template-areas:
        "main-slot slot-2 slot-3"
        "slot-4    slot-5 slot-6";
}

/* Base style for all photo slots */
.photo-slot {
    position: relative;
    cursor: pointer;
    border: 2px dashed var(--photo-slot-border-color);
    border-radius: 8px;
    background-color: var(--photo-slot-background);
    background-size: cover;
    background-position: center;
    overflow: hidden;

    /* Makes the slots square */
    aspect-ratio: 1 / 1;

    /* Center the '+' icon */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: var(--photo-slot-text);
    transition: all 0.2s ease;
}

/* Assigning grid areas to specific slots */
.photo-slot[data-slot="1"] { grid-area: main-slot; }
.photo-slot[data-slot="2"] { grid-area: slot-2; }
.photo-slot[data-slot="3"] { grid-area: slot-3; }
.photo-slot[data-slot="4"] { grid-area: slot-4; }
.photo-slot[data-slot="5"] { grid-area: slot-5; }
.photo-slot[data-slot="6"] { grid-area: slot-6; }

/* The main slot is bigger */
.photo-slot[data-slot="1"] {
    /* Main slot is twice as high */
    grid-row: span 2;
    grid-column: span 2;
    aspect-ratio: auto; /* Let it fill the 2x2 space */

    /* Adjust grid layout to 2x2 + 2 small slots if you prefer that */
    /* For the 2x3 layout in your image, let's adjust the grid */
}

/* --- REVISED GRID for your image (2x3 with large top-left) --- */
.photo-upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto auto; /* Two rows */
    grid-gap: 15px;
    margin-top: 15px;

    grid-template-areas:
        "main-slot main-slot slot-2"  /* Main slot takes 2/3 of top row */
        "slot-3    slot-4    slot-5"; /* 3 slots on bottom row */
    /* Note: This is a 5-slot grid. Your image has 6. */
    /* Let's do the 6-slot from your image */
}

/* --- FINAL GRID for your 6-slot image --- */
.photo-upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto auto; /* Two rows */
    grid-gap: 15px;
    margin-top: 15px;

    grid-template-areas:
        "main-slot main-slot slot-2"
        "main-slot main-slot slot-3"  /* Main slot is 2x2 */
        "slot-4    slot-5    slot-6";
    /* This isn't right. Let's simplify. */
}

/* --- FINAL GRID (Simple 2x3 Layout) --- */
.photo-upload-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columns */
    gap: 15px;
    margin-top: 15px;
}
.photo-slot:first-child {
    /* The first slot is 2x2 */
    grid-column: span 2;
    grid-row: span 2;
    aspect-ratio: auto; /* Let it fill */
}
/* --- End of Grid Layout --- */


/* Style for the placeholder icon/text */
.photo-slot .placeholder {
    font-size: 36px;
    line-height: 1;
}
.photo-slot .placeholder-text {
    font-size: 14px;
    margin-top: 5px;
}

/* Hide placeholder when an image is added */
.photo-slot.has-image .placeholder,
.photo-slot.has-image .placeholder-text {
    display: none;
}

/* Add a visual cue when dragging files over the drop zone */
.photo-upload-grid.dragover {
    border-color: #007bff;
    box-shadow: 0 0 10px rgba(0,123,255,0.3);
}

/* Hide the actual file input */
#onboarding-fileupload {
    display: none;
}

/* Chat */

/* --- CHAT INTERFACE STYLES --- */

/* The outer perimeter container */
.chat-input-perimeter {
    border: var(--input_text_border);       /* CHANGED: Uses variable for border */
    border-radius: 20px;
    padding: 10px 15px;
    background-color: var(--input_text_background); /* CHANGED: Uses variable so it adapts to Dark Mode */
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.chat-input-perimeter textarea.msg-input {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    resize: none;
    color: var(--input_text_color) !important; /* CHANGED: Force text color to match theme */
}



/* The textarea itself */
textarea.msg-input {
    resize: none;
    overflow: hidden;
    min-height: 24px;
    max-height: 150px;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 0;
    margin-bottom: 5px;
    width: 100%;
    line-height: 20px;
    background: transparent;
    color: var(--input_text_color) !important; /* CHANGED: Added to ensure visibility */
}

/* Ensure the toolbar fits within the perimeter */
.chat-toolbar {
    width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap; /* Allows wrapping on very small screens if needed */
}

/* Addon Buttons (Emoji, etc) */
.chat-addons .smile-button {
    background: transparent !important; /* Remove grey background */
    padding: 5px !important;
    font-size: 20px;
    color: var(--text_sub_title);
    cursor: pointer;
    transition: color 0.2s;
}

.chat-addons .smile-button:hover {
    color: var(--text_primary);
}

/* Send Button */
.btn-chat-submit {
    border-radius: 50% !important;
    width: 36px;
    height: 36px;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    flex-shrink: 0;
    margin-left: 10px;
}

.btn-chat-submit i {
    font-size: 16px;
    margin-left: -2px; /* Visual optical adjustment */
    margin-top: 0 !important;
}

/* Fix for the file input overlay */
.image-upload-button {
    position: relative;
    overflow: hidden;
}

/* ========================================================== */
/* ================= iPHONE STYLE CHAT FIX v2 =============== */
/* ========================================================== */

/* --- 1. SHARED BUBBLE STYLES (Both Sides) --- */
.message-item .card-status-text {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.4;
    max-width: 80%; /* Default Constraint for left-side messages */
    
    /* FIX: Prevent short words from splitting */
    word-break: normal !important;      /* Don't break words like "Hey" */
    overflow-wrap: break-word;          /* Only break really long words/URLs */
    word-wrap: break-word;              /* Fallback for older browsers */
    white-space: pre-wrap;              /* Preserve user's newlines/spacing */
    
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    margin-top: 4px;
    text-align: left !important; /* Text inside bubble is always left-aligned */
}

/* --- 2. THEIR MESSAGES (Gray, Left Side) --- */
.message-item:not(.message-item-right) .card-status-text {
    background-color: var(--chat-bubble-received-bg) !important;
    color: var(--chat-bubble-received-text) !important;
    border-bottom-left-radius: 4px;
    float: left;
}

/* --- 3. MY MESSAGES (Blue, Right Side) --- */
/* Wrapper: Floats the whole block right */
.message-item.message-item-right .card-header {
    width: 100%;
    display: block;
    overflow: hidden; 
}

/* Move MY Avatar to the Right */
.message-item.message-item-right .card-header a:first-child {
    float: right !important;
    margin-left: 10px !important;
    margin-right: 0 !important;
}

/* Move MY Content Wrapper to the Right */
.message-item.message-item-right .card-header .card-content {
    float: right !important;
    text-align: right;
    margin-right: 0 !important;
    width: auto; /* Allow width to shrink-wrap content */
    max-width: calc(100% - 60px); /* Prevent overlapping avatar */
}

/* Style MY Bubble (Blue) */
.message-item.message-item-right .card-status-text {
    background-color: var(--chat-bubble-sent-bg) !important;
    color: var(--chat-bubble-sent-text) !important;
    border-bottom-right-radius: 4px;
    
    /* FIX: Reset max-width to 100% relative to the parent (.card-content).
       The parent is already constrained by max-width: calc(100% - 60px),
       so this prevents the double-constraint collapse that was breaking "Hey". */
    max-width: 100%;
    display: inline-block; 
}

/* Force Text Color Inside My Bubble to White */
.message-item.message-item-right .card-status-text * {
    color: var(--chat-bubble-sent-text) !important;
}

/* --- 4. TIMESTAMPS --- */
.message-item .card-date {
    display: block;
    clear: both;
    font-size: 11px;
    color: var(--chat-timestamp-color);
    opacity: 0.7;
    margin-top: 2px;
}

/* Align my timestamps to the right */
.message-item.message-item-right .card-date {
    text-align: right;
    padding-right: 2px;
}

/* --- Comment Section Styles --- */

.comment-item {
    margin-bottom: 12px;
}

.comment-item-header {
    display: flex;
    align-items: flex-start;
}

.comment-avatar {
    margin-right: 10px;
    flex-shrink: 0;
}

.comment-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-content {
    flex-grow: 1;
    max-width: 100%;
}

.comment-bubble {
    background-color: #f0f2f5; /* Light gray background */
    border-radius: 18px;
    padding: 8px 12px;
    display: inline-block;
    position: relative;
}

/* Dark mode support (if applicable) */
body.night-mode .comment-bubble {
    background-color: #333;
    color: #fff;
}

.comment-bubble a {
    font-weight: 600;
    color: #050505;
    text-decoration: none;
}

body.night-mode .comment-bubble a {
    color: #e4e6eb;
}

.comment-text-content {
    display: block;
    font-size: 0.95rem;
    line-height: 1.3;
    margin-top: 2px;
    white-space: pre-wrap; /* Preserves line breaks */
}

.comment-actions {
    margin-top: 3px;
    margin-left: 12px;
    font-size: 12px;
    color: #65676b;
}

.comment-actions a {
    color: #65676b;
    font-weight: 600;
    margin-right: 10px;
    cursor: pointer;
    text-decoration: none;
}

.comment-actions a:hover {
    text-decoration: underline;
}

.comment-actions .comment-like-btn.active {
    color: #2078f4; /* Active Blue */
}

.comment-likes-count {
    color: #65676b;
    margin-right: 10px;
}

/* Edit Textarea Styling */
.comment-text-content textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px;
    margin-bottom: 5px;
    resize: vertical;
}


.wide{
    max-width: 100%;
    min-height: auto;
}