/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Toast Variables */
    --toast-icon-margin-start: -3px;
    --toast-icon-margin-end: 4px;
    --toast-svg-margin-start: -1px;
    --toast-svg-margin-end: 0px;
    --toast-button-margin-start: auto;
    --toast-button-margin-end: 0;
    --toast-close-button-start: 0;
    --toast-close-button-end: unset;
    --toast-close-button-transform: translate(-35%, -35%);
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    -webkit-text-size-adjust: 100%;

    /* Navigation */
    --side-nav-width: 15rem;

    /* Assist Colors */
    --AssistColorAzure: #2b5db9;
    --AssistColorBlue: #4b5dc2;
    --AssistColorCelulean: #408d9f;
    --AssistColorGreen: #3b824a;
    --AssistColorOrange: #fc9c0c;
    --AssistColorPurple: #5e39d0;
    --AssistColorRed: #e54a82;
    --AssistColorResso: #ff005c;
    --AssistColorYellow: #face15;

    /* Background Colors */
    --BGBase: #f5f5f5;
    --BGBrand: rgba(254, 44, 85, .06);
    --BGCreation: #121212;
    --BGCreation2: #1b1b1b;
    --BGCreation3: #f8f8f8;
    --BGInput: rgba(22, 24, 35, .06);
    --BGInput2: rgba(22, 24, 35, .06);
    --BGInverse3: rgba(37, 37, 37, .6);
    --BGLevitation: #fff;
    --BGPlaceholderDefault: rgba(22, 24, 35, .06);
    --BGPlaceholderOpaque: #f1f1f1;
    --BGPrimary: #fff;
    --BGPrimary2: #fff;
    --BGQuaternary: #fff;
    --BGQuinary: #fff;
    --BGReverse: #fff;
    --BGReverse2: hsla(0, 0%, 100%, .9);
    --BGSecondary: #fff;
    --BGSecondary2: #fff;
    --BGTertiary: #fff;
    --BGTertiary2: #fff;
    --BGView: rgba(22, 24, 35, .03);
    --BGView2: rgba(22, 24, 35, .03);

    /* Const Background */
    --ConstBGBrand: rgba(254, 44, 85, .5);
    --ConstBGContainer: hsla(0, 0%, 100%, .12);
    --ConstBGContainer2: hsla(0, 0%, 100%, .08);
    --ConstBGContainer3: hsla(0, 0%, 100%, .04);
    --ConstBGInverse: #000;
    --ConstBGInverse1: rgba(56, 56, 56, .95);
    --ConstBGInverse2: rgba(0, 0, 0, .6);
    --ConstBGInverse3: rgba(37, 37, 37, .6);
    --ConstBGInverse4: rgba(84, 84, 84, .5);
    --ConstBGInverse5: rgba(0, 0, 0, .2);
    --ConstBGInverseOpaque: #2e2e2e;
    --ConstBGMat: hsla(0, 0%, 100%, .34);
    --ConstBGMat2: hsla(0, 0%, 100%, .2);
    --ConstBGPlaceholderOpaque: #f1f1f1;
    --ConstBGSecondary: rgba(32, 213, 236, .05);

    /* Interaction States */
    --ConstInteractStatePressedMaskLightInverse: rgba(22, 24, 35, .1);
    --ConstInteractStatePressedMaskStrongInverse: rgba(22, 24, 35, .3);
    --InteractStatePressedMaskLight: rgba(22, 24, 35, .1);

    /* Lines */
    --ConstLineInverse: hsla(0, 0%, 100%, .2);
    --ConstLineInverse2: hsla(0, 0%, 100%, .12);
    --LineDarker: rgba(22, 24, 35, .03);
    --LineInput: rgba(22, 24, 35, .5);
    --LineInverse: rgba(22, 24, 35, .2);
    --LinePrimary: rgba(22, 24, 35, .2);
    --LinePrimary2: rgba(22, 24, 35, .2);
    --LineReverse2: rgba(22, 24, 35, .12);
    --LineReverse3: rgba(22, 24, 35, .12);
    --LineSecondary: rgba(22, 24, 35, .12);
    --LineSecondary2: rgba(22, 24, 35, .12);
    --LineSecondary3: rgba(22, 24, 35, .12);

    /* Text Colors - Const */
    --ConstTextInverse: #fff;
    --ConstTextInverse2: hsla(0, 0%, 100%, .9);
    --ConstTextInverse3: hsla(0, 0%, 100%, .75);
    --ConstTextInverse4: hsla(0, 0%, 100%, .5);
    --ConstTextInverse5: hsla(0, 0%, 100%, .34);
    --ConstTextPrimary: #161823;

    /* Text Colors */
    --TextPrimary: #161823;
    --TextQuaternary: rgba(22, 24, 35, .34);
    --TextReverse: #161823;
    --TextReverse2: rgba(22, 24, 35, .75);
    --TextReverse3: rgba(22, 24, 35, .5);
    --TextReverse4: rgba(22, 24, 35, .34);
    --TextSecondary: rgba(22, 24, 35, .75);
    --TextTertiary: rgba(22, 24, 35, .5);
    --TextTertiary2: rgba(22, 24, 35, .5);
    --TextTertiaryAlt: rgba(22, 24, 35, .6);

    /* Link Colors */
    --Link: #fe2c55;
    --Link2: #fe2c55;
    --Link3: #fe2c55;

    /* Brand Colors */
    --Primary: #fe2c55;
    --Primary2: #161823;
    --Secondary: #20d5ec;
    --Secondary2: #10a2c5;
    --Positive: #0be09b;
    --Positive2: #4fab7e;
    --Negative: #ff4c3a;

    /* Shadows */
    --SDPrimary: rgba(0, 0, 0, .8);
    --SDSecondary: rgba(0, 0, 0, .6);
    --SDTertiary: rgba(0, 0, 0, .2);
    --ShadowPrimary: rgba(0, 0, 0, .12);
    --ShadowSecondary: rgba(0, 0, 0, .06);

    /* Live Colors */
    --LiveColorEnd: #ed3495;
    --LiveColorStart: #ff1764;

    /* Story Colors */
    --StoryColorEnd: #1ae3c6;
    --StoryColorMiddle: #20d5ec;
    --StoryColorStart: #15c0f9;

    /* Toast */
    --ToastDefault: rgba(84, 84, 84, .92);
    --ToastNegative: rgba(255, 76, 58, .92);

    /* TUX v2 Color System */
    --tux-colorPositive: #0be09b;
    --tux-colorNegative: #ff4c3a;
    --tux-colorToastDefault: rgba(84, 84, 84, .92);
    --tux-colorToastNegative: rgba(255, 76, 58, .92);
    --tux-colorSecondary: #20d5ec;
    --tux-colorSecondary2: #10a2c5;
    --tux-colorPositive2: #4fab7e;
    --tux-colorPrimary: #fe2c55;
    --tux-colorLink: #fe2c55;
    --tux-colorPrimary2: #161823;
    --tux-colorTextPrimary: #161823;
    --tux-colorTextSecondary: rgba(22, 24, 35, .75);
    --tux-colorTextTertiary: rgba(22, 24, 35, .5);
    --tux-colorTextQuaternary: rgba(22, 24, 35, .34);
    --tux-colorBGPrimary: #fff;
    --tux-colorBGSecondary: #fff;
    --tux-colorBGTertiary: #fff;
    --tux-colorBGQuaternary: #fff;
    --tux-colorBGQuinary: #fff;
    --tux-colorBGSecondary2: #fff;
    --tux-colorBGTertiary2: #fff;
    --tux-colorBGPlaceholderDefault: rgba(22, 24, 35, .06);
    --tux-colorBGPlaceholderOpaque: #f1f1f1;
    --tux-colorBGInput: rgba(22, 24, 35, .06);
    --tux-colorBGInput2: rgba(22, 24, 35, .06);
    --tux-colorBGView: rgba(22, 24, 35, .03);
    --tux-colorBGCreation3: #f8f8f8;
    --tux-colorBGCreation4: #fff;
    --tux-colorBGHover: rgba(22, 24, 35, .06);
    --tux-colorBGBrand: rgba(254, 44, 85, .06);
    --tux-colorLinePrimary: rgba(22, 24, 35, .2);
    --tux-colorLineSecondary: rgba(22, 24, 35, .12);
    --tux-colorLineInput: rgba(22, 24, 35, .5);
    --tux-colorLinePrimary2: rgba(22, 24, 35, .2);
    --tux-colorLineSecondary2: rgba(22, 24, 35, .12);
    --tux-colorLineSecondary3: rgba(22, 24, 35, .12);
    --tux-colorLineDarker: rgba(22, 24, 35, .12);
    --tux-colorSDSecondary: rgba(0, 0, 0, .5);
    --tux-colorSDTertiary: rgba(0, 0, 0, .2);

    /* UI Colors */
    --ui-page-flat-1: #fff;
    --ui-page-flat-2: #f8f8f8;
    --ui-page-flat-3: #fff;
    --ui-page-grouped-1: #f5f5f5;
    --ui-page-grouped-2: #fff;
    --ui-page-grouped-3: #f8f8f8;
    --ui-shape-danger: #ff4c3a;
    --ui-shape-primary: #fe2c55;
    --ui-shape-neutral: #000;
    --ui-shape-neutral-2: rgba(0, 0, 0, .17);
    --ui-shape-neutral-3: rgba(0, 0, 0, .12);
    --ui-shape-neutral-4: rgba(0, 0, 0, .05);
    --ui-text-1: #000;
    --ui-text-2: rgba(0, 0, 0, .65);
    --ui-text-3: rgba(0, 0, 0, .48);
    --ui-text-placeholder: rgba(0, 0, 0, .34);

    /* Box Shadows */
    --tux-boxShadowIcon: 0 2px 12px 0 rgba(0, 0, 0, .12);
    --tux-boxShadowLayer: 0 2px 8px 0 rgba(0, 0, 0, .06);
    --tux-boxShadowNotice: 0 2px 12px 0 rgba(0, 0, 0, .12);

    /* Typography */
    --tux-fontFamilyHeading: "TikTokDisplayFont", Arial, Tahoma, PingFangSC, sans-serif;
    --tux-fontFamilyParagraph: "TikTokFont", Arial, Tahoma, PingFangSC, sans-serif;
    --tux-fontWeightRegular: 400;
    --tux-fontWeightSemibold: 500;
    --tux-fontWeightBold: 700;
    --tux-fontSizeH1: 96px;
    --tux-fontSizeH2: 72px;
    --tux-fontSizeH3: 56px;
    --tux-fontSizeH4: 48px;
    --tux-fontSizeH5: 32px;
    --tux-fontSizeH6: 24px;
    --tux-fontSizeH7: 18px;
    --tux-fontSizeP1: 24px;
    --tux-fontSizeP2: 18px;
    --tux-fontSizeP3: 16px;
    --tux-fontSizeP4: 14px;
    --tux-fontSizeP5: 12px;

    /* TUX v2 Font System */
    --tux-v2-font-display: TikTokDisplayFont, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
    --tux-v2-font-text: TikTokFont, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
    --tux-v2-typography-bold-weight: 700;
    --tux-v2-typography-semibold-weight: 500;
    --tux-v2-typography-regular-weight: 400;

    /* TUX v2 Typography Sizes */
    --tux-v2-typography-h1-size: 24px;
    --tux-v2-typography-h1-line-height: 1.25em;
    --tux-v2-typography-h2-size: 20px;
    --tux-v2-typography-h2-line-height: 1.25em;
    --tux-v2-typography-h3-size: 17px;
    --tux-v2-typography-h3-line-height: 1.3em;
    --tux-v2-typography-h4-size: 15px;
    --tux-v2-typography-h4-line-height: 1.3em;
    --tux-v2-typography-p1-size: 14px;
    --tux-v2-typography-p1-line-height: 1.3em;
    --tux-v2-typography-p2-size: 13px;
    --tux-v2-typography-p2-line-height: 1.3em;
    --tux-v2-typography-p3-size: 12px;
    --tux-v2-typography-p3-line-height: 1.3em;

    /* TUX v2 Shadow System */
    --tux-v2-shadow-blocking: 0 24px 120px rgba(0, 0, 0, .16);
    --tux-v2-shadow-global-notice: 0 12px 50px rgba(0, 0, 0, .1);
    --tux-v2-shadow-floating: 0 6px 24px rgba(0, 0, 0, .1);
    --tux-v2-shadow-attached: 0 2px 10px rgba(0, 0, 0, .14);
    --tux-v2-shadow-subtle: 0 2px 10px rgba(0, 0, 0, .07);
    --tux-v2-shadow-contrast: 0 1px 5px rgba(0, 0, 0, .3);

    /* TUX v2 Radius System */
    --tux-v2-radius-control-tiny: 4px;
    --tux-v2-radius-control-small: 5px;
    --tux-v2-radius-control-medium: 6px;
    --tux-v2-radius-control-large: 8px;
    --tux-v2-radius-control-capsule: 9999px;
    --tux-v2-radius-content-tiny: 4px;
    --tux-v2-radius-content-small: 5px;
    --tux-v2-radius-content-medium: 6px;
    --tux-v2-radius-content-large: 8px;
}

body {
    font-family: var(--tux-v2-font-text);
    background-color: var(--ui-page-flat-1);
    color: var(--TextPrimary);
    display: flex;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizespeed;
    line-height: 1.5;
}

/* Left Navigation Sidebar */
.side-nav-container {
    position: relative;
    width: 72px;
    height: 100vh;
    background-color: var(--ui-page-flat-1);
    border-right: 1px solid var(--LineSecondary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

.animation-cover {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.fixed-content-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0 0 0;
    width: 100%;
}

.scrolling-content-container {
    position: absolute;
    top: 98px;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.main-nav-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.sub-main-nav-content-container {
    flex: 1;
}

.sub-main-nav-footer-container {
    display: flex;
    flex-direction: column;
    margin-top: auto;
    padding: 14px 0;
}

/* Logo */
.logo-wrapper {
    padding: 8px 0 0 0;
    margin-bottom: 14px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--ui-text-1);
    width: 36px;
    height: 36px;
    transition: opacity 0.2s ease;
}

.logo-link:hover {
    opacity: 0.8;
}

.tiktok-logo {
    width: 25px;
    height: 42px;
    display: block;
}

/* Logo switching for themes */
.tiktok-logo-dark {
    display: none;
}

body.dark-theme .tiktok-logo-light {
    display: none;
}

body.dark-theme .tiktok-logo-dark {
    display: block;
}

/* Search Button */
.search-wrapper {
    padding: 0;
    margin-bottom: 0;
    width: 100%;
    display: flex;
    justify-content: center;
}

.search-button {
    width: 36px;
    height: 36px;
    background-color: rgba(22, 24, 35, 0.06);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    color: var(--TextSecondary);
    transition: background-color 0.2s ease;
}

.search-button:hover {
    background-color: var(--ui-shape-neutral-4);
}

.search-button:active {
    transform: scale(0.95);
}

.search-button svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.search-button span,
.TUXButton-label {
    display: none;
}

.TUXButton-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.TUXButton-iconContainer {
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button .css-a3bobw-7937d88b--DivIconWithRedDotContainer svg,
.search-button .exb7d122 svg {
    color: var(--TextPrimary);
    stroke-width: 0;
    width: 24px;
    height: 24px;
}

/* Main Navigation */
.main-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0;
    margin-top: 4px;
    width: 100%;
    align-items: center;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    border-radius: 4px;
    text-decoration: none;
    color: var(--TextPrimary);
    font-weight: 700;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    transition: background-color 0.2s;
    position: relative;
    font-size: 31px;
    /* Default icon size */
    box-sizing: border-box;
}

.nav-item:hover {
    background-color: var(--ui-shape-neutral-4);
}

.nav-item:active {
    transform: scale(0.95);
}

.nav-item.active {
    background-color: transparent;
    color: var(--ui-shape-primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid var(--ui-shape-primary);
}

.nav-item svg {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    stroke-width: 1.5;
}

/* Specific icon sizes to match TikTok */
.nav-item[data-icon-size="24"] {
    font-size: 24px;
}

.nav-item[data-icon-size="32"] {
    font-size: 32px;
}

.nav-item span {
    display: none;
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Notification dot for nav items */
.nav-item.has-notification {
    position: relative;
}

.nav-item.has-notification::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 14px;
    width: 8px;
    height: 8px;
    background-color: var(--ui-shape-primary);
    border-radius: 50%;
    border: 1.5px solid var(--ui-page-flat-1);
}

/* Hide triangle indicator for Messages (active) to match TikTok style */
.nav-item.active::before {
    display: none;
}

/* Footer */
.footer {
    display: none;
}

/* Messages Drawer */
.messages-drawer {
    width: 319.2px;
    height: 100vh;
    background-color: #fff;
    border-right: 1px solid rgba(22, 24, 35, 0.12);
    display: flex;
    flex-direction: column;
}

.messages-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.messages-header {
    height: 60px;
    width: 100%;
    display: flex;
    flex-shrink: 0;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    padding: 0 16px;
    border-bottom: none;
    background-color: #ffffff;
}

.messages-header h2 {
    font-size: 24px;
    line-height: 32px;
    font-weight: 700;
    font-family: var(--tux-v2-font-text);
    color: #161823;
    letter-spacing: 0.1px;
    margin-top: 12px;
    margin-bottom: 8px;
    padding-bottom: 0px;
    width: 94.75px;
    height: 32px;
}


/* Sidebar Empty State */
.css-1jjuxd1-7937d88b--DivFullSideNavEmptyMessageContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--ui-shape-neutral-3, rgba(22, 24, 35, 0.34));
    gap: 8px;
    padding-top: 50%;
}

.css-155trjh-7937d88b--DivFullSideNavEmptyMessageIconContainer {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hide header and bottom when no active chat */
.chat-view.no-active-chat .chat-header,
.chat-view.no-active-chat .chat-bottom {
    display: none !important;
}

/* List Content Wrapper */
.list-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.scroll-container {
    height: 100%;
    padding-left: unset;
    padding-right: 0;
    display: block;
}

.scroll-wrapper {
    height: 100%;
    overflow: auto;
}

/* Conversation List */
.conversation-list {
    display: flex;
    flex-direction: column;
}

.conversation-info-wrapper {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.conversation-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    background-color: #fff;
    border: none;
    width: 100%;
    min-height: 72px;
    transition: background-color 0.2s;
    position: relative;
}

.conversation-item:hover {
    background-color: rgba(22, 24, 35, 0.03);
}

.conversation-item.active {
    background-color: #F5F5F5;
}

.conversation-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    margin-right: 12px;
}

.conversation-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.conversation-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
    align-items: flex-start;
}

.conversation-name {
    font-size: 15px;
    font-weight: 600;
    color: #161823;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-preview {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(22, 24, 35, 0.75);
}

.preview-text {
    flex: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-time {
    color: rgba(22, 24, 35, 0.5);
    font-size: 13px;
    flex-shrink: 0;
}

.more-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: rgba(22, 24, 35, 0.5);
    opacity: 0;
    transition: all 0.2s;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 2;
    flex-shrink: 0;
}

.conversation-item:hover .more-action-btn {
    opacity: 1;
}

.more-action-btn:hover {
    background-color: rgba(22, 24, 35, 0.06);
    color: #161823;
}

.more-action-btn svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

/* Dark theme overrides for more-action-btn */
body.dark-theme .more-action-btn {
    color: rgba(255, 255, 255, 0.5);
}

body.dark-theme .more-action-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Chat View */
.chat-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #fff;
}

.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(22, 24, 35, 0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.chat-user-info:hover {
    opacity: 0.8;
}

.chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-user-details h3 {
    font-size: 17px;
    font-weight: 700;
    color: #161823;
    margin-bottom: 2px;
}

.chat-user-details p {
    font-size: 14px;
    color: #A0A0A0;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    /* justify-content: flex-end; Removed to fix scrolling issue */
    /* Messages start from bottom like TikTok/WhatsApp */
    gap: 12px;
    position: relative;
    scroll-behavior: smooth;
    /* Hide scrollbar */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.chat-messages::-webkit-scrollbar {
    display: none;
}

.chat-messages> :first-child {
    margin-top: auto;
}

.no-messages-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--ui-shape-neutral-3, rgba(22, 24, 35, 0.34));
    gap: 8px;
    text-align: center;
}

.no-messages-state p {
    font-size: 16px;
    font-weight: 400;
    margin: 0;
}

/* TikTok Message Structure Styles */
.css-vzeelx-7937d88b--DivMessageHorizontalContainer {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    max-width: 100%;
}

.message.received {
    flex-direction: row;
    justify-content: flex-start;
}

.message.sent {
    flex-direction: row-reverse;
    justify-content: flex-start;
    /* Aligns to right in row-reverse */
}

/* Avatar Styles */
.css-jxvnxw-7937d88b--StyledLink {
    display: block;
    text-decoration: none;
    flex-shrink: 0;
}

.css-1xxgaii-7937d88b--SpanAvatarContainer {
    display: block;
    overflow: hidden;
    border-radius: 50%;
}

.css-10s4roi-7937d88b--ImgAvatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Message Text Container - User Provided CSS */
.css-12bzebh-7937d88b--DivTextContainer {
    overflow: hidden;
    width: fit-content;
    max-width: 360px;
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid rgba(22, 24, 35, 0.12);
    /* Base background (for received) */
    background: rgba(22, 24, 35, 0.06);
    word-break: break-word;
    white-space: pre-line;
    /* margin-left: 8px;  Removed fixed margin, handled by flex gap */
    font-family: TikTokFont, Arial, Tahoma, PingFangSC, sans-serif;
    font-size: 16px;
    line-height: 21px;
    color: rgb(22, 24, 35);
}

/* Sent Message Text Override - Same Gray Background */
.message.sent .css-12bzebh-7937d88b--DivTextContainer {
    background: rgba(22, 24, 35, 0.06);
    /* border-color: transparent; Removed to show border */
}

/* Action Icons Container */
.css-274tnb-7937d88b--DivActions {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    /* Hidden by default */
    transition: opacity 0.2s ease;
    padding: 0 8px;
}

/* Show actions on hover */
.css-vzeelx-7937d88b--DivMessageHorizontalContainer:hover .css-274tnb-7937d88b--DivActions {
    opacity: 1;
}

.css-8s6txy-7937d88b--DivIconAction {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: rgba(22, 24, 35, 0.5);
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
}

.css-8s6txy-7937d88b--DivIconAction:hover {
    background-color: rgba(22, 24, 35, 0.06);
    color: rgb(22, 24, 35);
}

.message-timestamp {
    font-size: 12px;
    color: rgba(22, 24, 35, 0.5);
    padding: 0 4px;
}

/* Date Separator */
.date-separator {
    text-align: center;
    padding: 16px 0;
    font-size: 12px;
    font-weight: 600;
    color: rgba(22, 24, 35, 0.5);
    position: relative;
}

/* Chat Bottom - Message Input */
.chat-bottom {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 12px 16px;
    border-top: 0.5px solid rgba(22, 24, 35, 0.12);
    height: 66.4px;
    min-height: 66.4px;
    max-height: 66.4px;
    position: relative;
}

.message-input-wrapper {
    display: flex;
    align-items: flex-end;
    width: 100%;
}

.input-area-container {
    flex: 1;
    display: flex;
    align-items: center;
    background-color: rgba(22, 24, 35, 0.06);
    border-radius: 18px;
    padding: 0 12px 0 16px;
    position: relative;
    height: 41.6px;
    min-height: 41.6px;
    max-height: 41.6px;
}

.editor-container {
    flex: 1;
    display: flex;
    align-items: center;
}

.input-area-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    min-height: 41.6px;
    max-height: 41.6px;
}

.outline-receiver {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: 4px;
}

/* Draft.js Editor Styles */
.DraftEditor-root {
    position: relative;
    font-family: var(--tux-v2-font-text);
    font-size: 14px;
    line-height: 1.3;
    width: 100%;
    display: flex;
    align-items: center;
}

.public-DraftEditorPlaceholder-root {
    position: absolute;
    top: 0;
    left: 17px;
    right: 0;
    pointer-events: none;
    user-select: none;
    display: flex;
    align-items: center;
    height: 100%;
}

.public-DraftEditorPlaceholder-inner {
    color: rgba(22, 24, 35, 0.75);
    font-family: TikTokFont, Arial, Tahoma, PingFangSC, sans-serif;
    font-size: 14px;
    line-height: 18px;
}

.DraftEditor-editorContainer {
    position: relative;
    z-index: 1;
}

.public-DraftEditor-content {
    min-height: 20px;
    max-height: 41.6px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.3;
    color: #161823;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.public-DraftEditor-content::-webkit-scrollbar {
    display: none;
}

.public-DraftEditor-content:focus {
    outline: none;
}

.public-DraftStyleDefault-block {
    margin: 0;
}

.public-DraftStyleDefault-ltr {
    direction: ltr;
    text-align: left;
}

/* Hide placeholder when editor has content */
.public-DraftEditor-content[data-contents="true"]~.public-DraftEditorPlaceholder-root {
    display: none;
}

/* Emoji Button */
.TUXTooltip-reference {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-bottom: 0 !important;
}

.emoji-button {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #000;
    background: transparent;
    border: none;
    padding: 0;
    transition: color 0.2s ease, transform 0.1s ease;
    outline: none;
}

.emoji-button:hover {
    color: rgba(22, 24, 35, 0.9);
}

.emoji-button:active {
    transform: scale(0.95);
}

.emoji-button:focus-visible {
    outline: 2px solid rgba(254, 44, 85, 0.5);
    outline-offset: 2px;
    border-radius: 4px;
}

.emoji-icon {
    width: 20px;
    height: 20px;
    display: block;
}

/* TikTok Notification Badge */
.css-a3bobw-7937d88b--DivIconWithRedDotContainer,
.exb7d122 {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.css-a3bobw-7937d88b--DivIconWithRedDotContainer svg,
.exb7d122 svg {
    color: #000;
    stroke-width: 0.5;
}

.TUXAlertBadgeDot-reference {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.TUXAlertBadgeDot {
    position: absolute;
    background-color: #fe2c55;
    border-radius: 50%;
    border: 1.5px solid #fff;
}

.TUXAlertBadgeDot--small {
    height: 6px;
    width: 6px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(22, 24, 35, 0.12);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(22, 24, 35, 0.2);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: rgba(22, 24, 35, 0.34);
}

.empty-state p:first-child {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-container {
    background-color: var(--ui-page-flat-1);
    border-radius: 8px;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--LineSecondary);
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--TextPrimary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--TextSecondary);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background-color: rgba(22, 24, 35, 0.06);
}

.modal-form {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--TextPrimary);
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="url"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--LineSecondary);
    border-radius: 4px;
    font-size: 14px;
    color: var(--TextPrimary);
    background-color: var(--ui-page-flat-1);
    transition: border-color 0.2s ease;
}

.form-group input[type="file"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--LineSecondary);
    border-radius: 4px;
    font-size: 14px;
    color: var(--TextPrimary);
    background-color: var(--ui-page-flat-1);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.form-group input[type="file"]::-webkit-file-upload-button {
    background-color: rgba(22, 24, 35, 0.06);
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--TextPrimary);
    cursor: pointer;
    margin-right: 12px;
    transition: background-color 0.2s ease;
}

.form-group input[type="file"]::-webkit-file-upload-button:hover {
    background-color: rgba(22, 24, 35, 0.12);
}


.form-group input:focus {
    outline: none;
    border-color: #fe2c55;
}

.username-input {
    display: flex;
    align-items: center;
    border: 1px solid var(--LineSecondary);
    border-radius: 4px;
    background-color: var(--ui-page-flat-1);
    transition: border-color 0.2s ease;
}

.username-input:focus-within {
    border-color: #fe2c55;
}

.username-prefix {
    padding: 12px 0 12px 16px;
    font-size: 14px;
    color: var(--TextSecondary);
}

.username-input input {
    flex: 1;
    border: none;
    padding: 12px 16px 12px 4px;
    font-size: 14px;
    color: var(--TextPrimary);
    background: transparent;
}

.username-input input:focus {
    outline: none;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background-color: #fe2c55;
    color: white;
}

.btn-primary:hover {
    background-color: #e02649;
}

.btn-secondary {
    background-color: rgba(22, 24, 35, 0.06);
    color: var(--TextPrimary);
}

.btn-secondary:hover {
    background-color: rgba(22, 24, 35, 0.12);
}

/* Form Row for Date/Time */
.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

/* Textarea Styles */
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--LineSecondary);
    border-radius: 4px;
    font-size: 14px;
    color: var(--TextPrimary);
    background-color: var(--ui-page-flat-1);
    font-family: var(--tux-v2-font-text);
    resize: vertical;
    transition: border-color 0.2s ease;
}

.form-group textarea:focus {
    outline: none;
    border-color: #fe2c55;
}

/* Radio Group Styles */
.radio-group {
    display: flex;
    gap: 16px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--TextPrimary);
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #fe2c55;
}

.radio-label span {
    user-select: none;
}

/* Profile Picture Preview */
.profile-preview {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.profile-preview-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--LineSecondary);
    transition: border-color 0.2s ease;
}

.profile-preview-avatar:hover {
    border-color: #fe2c55;
}

.profile-preview-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Theme Options Styles */
.theme-options {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.theme-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    border: 2px solid var(--LineSecondary);
    border-radius: 8px;
    background-color: var(--ui-page-flat-1);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 600;
    color: var(--TextPrimary);
}

.theme-option:hover {
    border-color: var(--ui-shape-neutral-3);
    background-color: var(--ui-shape-neutral-4);
}

.theme-option.active {
    border-color: #fe2c55;
    background-color: rgba(254, 44, 85, 0.05);
    color: #fe2c55;
}

.theme-option svg {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

/* Dark Theme Styles */
body.dark-theme {
    background-color: #000000;
    color: #ffffff;
}

body.dark-theme .side-nav-container,
body.dark-theme .messages-drawer,
body.dark-theme .chat-view,
body.dark-theme .messages-header {
    background-color: #000000;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .messages-header h2,
body.dark-theme .conversation-name,
body.dark-theme .nav-item,
body.dark-theme .modal-header h3,
body.dark-theme .form-group label {
    color: #ffffff;
}

body.dark-theme .conversation-preview,
body.dark-theme .preview-text {
    color: rgba(255, 255, 255, 0.6);
}

body.dark-theme .preview-time {
    color: rgba(255, 255, 255, 0.4);
}

body.dark-theme .conversation-item {
    background-color: transparent;
}

body.dark-theme .conversation-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

body.dark-theme .conversation-item.active {
    background-color: #2a2a2a;
}

body.dark-theme .modal-container {
    background-color: #1a1a1a;
}

body.dark-theme .modal-close {
    color: rgba(255, 255, 255, 0.6);
}

body.dark-theme .modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .form-group input,
body.dark-theme .form-group textarea,
body.dark-theme .username-input {
    background-color: #2a2a2a;
    border-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

body.dark-theme .btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

body.dark-theme .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

body.dark-theme .theme-option {
    background-color: #2a2a2a;
    border-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

body.dark-theme .theme-option:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.05);
}

body.dark-theme .chat-header {
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .chat-user-details h3 {
    color: #ffffff;
}

body.dark-theme .chat-user-details p {
    color: rgba(255, 255, 255, 0.6);
}

/* Dark Theme Search Button */
body.dark-theme .search-button {
    background-color: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

body.dark-theme .search-button svg {
    color: #fff !important;
    fill: #fff !important;
}

body.dark-theme .search-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

body.dark-theme .search-button:active {
    background-color: rgba(255, 255, 255, 0.25);
}

/* Dark Theme More Button Icon */
body.dark-theme #moreButton svg {
    color: #fff !important;
    fill: #fff !important;
}

/* Dark Theme Notification Dot Stroke */
body.dark-theme .TUXAlertBadgeDot--small {
    border: 1.5px solid #121212;
    /* Dark background color for stroke effect */
    box-shadow: 0 0 0 1px #121212;
}

body.dark-theme .nav-item.has-notification::after {
    border-color: #121212;
}

/* Dark Theme Navigation Items */
body.dark-theme .nav-item {
    color: #ffffff;
}

body.dark-theme .nav-item.active {
    color: var(--ui-shape-primary);
    background-color: transparent;
}

body.dark-theme .nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Dark Theme Chat Bubbles */
body.dark-theme .message .css-12bzebh-7937d88b--DivTextContainer {
    background-color: rgb(0, 162, 201);
    color: #ffffff;
    border: none;
}

body.dark-theme .message.sent .css-12bzebh-7937d88b--DivTextContainer,
body.dark-theme .message.received .css-12bzebh-7937d88b--DivTextContainer {
    background-color: rgb(0, 162, 201);
    color: #ffffff;
}

/* Dark Theme Date Separator */
body.dark-theme .date-separator {
    color: rgba(255, 255, 255, 0.6);
}

/* Dark Theme Message Input */
body.dark-theme .input-area-container {
    background-color: #2f2f2f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 22px;
    /* Rounded corners like capsule */
}

body.dark-theme .public-DraftEditor-content,
body.dark-theme .public-DraftEditorPlaceholder-inner {
    color: #FFFFFFBF;
}

body.dark-theme .emoji-icon {
    color: #ffffff;
    fill: #ffffff;
}