/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@400;500;700;900&family=Rubik:wght@300;400;500;600&display=swap');

/* Brand Color Variables */
:root {
    /* Neta Social Primary Brand Palette - "Organic Growth" */
    --primary-cobalt-blue: #1ABC9C; /* Vibrant Teal */
    --primary-amethyst-purple: #E67E22; /* Warm Coral */
    --primary-slate-gray: #34495E; /* Charcoal */
    --primary-slate-gray-light: #5D6D7E; /* Light Charcoal */
    --primary-white: #FFFFFF;
    --primary-white-soft: #FDF8F2; /* Light Beige */
    
    /* Secondary Palette - "Human Connection" */
    --secondary-creamy-beige: #F3DABC; /* Warm Sand */
    --secondary-warm-yellow: #F1C40F; /* Alert Yellow */
    --secondary-earth-brown: #C0392B; /* Terracotta */
    --secondary-olive-green: #27AE60; /* Forest Green */
    
    /* Functional/UI Accent Palette */
    --functional-highlight-yellow: #F1C40F;
    --functional-alert-red: #C0392B; /* Error Red */
    --functional-background-teal: #E8F8F5; /* Subtle Teal Background */
    --functional-action-blue: #3498DB; /* Info Blue */
    --functional-action-blue-hover: #2C80B8; /* Darker info blue */
    
    /* Layout constants */
    --mobile-input-bar-height: 90px; /* min height of fixed composer on mobile */
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    
    /* Typography */
    --font-primary: 'Heebo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-secondary: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Neutral palette */
    --neutral-black: #000000;
    --neutral-gray-550: #aaaaaa;
    --neutral-gray-500: #888888;
    --neutral-gray-400: #b3b3b3;
    --neutral-gray-240: #f0f0f0;
    --neutral-gray-300: #e0e0e0;
    --neutral-gray-100: #fafafa;

    /* Utility tints */
    --info-ink: #2B2E83;
    --notification-info-bg: #E8F4FD;
    --notification-success-bg: #EAF7F0;
    --notification-error-bg: #FDEDEC;
    --info-bubble-bg: #EAEAFF;

    /* Impersonation */
    --impersonation-accent: #FFD700;
    --impersonation-text: #2B2E83;

    /* Shadows */
    --shadow-teal-md: 0 4px 12px rgba(26, 188, 156, 0.3);
    --shadow-teal-lg: 0 6px 20px rgba(26, 188, 156, 0.35);
    --shadow-teal-xl: 0 8px 24px rgba(26, 188, 156, 0.25);
    --shadow-neutral-card: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-neutral-subtle: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-neutral-md: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-neutral-lg: 0 8px 32px rgba(0, 0, 0, 0.15);
    --shadow-menu: 0 2px 8px rgba(44, 44, 44, 0.13), 0 1.5px 4px rgba(44, 44, 44, 0.09);
    --shadow-menu-focus: 0 2px 8px rgba(44, 44, 44, 0.18);

    /* Focus/overlays/borders */
    --border-accent-soft: rgba(26, 188, 156, 0.2);
    --border-subtle: rgba(93, 109, 126, 0.2);
    --focus-ring: 0 0 0 3px rgba(26, 188, 156, 0.15);
    --overlay-scrim: rgba(0, 0, 0, 0.7);
    --overlay-dim: rgba(0, 0, 0, 0.5);
    --overlay-backdrop: rgba(0, 0, 0, 0.4);

    /* Misc UI tones */
    --muted-ink: rgba(0, 0, 0, 0.45);
    --divider-line: rgba(0, 0, 0, 0.1);
    --border-super-subtle: rgba(93, 109, 126, 0.1);
    --shadow-alert-md: 0 2px 8px rgba(192, 57, 43, 0.3);
    --shadow-alert-lg: 0 4px 12px rgba(192, 57, 43, 0.4);
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden; /* Prevent page-level scrollbars */
}

body {
    font-family: var(--font-secondary);
    line-height: 1.6;
    background-color: var(--primary-white-soft);
    color: var(--primary-slate-gray);
}

body.ltr-mode {
    direction: ltr !important;
    text-align: left !important;
}
body.rtl-mode {
    direction: rtl !important;
    text-align: right !important;
}

/* --- SEND BUTTON STYLES (minimal, icon only) --- */
#send-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background-color: var(--primary-cobalt-blue);
    color: var(--primary-white);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-teal-md);
}
#send-button:disabled,
#send-button.disabled {
    background-color: var(--primary-slate-gray-light);
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}
#send-button:hover:not(:disabled) {
    background-color: var(--primary-amethyst-purple);
    transform: translateY(-2px);
    box-shadow: var(--shadow-teal-lg);
}
#send-button .send-icon,
#send-button svg.send-svg {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* RTL support for send button icon */
body.rtl-mode #send-button svg {
    transform: scaleX(-1);
}
/* --- END SEND BUTTON STYLES --- */

.container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 70px); /* Subtract header height */
    margin: 0 auto;
    padding-top: 0;
    background: var(--primary-white-soft);
    box-sizing: border-box;
    font-family: var(--font-secondary);
    overflow: hidden; /* Prevent container scrollbars */
}

/* Login Page Styles */
.login-container {
    max-width: 580px;
    margin: 100px auto;
    padding: 48px;
    background-color: var(--primary-white);
    border-radius: 16px;
    box-shadow: var(--shadow-neutral-card);
    text-align: center;
    border: 1px solid var(--border-subtle);
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    z-index: 1005;
}

.login-container h1 {
    margin-bottom: 16px;
    color: var(--primary-cobalt-blue);
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 2rem;
    letter-spacing: -0.02em;
}

.login-container p {
    margin-bottom: 32px;
    color: var(--primary-slate-gray);
    font-family: var(--font-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
}

.google-signin-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    padding: 16px;
    background-color: var(--primary-white);
    border: 2px solid var(--primary-slate-gray-light);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-secondary);
    font-weight: 500;
    font-size: 1.1rem;
    color: var(--primary-slate-gray);
    margin: 0 auto;
}

.google-signin-button:hover {
    background-color: var(--functional-background-teal);
    border-color: var(--primary-cobalt-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-teal-xl);
}

.google-signin-button img {
    width: 18px;
    height: 18px;
    margin-right: 10px;
}

/* Chat Page Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--primary-white);
    flex: 0 0 auto;
    position: relative; /* Use relative positioning on desktop - part of normal flow */
    top: 0;
    z-index: 1005;
    box-shadow: var(--shadow-neutral-subtle);
    /* Desktop defaults */
    left: auto;
    right: auto;
    width: 100%;
    border-radius: 0;
    min-width: auto;
    overflow-x: visible;
}

/* User controls container */
.user-controls {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* RTL support for user controls */
body.rtl-mode .user-controls {
    flex-direction: row-reverse;
}

.signout-button {
    padding: 10px 20px;
    background-color: var(--functional-alert-red);
    color: var(--primary-white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 16px;
    font-family: var(--font-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: var(--shadow-alert-md);
}

.signout-button:hover {
    background-color: var(--functional-alert-red);
    transform: translateY(-2px);
    box-shadow: var(--shadow-alert-lg);
}

body.rtl-mode .signout-button {
    margin-right: 0;
    margin-left: 16px;
}

.notification-container {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    z-index: 2000;
    padding: 20px;
    max-width: 100vw;
}

body.rtl-mode .notification-container {
    right: auto;
    left: 0;
}

.notification-card {
    background: var(--functional-background-teal);
    border-radius: 12px;
    box-shadow: var(--shadow-teal-lg);
    padding: 16px;
    position: relative;
    min-width: 360px;
    max-width: 450px;
    color: var(--primary-slate-gray);
    font-family: var(--font-secondary);
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 0;
    pointer-events: auto;
    border: 1px solid var(--border-accent-soft);
}

.notification-close {
    position: absolute;
    top: 4px;
    right: 8px;
    left: auto;
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    z-index: 2;
    transition: color 0.2s;
}
body.rtl-mode .notification-close {
    left: 8px;
    right: auto;
}

.notification-close:hover {
    font-weight: 800;
}

.notification-topic-title {
    font-size: 1em;
    font-weight: 500;
    margin-bottom: 10px;
    text-align: left;
    margin-right: 18px;
    margin-left: 0;
}
body.rtl-mode .notification-topic-title {
    text-align: right;
    margin-left: 18px;
    margin-right: 0;
}

.notification-text {
    font-size: 1em;
    margin-bottom: 12px;
    white-space: pre-line;
    padding: 2px;
    text-align: left;
}
body.rtl-mode .notification-text {
    text-align: right;
}

.notification-buttons {
    display: flex;
    gap: 70px;
    margin-top: 0;
    justify-content: center;
    align-items: center;
}

.notification-button.confirm {
    background-color: #99A3FF;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.8em;
    width: 75px;
    border: none;
    color: white;
}
.notification-button.confirm:hover {
    background-color: #828AD8;
    color: #aaa;
}

.notification-button.snooze {
    background-color: #99A3FF;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.8em;
    width: 75px;
    border: none;
    color: white;
}

.notification-button.snooze:hover {
    background-color: #828AD8;
    color: #aaa;
}

.notification.info {
    background-color: var(--notification-info-bg); /* Info Blue, light */
}

.notification.success {
    background-color: var(--notification-success-bg); /* Subtle green */
}

.notification.error {
    background-color: var(--notification-error-bg); /* Subtle red */
}

/* LTR animation */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* RTL animation */
@keyframes slideInRTL {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Apply RTL animation when in RTL mode */
body.rtl-mode .notification {
    animation: slideInRTL 0.3s ease-out;
}

.chat-area-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    background: var(--primary-white);
    min-height: 0; /* Important for nested flex with scrolling */
    /* Ensure proper space distribution between chat and input */
    gap: 0;
    /* Keep chat area and suggestions stacked tightly */
    justify-content: flex-start;
}

.chat-container {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background: var(--neutral-gray-100);
    position: relative;
}

#suggestions-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0px 10px;
    background: var(--primary-white);
    margin-top: 2px;
}

#suggestions-scroller {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

#suggestions-scroller::-webkit-scrollbar {
    display: none;
}

#suggestions {
    display: inline-flex;
    gap: 8px;
    padding: 4px 0;
}

.suggestion-chip-important {
    font-weight: 700;
    border-color: #2C3E50 !important;
}

.suggestion-chip-important:hover:not(:disabled) {
    border-color: var(--primary-cobalt-blue) !important;
}

.suggestion-chip {
    border: 1px solid var(--border-subtle);
    background: var(--neutral-gray-100);
    border-radius: 9999px;
    padding: 6px 12px;
    font-size: 0.9rem;
    line-height: 1.2;
    color: var(--primary-slate-gray);
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.suggestion-chip:hover:not(:disabled) {
    background: var(--neutral-gray-240);
    border-color: var(--neutral-gray-400);
}

.suggestion-chip:focus:not(:disabled) {
    outline: none;
    box-shadow: var(--focus-ring);
    border-color: var(--primary-cobalt-blue) !important;
}

.suggestion-chip:disabled,
.suggestion-chip.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.suggestions-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--neutral-gray-500);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.suggestions-arrow:hover {
    background: var(--neutral-gray-240);
    color: var(--neutral-gray-500);
}

.suggestions-arrow:focus {
    outline: none;
    box-shadow: var(--focus-ring);
}

.suggestions-arrow[hidden] {
    display: none;
}

#chat-messages-area {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 24px 10px 24px 10px; /* Default padding for desktop */
    min-height: 0;
}

.suggestions-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    background: var(--primary-white);
    border-top: 1px solid var(--border-subtle);
}

#suggestions-scroller {
    flex: 1 1 auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    touch-action: pan-x;
    padding-top: 4px;
}
.suggestions-wrapper[dir='rtl'] {
    flex-direction: row-reverse;
}

.suggestions-wrapper[dir='rtl'] #suggestions {
    flex-direction: row-reverse;
}


#suggestions-scroller::-webkit-scrollbar {
    display: none;
}

#suggestions {
    display: inline-flex;
    gap: 10px;
    padding: 4px 0;
    width: max-content;
}

.suggestion-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--neutral-gray-300);
    background: var(--primary-white);
    color: var(--primary-slate-gray);
    border-radius: 18px;
    padding: 6px 14px;
    font-size: 0.95rem;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.suggestion-chip:hover:not(:disabled),
.suggestion-chip:focus:not(:disabled) {
    border-color: var(--primary-cobalt-blue);
    background: var(--primary-white);
    color: var(--primary-slate-gray);
    outline: none;
}

.suggestion-chip:focus-visible:not(:disabled) {
    box-shadow: var(--focus-ring);
}

.suggestion-chip:disabled,
.suggestion-chip.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.suggestions-arrow {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--neutral-gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.suggestions-arrow:hover,
.suggestions-arrow:focus {
    background: var(--neutral-gray-100);
    outline: none;
}

.suggestions-arrow:focus-visible {
    box-shadow: var(--focus-ring);
}

@media (max-width: 768px) {
    .suggestions-wrapper {
        padding: 4px 8px;
    }

    .suggestion-chip {
        font-size: 0.9rem;
        padding: 0px 8px;
    }
}

.message {
    display: flex;
    flex-direction: row;
    margin-bottom: 20px;
    max-width: 80%;
    order: 1;
}

.user-message {
    margin-left: auto;
    justify-content: flex-end;
}

.assistant-message {
    margin-right: auto;
    justify-content: flex-start;
}

/* Ensure containers inherit direction */
.chat-container,
.input-container {
    direction: inherit;
}

/* Flip message bubbles for RTL */
body.rtl-mode .message {
    flex-direction: row-reverse;
}

/* Adjust user/assistant bubble alignment for RTL */
body.rtl-mode .user-message {
    margin-right: auto;
    margin-left: 0;
    justify-content: flex-start;
}
body.rtl-mode .assistant-message {
    margin-left: 0;
    margin-right: auto;
    justify-content: flex-end;
}

.message-content {
    padding: 10px 20px 0 20px;
    border-radius: 12px;
    background-color: var(--primary-white);
    unicode-bidi: bidi-override;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--primary-slate-gray);
    font-family: var(--font-secondary);
    line-height: 1.6;
    box-shadow: var(--shadow-neutral-md);
    border: 1px solid var(--border-super-subtle);
}

.user-message .message-content,
.assistant-message .message-content {
    display: inline-block !important;
    min-width: 80px;
    max-width: 85%; /* Desktop default */
    width: auto;
    word-break: break-word;
    box-sizing: border-box;
}

/* LTR Bubble Alignment */
body.ltr-mode .user-message .message-content {
    margin-left: auto;
    margin-right: 0;
    text-align: left;
}
body.ltr-mode .assistant-message .message-content {
    margin-left: 0;
    margin-right: auto;
    text-align: left;
}

/* RTL Bubble Alignment */
body.rtl-mode .user-message .message-content {
    margin-left: 0;
    margin-right: auto;
    text-align: right;
}
body.rtl-mode .assistant-message .message-content {
    margin-left: auto;
    margin-right: 0;
    text-align: right;
}

.input-container {
    flex-shrink: 0;
    width: calc(100% - 20px);
    background: var(--primary-white);
    display: flex;
    align-items: flex-start;
    flex-direction: row;
    padding-top: 2px;
    box-sizing: border-box;
    margin: 0 10px;
    /* Desktop defaults */
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    max-width: none;
    border-radius: 0;
    z-index: auto;
}

#message-input {
    flex: 1 1 auto;
    min-width: 150px;
    padding: 13px 16px;
    border: 2px solid var(--primary-slate-gray-light);
    border-radius: 12px;
    font-size: 16px;
    resize: none;
    min-height: 54px; /* Ensure initial input height */
    max-height: 120px; /* About 3 lines */
    overflow-y: auto;
    transition: all 0.3s ease;
    box-sizing: border-box;
    margin-right: 12px;
    outline: none;
    font-family: var(--font-secondary);
    color: var(--primary-slate-gray);
    background-color: var(--primary-white);
    line-height: 1.5;
    margin-bottom: 10px;
}

/* RTL support for message input */
body.rtl-mode #message-input {
    margin-right: 0;
    margin-left: 12px;
}

#message-input:focus {
    border-color: var(--primary-cobalt-blue);
    box-shadow: var(--focus-ring);
}

#message-input::placeholder {
    color: var(--primary-slate-gray-light);
    opacity: 0.7;
}

.feedback-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    display: none;
}

.feedback-button {
    padding: 8px 16px;
    background-color: var(--neutral-gray-240);
    border: 1px solid var(--neutral-gray-350);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.feedback-button:hover {
    background-color: var(--neutral-gray-300);
}

/* Header logo styling */
.header-logo {
    height: 60px;
    width: auto;
    margin-right: 12px;
}
body.ltr-mode .header-logo {
    margin-left: 0px;
    margin-right: 10px;
}
body.rtl-mode .header-logo {
    margin-right: 0px;
    margin-left: 10px;
}

/* User display name styling */
.user-display-name {
    font-size: 0.9em;
    color: var(--primary-slate-gray);
    font-family: var(--font-secondary);
    font-weight: 300;
}

/* Markdown styles */
.markdown-content {
    line-height: 1.6;
}

.markdown-content strong,
strong {
    font-weight: 700;
}

.markdown-content h1, 
.markdown-content h2, 
.markdown-content h3 {
    margin-top: 1.2em;
    margin-bottom: 0.6em;
    font-family: var(--font-primary);
    font-weight: 700;
    color: var(--primary-slate-gray);
    letter-spacing: -0.02em;
}

.markdown-content p {
    margin-bottom: 0.5em;
    font-family: var(--font-secondary);
    line-height: 1.7;
    color: var(--primary-slate-gray);
}

.markdown-content ul, 
.markdown-content ol {
    margin-bottom: 1em;
    padding-left: 2em;
}

.markdown-content code {
    background-color: #f6f8fa;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: monospace;
}

.markdown-content pre {
    background-color: #f6f8fa;
    padding: 1em;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1em 0;
}

.markdown-content pre code {
    background-color: transparent;
    padding: 0;
}

.markdown-content blockquote {
    border-left: 4px solid #dfe2e5;
    padding-left: 1em;
    margin-left: 0;
    color: #6a737d;
}

/* Direction toggle button */
.direction-toggle-btn {
    background: var(--functional-background-teal);
    color: var(--primary-cobalt-blue);
    border: 1px solid var(--border-accent-soft);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 0.9em;
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.3s ease;
    vertical-align: middle;
    font-weight: 500;
}
.direction-toggle-btn:hover {
    background: var(--primary-cobalt-blue);
    color: var(--primary-white);
    transform: scale(1.1);
}

.message-row {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    flex-direction: row;
    width: 100%;
}
body.ltr-mode .message-row {
    flex-direction: row;
}
body.rtl-mode .message-row {
    flex-direction: row;
}

.token-count {
    font-size: 0.7em;
    color: var(--neutral-gray-500);
    min-width: 40px;
    text-align: center;
    margin: 0 0 0 10px;
    align-self: center;
    order: 2;
    display: inline-block;
}

.message {
    order: 1;
}

/* Popup styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-dim);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background-color: var(--primary-white);
    padding: 32px;
    border-radius: 16px;
    box-shadow: var(--shadow-neutral-lg);
    text-align: center;
    max-width: 420px;
    width: 90%;
    font-family: var(--font-secondary);
    color: var(--primary-slate-gray);
}

.popup-content select {
    font-size: 1.1rem;
    padding: 12px 16px;
    border: 2px solid var(--primary-slate-gray);
    border-radius: 8px;
    background-color: var(--primary-white);
    color: var(--primary-slate-gray);
    font-family: var(--font-secondary);
    width: 100%;
    margin-top: 16px;
    cursor: pointer;
}

.popup-content select:focus {
    outline: none;
    border-color: var(--primary-cobalt-blue);
    box-shadow: var(--focus-ring);
}

.popup-content select option {
    font-size: 1.1rem;
    padding: 8px;
}

.popup-buttons {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.popup-button {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: var(--font-secondary);
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.popup-button.cancel {
    background-color: var(--primary-white);
    color: var(--primary-slate-gray);
    border: 2px solid var(--primary-slate-gray);
}

.popup-button.cancel:hover {
    background-color: var(--primary-slate-gray);
    color: var(--primary-white);
    transform: translateY(-2px);
}

.popup-button.confirm {
    background-color: var(--primary-cobalt-blue);
    color: var(--primary-white);
    box-shadow: 0 4px 12px rgba(0, 82, 255, 0.3);
}

.popup-button.confirm:hover {
    background-color: var(--primary-amethyst-purple);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(127, 0, 255, 0.4);
}

/* Loading overlay styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-scrim);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: white;
}

.loader {
    border: 5px solid var(--functional-background-teal);
    border-radius: 50%;
    border-top: 5px solid var(--primary-cobalt-blue);
    width: 56px;
    height: 56px;
    animation: spin 1s linear infinite;
    margin-bottom: 24px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-message {
    font-size: 1.2em;
    text-align: center;
    margin-top: 16px;
    color: var(--primary-white);
    font-family: var(--font-secondary);
    font-weight: 500;
}

/* --- RTL Single Column Chat Fix --- */
body.rtl-mode .chat-container,
body.rtl-mode .message-row,
body.rtl-mode .message {
    direction: rtl !important;
    text-align: right !important;
}

body.rtl-mode .message-row {
    flex-direction: column !important; /* Force single column in RTL */
    align-items: stretch !important;
}

body.rtl-mode .message {
    max-width: 100% !important;
    width: 100% !important;
    flex-direction: column !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

body.rtl-mode .message-content {
    direction: rtl !important;
    text-align: right !important;
    display: block !important;
    white-space: normal !important;
}

body.rtl-mode .markdown-content ul,
body.rtl-mode .markdown-content ol {
    direction: rtl !important;
    text-align: right !important;
    padding-right: 2em !important;
    padding-left: 0 !important;
}

body.rtl-mode .markdown-content li {
    direction: rtl !important;
    text-align: right !important;
}

/* --- End RTL Single Column Chat Fix --- */

/* --- Force Single Column Chat for Both Directions --- */
.message-row,
.message {
    flex-direction: column !important;
    align-items: stretch !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* --- FINAL: Force Single Column Chat for All Directions --- */
.message-row,
.message {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.user-message,
.assistant-message {
    margin-left: 0 !important;
    margin-right: 0 !important;
    justify-content: flex-start !important;
}

.message-content {
    display: block !important;
}

/* --- Version Number Styling --- */
.version-number {
    font-size: 0.6em;
    font-weight: 500;
    opacity: 0.8;
    margin-left: 8px;
    margin-right: 0;
    vertical-align: middle;
    display: inline-block;
    font-family: var(--font-secondary);
    color: var(--primary-slate-gray-light);
}
body.rtl-mode .version-number {
    margin-left: 0;
    margin-right: 8px;
}

/* Menu Button */
.menu-button {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-cobalt-blue);
    margin-right: 0;
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 10px;
    min-width: 40px;
    min-height: 40px;
    z-index: 1001;
}

.menu-button:hover {
    background: var(--functional-background-teal);
    transform: scale(1.1);
}

/* Menu button positioning handled above */

.menu-button svg {
    width: 24px;
    height: 24px;
    color: var(--primary-cobalt-blue);
}

/* Side Menu Drawer */
.side-menu {
    position: fixed;
    top: 0;
    width: 300px;
    height: 100%;
    background-color: var(--primary-white);
    box-shadow: var(--shadow-neutral-lg);
    z-index: 1003;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    
    /* Smooth transitions */
    transition: transform 0.3s ease-in-out, visibility 0.3s;
    border-right: 1px solid rgba(112, 128, 144, 0.1);
}

body.ltr-mode .side-menu {
    left: -300px; /* Start completely off-screen to the left */
    right: auto;
}

body.rtl-mode .side-menu {
    right: -300px; /* Start completely off-screen to the right */
    left: auto;
}

.side-menu.open {
    visibility: visible;
}

body.ltr-mode .side-menu.open {
    left: 0; /* Slide to the left edge */
}

body.rtl-mode .side-menu.open {
    right: 0; /* Slide to the right edge */
}

.side-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-backdrop);
    z-index: 1002; /* Below the menu but above all other content */
    
    /* Start transparent and non-interactive */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
}

.side-menu-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}

.side-menu-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding-top: 10px;
}

.side-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 1.2em;
    font-weight: 700;
    color: var(--primary-cobalt-blue);
    padding-bottom: 16px;
    font-family: var(--font-primary);
}
.side-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.side-menu-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--primary-slate-gray);
    font-family: var(--font-secondary);
    font-weight: 500;
    border-radius: 8px;
    margin-bottom: 4px;
}
.side-menu-item:hover {
    background-color: var(--functional-background-teal);
}

.model-type-label, .language-label {
    margin: 0;
}
.model-type-select, .language-select {
    border: 2px solid var(--primary-slate-gray-light);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 16px;
    background-color: var(--primary-white);
    min-width: 120px;
    font-family: var(--font-secondary);
    color: var(--primary-slate-gray);
    transition: all 0.3s ease;
}

.model-type-select:focus, .language-select:focus {
    outline: none;
    border-color: var(--primary-cobalt-blue);
    box-shadow: var(--focus-ring);
}

/* Align dropdown edges based on text direction */
/* Menu items containing dropdowns should use space-between to align edges */
.side-menu-item label + select {
    margin-left: auto;
}

body.ltr-mode .side-menu-item label + select {
    margin-left: auto;
    margin-right: 0;
}

body.rtl-mode .side-menu-item label + select {
    margin-left: 0;
    margin-right: auto;
}

body.ltr-mode .model-type-select, 
body.ltr-mode .language-select {
    text-align: right;
    direction: ltr;
}

body.rtl-mode .model-type-select, 
body.rtl-mode .language-select {
    text-align: left;
    direction: rtl;
}
.side-menu-separator {
    height: 1px;
    background-color: rgba(112, 128, 144, 0.3);
    margin: 8px 0;
}
.side-menu-footer {
    padding: 20px 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    font-size: 1em;
    color: var(--primary-slate-gray-light);
    margin-top: auto;
    width: 100%;
    border-top: 1px solid rgba(112, 128, 144, 0.2);
    gap: 8px;
    font-family: var(--font-secondary);
    position: sticky;
    bottom: 0;
    background: var(--primary-white);
}
body.ltr-mode .side-menu-footer {
    flex-direction: row;
    text-align: left;
}
body.rtl-mode .side-menu-footer {
    flex-direction: row-reverse;
    text-align: left;
}
body.rtl-mode .side-menu-footer .user-display-name {
    order: 2;
    text-align: left;
}
body.rtl-mode .side-menu-footer .version-number {
    order: 1;
    text-align: right;
}

.assistant-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    background: var(--primary-white);
    box-shadow: var(--shadow-menu);
    border-radius: 8px;
    padding: 4px 8px;
    z-index: 10;
    min-width: 90px;
    max-width: 120px;
    margin-top: -12px;
    transition: box-shadow 0.2s;
}
body.rtl-mode .assistant-menu {
    right: auto;
    left: 0;
}
.assistant-menu-icon {
    background: none;
    border: none;
    padding: 2px 4px;
    margin: 0;
    cursor: pointer;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neutral-gray-500);
    transition: color 0.15s, background 0.15s;
    border-radius: 4px;
}
.assistant-menu-icon:hover {
    background: none;
    color: var(--functional-action-blue);
    box-shadow: var(--shadow-menu-focus), 0 0 0 2px var(--neutral-gray-400);
}
.assistant-message {
    position: relative;
}

.message.assistant-message {
    position: relative;
}

.assistant-menu-hover {
    top: 100% !important;
    left: 0 !important;
    right: auto !important;
    margin-top: 8px;
}

body.rtl-mode .assistant-menu-hover {
    left: auto !important;
    right: 0 !important;
}

.side-menu-separator {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 12px 0 8px 0;
    width: 100%;
}
.side-menu-item#help-menu-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    cursor: pointer;
    color: #000;
    transition: background 0.2s, color 0.2s;
    user-select: none;
    gap: 8px;
}
.side-menu-item#help-menu-item .help-icon {
    margin: 0;
    display: flex;
    align-items: center;
}
.side-menu-item#help-menu-item .help-text {
    display: flex;
    align-items: center;
}

.side-menu-item#signout-menu-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    cursor: pointer;
    color: #000;
    transition: background 0.2s, color 0.2s;
    user-select: none;
    gap: 8px;
}
.side-menu-item#signout-menu-item .signout-icon {
    margin: 0;
    display: flex;
    align-items: center;
}
.side-menu-item#signout-menu-item .signout-text {
    display: flex;
    align-items: center;
}

.assistant-message .message-content {
    background-color: #fff !important;
    color: #000 !important;
    padding-top: 10px;
    padding-bottom: 10px;
}

.side-menu-item.disabled,
.chats-menu-item.disabled {
    color: #bbb !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background: none !important;
}

.signout-icon {
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}
body.rtl-mode .signout-icon {
    margin-right: 0;
    margin-left: 8px;
}

/* Remove loader styles */
/* Add animated loader effect to textarea */
#message-input.loading {
    animation: inputLoaderAnim 3s linear infinite;
    border-color: #000;
    color: #000;
}

@keyframes inputLoaderAnim {
    0%, 100% {
        border-color: #000;
        color: #000;
    }
    50% {
        border-color: #aaa;
        color: #aaa;
    }
}

#message-input {
    width: 100%;
    box-sizing: border-box;
}

.admin-item {
    display: none;
}
.admin-item.admin-visible {
    display: block;
}

header.impersonation-mode {
    background: var(--impersonation-accent) !important;
    color: var(--impersonation-text) !important;
}
header.impersonation-mode h1 {
    color: var(--impersonation-text) !important;
    font-weight: bold;
}
#stop-impersonation-btn {
    display: inline-block;
    color: var(--impersonation-accent);
    background: var(--impersonation-text);
    border: none;
    border-radius: 4px;
    padding: 4px 12px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.5;
    margin-left: 1em;
    white-space: nowrap;
}
header.impersonation-mode #stop-impersonation-btn {
    display: inline-block;
}
#impersonated-user-email {
    display: none;
    margin-left: 1em;
    font-weight: bold;
    color: var(--impersonation-text);
}

header.impersonation-mode #impersonated-user-email {
    display: inline-block;
}

/* Tab Coordination Styles */
.tab-coordination-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 8px 0;
    background: linear-gradient(90deg, #f0f8ff, #e6f3ff);
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    font-size: 0.9em;
    color: #2B2E83;
    opacity: 0.9;
    animation: slideInFromTop 0.3s ease-out;
}

.tab-coordination-indicator .indicator-text {
    font-weight: 500;
}

.tab-coordination-indicator .indicator-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e0e8ff;
    border-top: 2px solid #4B47E6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes slideInFromTop {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 0.9;
    }
}

.header-content {
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0;
    position: relative;
}

/* Force menu button to left side by default */
.user-controls {
    order: 0;
}

/* Only change order for RTL mode */
body.rtl-mode .user-controls {
    order: 2;
}

/* RTL support for header layout */
body.rtl-mode .header-content {
    flex-direction: row-reverse;
}

/* Title is centered in both LTR and RTL modes */

.header-title-container {
    text-align: center;
    flex: 1;
    display: flex;
    justify-content: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
}

.hashtag {
    font-style: italic;
}

/* Day divider between messages */
.day-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0;
    color: rgba(0, 0, 0, 0.45);
    font-size: 12px;
    line-height: 1.2;
}
.day-divider::before,
.day-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    margin: 0 8px;
}

/* Loading Message Bubbles */
.loading-message-bubble {
    display: flex;
    flex-direction: row;
    margin-bottom: 20px;
    max-width: 80%;
    order: 1;
}

.loading-message-bubble.user {
    margin-left: auto;
    justify-content: flex-end;
}

.loading-message-bubble.model {
    margin-right: auto;
    justify-content: flex-start;
}

.loading-message-content {
    padding: 12px 16px;
    border-radius: 8px;
    background-color: var(--info-bubble-bg);
    color: var(--info-ink);
    min-width: 120px;
    max-width: 320px;
    width: fit-content;
    word-break: break-word;
    box-sizing: border-box;
    font-size: 1em;
    white-space: nowrap;
}

.loading-message-bubble.model .loading-message-content {
    background-color: var(--primary-white);
    color: var(--neutral-black);
}

.loading-message-content .thinking-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    line-height: 1.2;
}

/* Animated dots */
.thinking-dots {
    line-height: 1;
}

.thinking-dots::after {
    content: '';
    animation: thinkingDots 2s infinite;
    line-height: 1;
}

@keyframes thinkingDots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '. .'; }
    75% { content: '. . .'; }
    100% { content: ''; }
}

/* RTL Support for Loading Messages */
body.rtl-mode .loading-message-bubble {
    flex-direction: row-reverse;
}

body.rtl-mode .loading-message-bubble.user {
    margin-right: auto;
    margin-left: 0;
    justify-content: flex-start;
}

body.rtl-mode .loading-message-bubble.model {
    margin-left: auto;
    margin-right: 0;
    justify-content: flex-end;
}



.hidden {
    display: none !important;
}

/* Add specific styles for click menu */
#assistant-menu-click {
    position: fixed !important;
    display: flex !important;
    background: #fff !important;
    box-shadow: 0 2px 8px rgba(44, 44, 44, 0.13), 0 1.5px 4px rgba(44, 44, 44, 0.09) !important;
    border-radius: 8px !important;
    padding: 4px 8px !important;
    z-index: 9999 !important;
    min-width: 90px !important;
    max-width: 120px !important;
    margin-top: 0 !important;
    pointer-events: auto !important;
}

.header-title-container {
    display: flex;
    align-items: center;
}

.normal-title {
    display: block;
    margin: 0;
    font-weight: 400;
    font-size: 1.4rem;
}

.impersonation-content {
    display: none;
    align-items: center;
    gap: 1em;
}

.impersonated-email {
    font-weight: bold;
    font-size: 1rem;
}

/* When in impersonation mode */
.impersonation-mode .normal-title {
    display: none;
}

.impersonation-mode .impersonation-content {
    display: flex;
}

/* ========================================
   RESPONSIVE DESIGN - ALL MEDIA QUERIES
   ======================================== */

/* Desktop (769px and above) - Explicit resets to prevent mobile styles from persisting */
@media (min-width: 769px) {
    .container {
        padding-top: 0 !important; /* Ensure no top padding on desktop */
        height: calc(100vh - 70px) !important; /* Account for header height */
    }
    

    .input-container {
        position: static !important; /* Reset to static positioning */
        width: calc(100% - 20px) !important;
        margin: 0 10px !important;
    }
}

/* Mobile and Tablet (768px and below) */
@media (max-width: 768px) {
    /* Main layout adjustments */
    .container {
        height: 100vh !important; /* Full viewport height on mobile */
        padding-top: 70px !important; /* Exact height of fixed header */
    }
    
    /* Header adjustments */
    header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100vw;
        border-radius: 0;
        z-index: 1005;
        display: flex;
        justify-content: space-between;
        align-items: center;
        min-width: 0;
        overflow-x: visible;
    }
    
    /* Smaller title on small screens instead of hiding */
    .normal-title {
        display: block !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 50vw;
    }
    
    /* Show impersonation content on mobile even when title is hidden */
    .header-title-container {
        display: flex !important;
        justify-content: center;
        align-items: center;
    }
    
    .header-logo {
        flex-shrink: 0;
    }
    
    #menu-button.menu-button {
        flex-shrink: 0;
    }
    
    header > * {
        min-width: 0;
    }
    
    /* Chat container adjustments */
    .chat-container {
        flex: 1 1 auto;
        min-height: 0;
        /* padding-bottom: calc(var(--mobile-input-bar-height) + var(--safe-area-bottom)); */
    }
    
    /* Input container adjustments */
    .input-container {
        /* Default: fixed (broadest support) */
        position: fixed;
        left: 0;
        right: 0;
        bottom: env(safe-area-inset-bottom);
        width: 100vw;
        max-width: 100vw;
        margin: 0;
        border-radius: 0;
        z-index: 100; /* Above content */
        min-height: var(--mobile-input-bar-height);
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }

    /* Prefer sticky when supported to let browser UI adjust layout more naturally */
    @supports (position: sticky) or (position: -webkit-sticky) {
        .input-container {
            position: sticky;
            left: auto;
            right: auto;
            width: calc(100% - 20px);
            max-width: none;
            margin: 0 10px;
            bottom: max(0px, env(safe-area-inset-bottom));
        }
    }

    /* Ensure message area has space for the fixed input */
    #chat-messages-area {
        /* No extra padding needed when input is in flow */
        padding: 0px 10px 10px 10px;
    }
    
    /* Message adjustments */
    .message {
        margin-bottom: 8px !important;
    }
    
    .user-message .message-content,
    .assistant-message .message-content {
        max-width: 90%;
    }
    
    /* Tab coordination indicator adjustments */
    .tab-coordination-indicator {
        font-size: 0.85em;
        padding: 10px 12px;
        gap: 8px;
    }
    
    .tab-coordination-indicator .indicator-spinner {
        width: 14px;
        height: 14px;
        border-width: 1.5px;
    }
        
    #impersonated-user-email {
        font-size: small;
    }

    .impersonation-content {
        gap: 0.5em;
    }
    
    #stop-impersonation-btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Small mobile devices (600px and below) */
@media (max-width: 600px) {
    /* Notification adjustments for very small screens */
    .notification-container {
        top: 8px;
        right: 0;
        left: 0;
        width: 100vw;
        padding: 0 2vw;
    }
    
    body.rtl-mode .notification-container {
        left: 0;
        right: 0;
    }
    
    .notification-card {
        min-width: 0;
        max-width: 98vw;
        width: 100%;
        box-sizing: border-box;
    }
}

/* Hide reCAPTCHA badge */
.grecaptcha-badge {
    visibility: hidden !important;
    opacity: 0 !important;
    display: none !important;
}

/* Alternative: Move badge to bottom-right corner and make it very small */
.grecaptcha-badge {
    position: fixed !important;
    bottom: 10px !important;
    right: 10px !important;
    width: 40px !important;
    height: 40px !important;
    opacity: 0.1 !important;
    z-index: 9999 !important;
}

/* Native details/summary styling */
details {
    border: none;
    border-radius: 8px;
    padding: 8px 10px;
    margin: 8px 0;
    background: #fff;
}
details + details {
    margin-top: 10px;
}
summary {
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    outline: none;
}
summary::-webkit-details-marker { display: none; }
summary::before {
    content: '▸';
    display: inline-block;
    margin-inline-end: 8px;
    transition: transform 0.15s ease;
}
details[open] summary::before {
    transform: rotate(90deg);
}

/* RTL */
body.rtl-mode summary::before {
    margin-inline-end: 0;
    margin-inline-start: 8px;
    transform: scaleX(-1);
}
body.rtl-mode details[open] summary::before {
    transform: scaleX(-1) rotate(90deg);
}

/* Preview Button Styles */
.assistant-message .message-content {
    position: relative;
}

.preview-button {
    position: absolute;
    bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 20px;
    background-color: var(--primary-cobalt-blue);
    border: none;
    box-shadow: var(--shadow-neutral-md);
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    color: var(--primary-white);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-primary);
}

.preview-button-ltr {
    right: 12px;
    left: auto;
}

.preview-button-rtl {
    left: 12px;
    right: auto;
}

.preview-button:hover {
    background-color: #16a085;
    box-shadow: var(--shadow-neutral-lg);
    transform: translateY(-1px);
}

.preview-button:active {
    transform: translateY(0);
}

.preview-button-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.preview-button-icon svg {
    width: 18px;
    height: 18px;
    stroke: var(--primary-white);
}

.preview-button-text {
    white-space: nowrap;
}

/* Hide text on mobile, show icon only */
@media (max-width: 768px) {
    .preview-button {
        width: 40px;
        height: 40px;
        padding: 0;
        border-radius: 50%;
    }
    
    .preview-button-text {
        display: none;
    }
    
    .preview-button-icon svg {
        width: 20px;
        height: 20px;
    }
}

/* Preview Modal Styles */
.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--overlay-scrim);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.preview-modal-content {
    background-color: var(--primary-white);
    border-radius: 12px;
    max-width: 600px;
    max-height: 90vh;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-neutral-lg);
    overflow: hidden;
}

/* Mobile: Full screen */
@media (max-width: 768px) {
    .preview-modal {
        padding: 0;
    }
    
    .preview-modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        height: 100vh;
    }
}

.preview-modal-close {
    position: absolute;
    top: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background-color: rgba(0, 0, 0, 0.5);
    color: var(--primary-white);
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.preview-modal-close-ltr {
    right: 16px;
    left: auto;
}

.preview-modal-close-rtl {
    left: 16px;
    right: auto;
}

.preview-modal-close:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

@media (max-width: 768px) {
    .preview-modal-close {
        top: 16px;
        width: 40px;
        height: 40px;
        font-size: 28px;
        background-color: rgba(0, 0, 0, 0.6);
    }
    
    .preview-modal-close-ltr {
        right: 16px;
        left: auto;
    }
    
    .preview-modal-close-rtl {
        left: 16px;
        right: auto;
    }
}

.preview-modal-header {
    padding: 20px 24px 16px;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-slate-gray);
    border-bottom: 1px solid var(--border-subtle);
    text-align: center;
}

.preview-area {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

@media (max-width: 768px) {
    .preview-area {
        padding: 10px;
    }
}

/* Platform-specific preview containers */
.preview-post-container,
.preview-story-container,
.preview-reel-container,
.preview-carousel-container {
    background-color: var(--primary-white);
    border-radius: 8px;
    overflow: hidden;
}

/* Post Preview */
.preview-post-container {
    max-width: 500px;
    margin: 0 auto;
    border: 1px solid var(--border-subtle);
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.preview-post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 16px 8px;
}

.preview-post-author {
    display: flex;
    gap: 10px;
}

.preview-post-profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #ddd;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preview-post-profile-pic svg {
    width: 24px;
    height: 24px;
    color: #666;
}

.preview-post-info {
    display: flex;
    flex-direction: column;
}

.preview-post-username {
    font-weight: 600;
    font-size: 15px;
    color: #050505;
    line-height: 1.2;
}

.preview-post-meta {
    font-size: 13px;
    color: #65676b;
    display: flex;
    align-items: center;
    gap: 4px;
}

.preview-post-menu svg {
    color: #65676b;
    width: 20px;
    height: 20px;
}

.preview-post-caption {
    padding: 4px 16px 16px;
    font-size: 15px;
    color: #050505;
    line-height: 1.4;
}

.preview-post-caption-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.preview-post-caption.expanded .preview-post-caption-text {
    -webkit-line-clamp: unset;
    display: block;
}

[dir="rtl"] .preview-post-caption {
    text-align: right;
}

.preview-post-image {
    width: 100%;
    /* background-color: #f0f2f5; moved to inline mock */
}

.preview-post-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #ced0d4;
    color: #65676b;
    font-size: 15px;
}

.preview-post-reactions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.preview-post-reaction-icons {
    display: flex;
    align-items: center;
    margin-right: 4px;
}

.preview-reaction-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-right: -4px;
}

.preview-reaction-icon:last-child {
    margin-right: 0;
}

.preview-reaction-like {
    background: linear-gradient(to bottom, #1877F2, #1877F2);
    z-index: 2;
}

.preview-reaction-heart {
    background: linear-gradient(to bottom, #FB5D65, #FA3E4C);
    z-index: 1;
}

.preview-reaction-laugh {
    background: linear-gradient(to bottom, #F7B928, #F7B928);
    z-index: 0;
}

.preview-reaction-count {
    color: #65676b;
    font-size: 15px;
}

.preview-post-actions {
    display: flex;
    padding: 4px 16px;
}

.preview-post-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: left;
    gap: 8px;
    height: 32px;
    border-radius: 4px;
    color: #65676b;
    font-size: 15px;
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
}

.preview-post-action-btn:hover {
    background-color: #f0f2f5;
}

.preview-post-action-btn svg {
    width: 20px;
    height: 20px;
    color: #65676b;
}

.preview-profile {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
}

.preview-profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preview-profile-pic svg {
    width: 24px;
    height: 24px;
    color: white;
}

.preview-username {
    font-weight: 600;
    font-size: 14px;
    color: var(--primary-slate-gray);
}

.preview-platform-facebook .preview-username {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

.preview-platform-instagram .preview-username {
    font-weight: 600;
}

.preview-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background-color: var(--neutral-gray-240);
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-overlay-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--primary-white);
    font-size: 36px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 2;
    text-align: center;
    padding: 0 20px;
    width: 90%;
    word-wrap: break-word;
}

.preview-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.preview-action-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.preview-action-button:hover {
    transform: scale(1.1);
}

.preview-action-button:active {
    transform: scale(0.95);
}

.preview-action-button svg {
    width: 24px;
    height: 24px;
}

.preview-platform-facebook .preview-action-like svg {
    color: #1877F2;
}

.preview-platform-facebook .preview-action-share svg {
    color: #42B72A;
}

.preview-caption {
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--primary-slate-gray);
}

.preview-platform-facebook .preview-caption {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

.preview-timestamp {
    padding: 8px 16px 16px;
    font-size: 12px;
    color: var(--neutral-gray-500);
}

/* Story Preview */
.preview-story-container {
    margin: 0 auto;
    aspect-ratio: 9 / 16;
    position: relative;
    background-color: #262626;
    border-radius: 16px;
    overflow: hidden;
    /* Instagram Story specific */
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.preview-story-progress-bars {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    z-index: 20;
}

.preview-story-progress-bar {
    height: 2px;
    background: rgba(255,255,255,0.3);
    flex: 1;
    border-radius: 2px;
}

.preview-story-progress-bar.active {
    background: white;
}

.preview-story-header-overlay {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    padding: 0 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20;
}

.preview-story-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-story-profile-pic {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-story-profile-pic svg {
    width: 20px;
    height: 20px;
    color: #666;
}

.preview-story-username-line {
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-story-username {
    font-weight: 600;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.preview-story-time {
    font-size: 14px;
    opacity: 0.8;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.preview-story-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.preview-story-control {
    cursor: pointer;
    display: flex;
    align-items: center;
}

.preview-story-close {
    font-size: 24px;
    line-height: 1;
    font-weight: 300;
}

.preview-story-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 20;
    background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 100%);
}

.preview-story-reply {
    flex: 1;
    height: 44px;
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: 22px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-size: 14px;
    color: white;
    background: transparent;
    cursor: text;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.preview-story-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.preview-story-action-btn svg {
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}

.preview-story-tap-zone {
    position: absolute;
    top: 60px;
    bottom: 80px;
    width: 35%;
    z-index: 15;
    cursor: pointer;
}

.preview-story-tap-zone.left {
    left: 0;
}

.preview-story-tap-zone.right {
    right: 0;
}

.preview-story-content {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Story slides container */
.story-slides-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 16px;
}

.story-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
}

.story-slide.active {
    opacity: 1;
    z-index: 1;
}

/* RTL Support for Story */
[dir="rtl"] .preview-story-actions {
    /* No specific change needed if flex direction handled by container dir, 
       but usually order is preserved visually. 
       Reply input left (or right in RTL), Icons right (or left in RTL).
       Flex layout handles this automatically. */
}

/* Reel Preview */
/* Reel Preview Styles (Feed Style) */
.preview-reel-header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 100%);
    color: white;
}

.preview-reel-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-reel-profile-pic {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ddd;
    color: #666;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-reel-profile-pic svg {
    width: 24px;
    height: 24px;
}

.preview-reel-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.preview-reel-header-top {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.preview-reel-username {
    font-weight: 600;
    color: white;
}

.preview-reel-dot {
    font-size: 8px;
    opacity: 0.8;
}

.preview-reel-following {
    font-weight: 600;
    cursor: pointer;
}

.preview-reel-audio {
    font-size: 12px;
    opacity: 0.9;
}

.preview-reel-menu {
    cursor: pointer;
    padding: 4px;
}

.preview-reel-mute-wrapper {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 24px;
    height: 24px;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* RTL Support for Reel Header */
[dir="rtl"] .preview-reel-mute-wrapper {
    right: auto;
    left: 16px;
}

.preview-video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5; /* Portrait aspect ratio */
    background-color: #efefef;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-video-container .preview-mock-image {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.preview-video-container .mock-reel-content {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #555 0%, #333 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Carousel Preview */
.preview-carousel-container {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

/* Instagram Story Preview */
.preview-instagram-story {
    width: 100%;
    height: 100%;
    position: relative;
    background-color: #262626;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 9 / 16;
}

.story-progress-bars {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    z-index: 20;
}

.story-progress-bar {
    flex: 1;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.story-progress-bar.active .story-progress-fill {
    width: 100%;
    height: 100%;
    background-color: white;
}

.story-header {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.story-profile-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.story-profile-pic {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.2);
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-profile-pic svg {
    width: 24px;
    height: 24px;
    color: #666;
}

.story-username-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    line-height: 1.2;
}

.story-username {
    font-weight: 600;
    font-size: 14px;
}

.story-time {
    font-size: 14px;
    opacity: 0.7;
}

.story-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.story-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 20;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 100%);
}

.story-reply-pill {
    flex: 1;
    height: 44px;
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: 22px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    font-size: 14px;
    color: white;
    background-color: transparent;
    cursor: text;
}

.story-action-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-action-btn svg {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
    stroke-width: 2px;
}

.story-content-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.story-content-wrapper .preview-mock-image {
    width: 100%;
    height: 100%;
}

/* RTL Support for Story */
[dir="rtl"] .story-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .story-footer {
    flex-direction: row-reverse;
}

.carousel-slides-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 1;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-subtle);
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-slate-gray);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-neutral-md);
    transition: all 0.2s ease;
}

.carousel-arrow:hover {
    background-color: var(--primary-white);
    box-shadow: var(--shadow-neutral-lg);
    transform: translateY(-50%) scale(1.1);
}

.carousel-arrow-prev {
    left: 12px;
}

.carousel-arrow-next {
    right: 12px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 16px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background-color: var(--neutral-gray-400);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.carousel-dot.active {
    background-color: var(--primary-slate-gray);
    width: 24px;
    border-radius: 4px;
}

.carousel-dot:hover {
    background-color: var(--primary-slate-gray-light);
}

/* Instagram Carousel Specifics */
.preview-instagram-carousel .carousel-arrow {
    width: 24px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    color: black;
    padding: 0;
}

.preview-instagram-carousel .carousel-arrow svg {
    width: 14px;
    height: 14px;
    display: block;
}

.preview-instagram-carousel .carousel-arrow-prev {
    left: 10px;
}

.preview-instagram-carousel .carousel-arrow-next {
    right: 10px;
}

/* Swap arrow positions in RTL so visual direction matches side */
[dir="rtl"] .preview-instagram-carousel .carousel-arrow-prev,
.rtl-mode .preview-instagram-carousel .carousel-arrow-prev {
    left: auto;
    right: 10px;
}

[dir="rtl"] .preview-instagram-carousel .carousel-arrow-next,
.rtl-mode .preview-instagram-carousel .carousel-arrow-next {
    right: auto;
    left: 10px;
}

.preview-instagram-carousel .preview-carousel-wrapper {
    position: relative;
}

.preview-instagram-carousel .carousel-dots {
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    padding: 0;
    gap: 4px;
    z-index: 10;
}

.preview-instagram-carousel .carousel-dot {
    width: 6px;
    height: 6px;
    background-color: rgba(255,255,255,0.4);
    margin: 0;
}

.preview-instagram-carousel .carousel-dot.active {
    background-color: white;
    width: 6px; /* Keep it dot, standard instagram carousel dots are uniform size usually, or active is brighter */
}

.preview-carousel-tap-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30%;
    z-index: 5;
    cursor: pointer;
}

.preview-carousel-tap-zone.left {
    left: 0;
}

.preview-carousel-tap-zone.right {
    right: 0;
}

/* Mobile vertical carousel layout */
@media (max-width: 768px) {
    .carousel-mobile-vertical .carousel-slides-container {
        position: relative;
        aspect-ratio: unset;
        overflow: visible;
        display: flex;
        flex-direction: column;
        gap: 0;
        width: 100%;
    }
    
    .carousel-mobile-vertical .carousel-slide {
        position: relative;
        opacity: 1;
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        margin-bottom: 0;
        border-radius: 8px;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    
    .carousel-mobile-vertical .carousel-slide:not(:last-child) {
        margin-bottom: 0;
    }
    
    .carousel-mobile-vertical .carousel-arrow {
        display: none;
    }
    
    .carousel-mobile-vertical .carousel-dots {
        display: none;
    }
    
    /* Ensure stats appear below each image on mobile */
    .carousel-mobile-vertical .carousel-slide .preview-post-stats {
        order: 2;
        margin-top: 0;
    }
    
    .carousel-mobile-vertical .carousel-slide .preview-post-actions {
        order: 3;
    }
}

/* Mock Image Styles - CSS-based mockups matching reference designs */
.preview-mock-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Facebook Post Mock */
.mock-facebook.mock-post {
    background: linear-gradient(135deg, #e5e5e5 0%, #d0d0d0 50%, #b8b8b8 100%);
}

.mock-post-content {
    width: 100%;
    height: 100%;
    position: relative;
}

.mock-image-pattern {
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.1) 10px, rgba(255,255,255,0.1) 20px),
        linear-gradient(135deg, #9e9e9e 0%, #757575 100%);
    position: relative;
}

.mock-image-pattern::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
}

.mock-image-pattern::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

/* Facebook Carousel Mock */
.mock-facebook.mock-carousel {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 50%, #ce93d8 100%);
}

.mock-carousel-content {
    width: 100%;
    height: 100%;
    position: relative;
}

.mock-carousel-grid {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px;
}

.mock-carousel-grid::before,
.mock-carousel-grid::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(90deg, transparent, transparent 20px, rgba(255,255,255,0.1) 20px, rgba(255,255,255,0.1) 40px),
        repeating-linear-gradient(0deg, transparent, transparent 20px, rgba(255,255,255,0.1) 20px, rgba(255,255,255,0.1) 40px);
}

/* Story Mock */
.mock-story {
    background: linear-gradient(180deg, #ff6b6b 0%, #ee5a6f 25%, #c44569 50%, #a55eea 75%, #8854d0 100%);
    filter: grayscale(100%);
}

.mock-story-content {
    width: 100%;
    height: 100%;
    position: relative;
}

.mock-story-gradient {
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        linear-gradient(180deg, #ff6b6b 0%, #ee5a6f 25%, #c44569 50%, #a55eea 75%, #8854d0 100%);
    filter: grayscale(100%);
}

/* Reel Mock */
.mock-reel {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    filter: grayscale(100%) brightness(1.5);
}

.mock-reel-content {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: 
        radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 0%, transparent 70%),
        linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    filter: grayscale(100%) brightness(1.5);
}

.mock-play-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    backdrop-filter: blur(10px);
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mock-play-button svg {
    margin-left: 4px; /* Offset play icon slightly right */
}

/* Mobile Reel - different style */
.mock-mobile.mock-reel {
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    filter: grayscale(100%) brightness(1.5);
}

.mock-mobile.mock-reel .mock-reel-content {
    background: 
        radial-gradient(ellipse at top, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
        linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    filter: grayscale(100%) brightness(1.5);
}

/* Instagram styles */
.mock-instagram.mock-post {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 50%, #4facfe 100%);
}

.mock-instagram.mock-carousel {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.mock-instagram.mock-story {
    background: linear-gradient(180deg, #a8edea 0%, #fed6e3 100%);
    filter: grayscale(100%);
}

.mock-instagram.mock-reel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    filter: grayscale(100%) brightness(1.5);
}

/* Instagram Post Preview Styles */
.preview-instagram-post {
    border: 1px solid #dbdbdb;
    background: #ffffff;
}

.preview-instagram-actions {
    padding: 8px 12px 4px;
    display: flex;
    align-items: center;
    gap: 0;
}

/* LTR Layout: left group on left, bookmark on right */
[dir="ltr"] .preview-instagram-actions,
.preview-instagram-actions:not([dir]) {
    flex-direction: row;
}

/* RTL Layout: left group on right, bookmark on left */
[dir="rtl"] .preview-instagram-actions {
    flex-direction: row-reverse;
}

.preview-instagram-actions-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.preview-instagram-action-btn {
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

.preview-instagram-action-btn svg {
    width: 24px;
    height: 24px;
    color: #262626;
}

.preview-instagram-action-bookmark {
    flex-shrink: 0;
}

/* LTR: Push bookmark to far right with flex-grow and margin */
[dir="ltr"] .preview-instagram-action-bookmark,
.preview-instagram-action-bookmark:not([dir]) {
    margin-left: auto;
    flex-grow: 0;
}

/* RTL: Push bookmark to far left with flex-grow and margin */
[dir="rtl"] .preview-instagram-action-bookmark {
    flex-grow: 0;
}

.preview-instagram-like-count {
    padding: 0 12px 8px;
    font-size: 14px;
    font-weight: 600;
    color: #262626;
    display: flex;
    align-items: center;
    gap: 6px;
}

.preview-instagram-like-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fafafa;
    border: 1px solid #dbdbdb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preview-instagram-like-icon svg {
    width: 20px;
    height: 20px;
    color: #8e8e8e;
}

.preview-instagram-comments {
    padding: 0 12px 4px;
    font-size: 14px;
    color: #8e8e8e;
    cursor: pointer;
}

.preview-instagram-date {
    padding: 0 12px 12px;
    font-size: 10px;
    color: #8e8e8e;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.preview-carousel-wrapper {
    position: relative;
    width: 100%;
}

.preview-instagram-caption {
    padding: 0 12px 8px;
    font-size: 14px;
    line-height: 1.4;
    color: #262626;
}

.preview-instagram-caption-content {
    display: block;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.preview-instagram-caption:not(.expanded) .preview-instagram-caption-content {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.preview-instagram-caption.expanded .preview-instagram-caption-content {
    display: block;
    overflow: visible;
}

.preview-instagram-caption-username {
    font-weight: 600;
    color: #262626;
    display: inline;
}

.preview-instagram-caption-text {
    display: inline;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.preview-instagram-see-more {
    color: #8e8e8e;
    cursor: pointer;
    font-size: 14px;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    display: inline;
    text-align: start;
}

.preview-instagram-info {
    flex-direction: row;
    align-items: center;
}

.preview-instagram-username-line {
    display: flex;
    align-items: center;
    gap: 4px;
}

.preview-instagram-username {
    font-weight: 600;
    font-size: 14px;
    color: #262626;
}

.preview-instagram-meta {
    font-size: 14px;
    color: #8e8e8e;
    font-weight: 400;
}

/* Updated Post Preview Styles */
.preview-post-caption-content {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.preview-post-see-more {
    color: #65676b;
    cursor: pointer;
    font-size: 15px;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    display: inline;
    text-align: start;
}

[dir="rtl"] .preview-post-see-more {
    text-align: right;
}

.preview-reaction-laugh {
    background: linear-gradient(to bottom, #F7B928, #F7B928);
    z-index: 1;
}


.preview-post-reaction-icons {
    margin-right: 4px;
}