/* TUJUANE CHAT SYSTEM V2 PREMIUM REDESIGN */
:root {
    --neon-cyan: #00f3ff;
    --neon-cyan-dark: #00c3cc;
    --glass-bg: rgba(10, 10, 10, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    --sent-gradient: linear-gradient(135deg, #00f3ff 0%, #00c3cc 100%);
}

body.chat-open {
    overflow: hidden !important;
}

#tujuane-chat-v2-root {
    font-family: 'Outfit', 'Inter', sans-serif;
}

/* ============================
   1. DESKTOP WIDGET (Bottom Right)
   ============================ */
.fc-widget {
    position: fixed;
    bottom: 0px;
    right: 25px;
    width: 360px;
    height: 500px;
    background: #000;
    border: 1px solid #1a1a1a;
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    z-index: 100000;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#fc-widget.minimized {
    height: 70px !important;
    transform: translateY(0);
}

/* --- HEADER --- */
.fc-header {
    height: 70px;
    background: #000;
    border-bottom: 1px solid #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.fc-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fc-avatar-wrapper {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.fc-avatar-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.online-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #0076fe;
    /* Ivy Debbie Blue */
    border-radius: 50%;
    border: 2px solid #000;
}

.fc-details h4 {
    font-size: 16px;
    color: #fff;
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.fc-details span {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.fc-controls button {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.fc-controls button:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--neon-cyan);
}

/* --- BODY --- */
.fc-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    background: #000;
}

/* --- FOOTER --- */
.fc-footer {
    padding: 15px 20px;
    background: #000;
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid #1a1a1a;
}

#fc-input-field,
.fc-footer input#fc-input-field {
    flex: 1;
    background: #111 !important;
    border: 1px solid #222 !important;
    color: #fff !important;
    padding: 12px 18px;
    border-radius: 30px;
    /* Match mobile pill style */
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    font-weight: 500;
}

.fc-footer input:focus {
    border-color: #333;
    background: #151515 !important;
}

.fc-footer button {
    background: #0076fe;
    color: #fff;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
}

.fc-footer button:hover {
    transform: scale(1.05);
}

/* ============================
   2. MOBILE OVERLAY (AFRO STYLE)
   ============================ */
#tujuane-mobile-chat-view {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100dvh !important;
    background: #000 !important;
    z-index: 1000000 !important;
    display: none;
    grid-template-rows: 56px 1fr auto !important;
    overflow: hidden !important;
}

/* Ensure EVERYTHING inside uses border-box */
#tujuane-mobile-chat-view,
#tujuane-mobile-chat-view *,
#tujuane-mobile-chat-view *::before,
#tujuane-mobile-chat-view *::after {
    box-sizing: border-box !important;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.mobile-chat-header {
    height: 56px;
    background: #000;
    border-bottom: 1px solid #1a1a1a;
    display: flex;
    align-items: center;
    padding: 0;
    /* Flush to the edge for the back button */
    gap: 0;
}

.btn-mobile-back {
    background: transparent !important;
    border: none !important;
    color: #fff !important;
    width: 44px;
    height: 44px;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    box-shadow: none !important;
}

.btn-mobile-back i {
    font-weight: 600 !important;
    /* Make arrow more visible */
}

.mobile-header-user {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-avatar-container {
    position: relative;
    width: 42px;
    height: 42px;
}

.mobile-avatar-container img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    /* Circular as per screenshot */
    object-fit: cover;
}

#mc-status-dot,
.mobile-avatar-container .online-dot,
#mc-status-dot.online {
    display: none !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    position: absolute !important;
}

.mobile-user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.mobile-user-info h3,
.mobile-user-info span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-user-info h3 {
    font-size: 15px;
    color: #fff;
    margin: 0;
    font-weight: 600;
    line-height: 1.1;
}

.mobile-user-info span {
    display: block !important;
    font-size: 12px !important;
    color: #666 !important;
    /* Subtle gray/white as per screenshot */
    font-weight: 400 !important;
    margin-top: 1px;
}

.btn-mobile-options {
    background: transparent !important;
    border: none !important;
    color: #fff !important;
    width: 44px;
    height: 44px;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
    margin-left: auto;
    margin-right: 25px !important;
    /* PUSHED LEFT */
}

.mobile-chat-body {
    grid-row: 2;
    padding: 15px 20px 20px;
    /* Slightly increased (from 10px) to 15px */
    overflow-y: auto;
    background: #000;
    display: flex;
    flex-direction: column;
    overscroll-behavior: contain;
}

.mobile-chat-footer {
    grid-row: 3;
    padding: 10px 15px !important;
    background: #000;
    border-top: 1px solid #1a1a1a;
    display: flex;
    align-items: center;
    gap: 6px;
    /* Reduced from 10px to group send button closer */
    padding-bottom: env(safe-area-inset-bottom, 15px);
    width: 100% !important;
    box-sizing: border-box !important;
}

#mc-input {
    flex: 1;
    background: #111;
    border: 1px solid #222;
    color: #fff;
    padding: 12px 20px;
    border-radius: 30px;
    font-size: 16px;
    outline: none;
    min-width: 0;
    margin-left: 10px;
    margin-right: 5px;
    /* Balanced side spacing */
}

#mc-send-btn {
    background: transparent !important;
    color: var(--neon-cyan);
    border: none !important;
    font-size: 24px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
    box-shadow: none !important;
    margin-right: 0 !important;
    transform: translate(-18px, -2px) !important;
    /* Moved even closer to input */
}

/* ============================
   3. MESSAGES (UNIFIED V2)
   ============================ */
.msg-wrapper {
    width: 100%;
    margin-bottom: 2px;
    clear: both;
    display: block;
}

.msg-wrapper.v2-sent {
    text-align: right;
}

.msg-wrapper.v2-received {
    text-align: left;
}

.msg-received-group {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    width: 100%;
}

.msg-partner-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.msg-avatar-spacer {
    width: 28px;
    flex-shrink: 0;
}

.msg-date-separator {
    width: 100%;
    text-align: center;
    font-size: 11px;
    color: #ccc;
    margin: 10px 0 10px;
    /* Reduced top margin (was 20px) */
    font-weight: 500;
}

.v2-msg {
    display: inline-block;
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px !important;
    font-size: 15px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    text-align: left;
    box-sizing: border-box;
}

.v2-sent .v2-msg {
    background: #0076fe;
    color: #fff;
    border-bottom-right-radius: 4px !important;
}

.v2-received .v2-msg {
    background: #e9e9eb;
    color: #000;
    border-bottom-left-radius: 4px !important;
}

.msg-wrapper.v2-received {
    text-align: left;
}

.mobile-messages-box {
    display: flex;
    flex-direction: column;
    padding: 15px 12px 30px 15px !important;
    /* Increased to 12px for "slight space" from edge */
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

@keyframes bubblePop {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.msg-time {
    display: none !important;
    /* Remove from inside bubbles */
}

/* ============================
   4. ICEBREAKERS (UNIFIED)
   ============================ */
.mobile-icebreakers,
.fc-icebreakers {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0 40px;
    text-align: center;
}

.icebreaker-title {
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.icebreaker-icon {
    font-size: 48px;
    color: var(--neon-cyan);
    margin-bottom: 25px;
    opacity: 0.8;
}

.ice-btn,
.ic-btn {
    display: block;
    background: rgba(255, 255, 255, 0.03);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 20px;
    width: 100%;
    max-width: 320px;
    border-radius: 15px;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.ice-btn:hover,
.ic-btn:hover {
    background: var(--sent-gradient);
    color: #000;
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 243, 255, 0.2);
}

.ice-more-btn {
    background: transparent;
    border: 1px dashed #444;
    color: #666;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 12px;
    margin-top: 10px;
    cursor: pointer;
}

/* ============================
   5. DASHBOARD SPLIT-PANE CHAT
   ============================ */
.split-chat-container {
    display: flex;
    height: calc(100vh - 70px);
    /* Even taller */
    background: #000;
    border: 1px solid #1a1a1a;
    border-radius: 20px;
    overflow: hidden;
    margin: -25px auto 5px;
    /* Pushed up higher against menu */
    max-width: 1240px !important;
}

.split-inbox {
    width: 350px;
    border-right: 1px solid #1a1a1a;
    display: flex;
    flex-direction: column;
    background: #000;
}

.split-inbox-header {
    padding: 20px 25px 15px;
    /* Tightened */
    border-bottom: 1px solid #1a1a1a;
}

.split-inbox-header h3 {
    margin: 0;
    color: #fff;
    font-size: 24px;
    /* Slightly smaller */
    font-weight: 900;
}

#dashboard-inbox-list {
    flex: 1;
    overflow-y: auto;
}

.split-chat-view,
#split-chat-active {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #000;
    height: 100%;
}

.split-chat-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #444;
}

.split-chat-placeholder i {
    font-size: 64px;
    margin-bottom: 20px;
}

.split-chat-placeholder h3 {
    color: #888;
    margin-bottom: 10px;
}

.split-chat-header {
    height: 80px;
    border-bottom: 1px solid #1a1a1a;
    display: flex;
    align-items: center;
    padding: 0 30px;
}

.active-partner-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.active-partner-info img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.active-partner-details h4 {
    margin: 0;
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.active-partner-details span {
    font-size: 13px;
    color: #666;
    margin-top: -2px;
    /* Pull closer */
    display: block;
}

.split-messages-body {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    background: #000;
    display: flex;
    flex-direction: column;
}

.split-chat-footer {
    padding: 5px 25px 15px;
    /* Tighter footer */
    background: #000;
    border-top: 1px solid #1a1a1a;
    display: flex;
    align-items: center;
    gap: 15px;
}

#split-input-field {
    flex: 1;
    background: #111;
    border: 1px solid #222;
    color: #fff;
    padding: 15px 25px;
    border-radius: 30px;
    font-size: 16px;
    outline: none;
}

#split-send-btn {
    background: #0076fe;
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.2s;
}

#split-send-btn:hover {
    transform: scale(1.1);
}

/* Redefine Inbox Items for Split Style */
.inbox-list-v2 .inbox-item {
    border: none;
    background: transparent;
    border-radius: 0;
    border-bottom: 1px solid #0a0a0a;
    padding: 12px 20px;
    /* Reduced row height */
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    /* Tighter gap */
    position: relative;
}

.inbox-list-v2 .inbox-item.active {
    background: rgba(255, 255, 255, 0.04);
}

.inbox-list-v2 .inbox-item.active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 5px;
    bottom: 5px;
    width: 3px;
    background: #0076fe;
    border-radius: 4px 0 0 4px;
}

.inbox-list-v2 .inbox-item:hover {
    background: rgba(255, 255, 255, 0.02);
    transform: none;
}

.inbox-list-v2 .inbox-avatar {
    width: 48px;
    /* Smaller avatars */
    height: 48px;
}

.inbox-list-v2 .inbox-avatar img {
    border-radius: 50%;
    /* Circular as per screenshot */
}

.inbox-list-v2 .inbox-name {
    font-size: 18px;
    font-weight: 800;
}

.inbox-list-v2 .inbox-time {
    color: #666;
    font-weight: 400;
    font-size: 10px;
}

.inbox-list-v2 .inbox-msg {
    font-size: 13px;
    color: #999;
}

.inbox-list-v2 .inbox-top {
    margin-bottom: 4px;
}

.inbox-avatar {
    position: relative;
    width: 54px;
    height: 54px;
    flex-shrink: 0;
}

.inbox-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    object-fit: cover;
}

.inbox-online-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background: var(--neon-cyan);
    border-radius: 50%;
    border: 2px solid #111;
    box-shadow: 0 0 10px var(--neon-cyan);
}

.inbox-content {
    flex: 1;
    min-width: 0;
}

.inbox-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.inbox-name {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
}

.inbox-time {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
}

.inbox-btm {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.inbox-msg {
    font-size: 14px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 85%;
}

.inbox-item.unread .inbox-msg {
    color: #fff;
    font-weight: 500;
}

.inbox-badge {
    background: var(--neon-cyan);
    color: #000;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

/* ============================
   6. DEVICE SEPARATION
   ============================ */
@media (max-width: 1023px) {

    #fc-widget,
    .fc-widget,
    #tujuane-chat-v2-root {
        display: none !important;
    }

    .split-chat-container {
        display: block !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
    }

    .split-inbox-header {
        display: none !important;
    }

    .split-inbox {
        width: 100% !important;
        border-right: none !important;
    }

    .split-chat-view {
        display: none !important;
    }
}

@media (min-width: 1024px) {
    #tujuane-mobile-chat-view {
        display: none !important;
    }
}