/* ============================================
   MESSAGING V3 - GLASS MODE ONLY
   100% TRANSPARENT - NO DARK BACKGROUNDS
   Orange wave shows through everything
   ============================================ */

/* Container - positioned by index.html CSS via body.mv2-split-screen */
.mv2-container {
    display: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: transparent !important;
    --header-text-color: white;
    --input-text-color: white;
    --input-border-color: rgba(255, 255, 255, 0.4);
    --placeholder-color: rgba(255, 255, 255, 0.6);
    --timestamp-color: rgba(255, 255, 255, 0.5);
    --settings-text-color: white;
    --general-text-color: white;
}

.mv2-container.mv2-active {
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    opacity: 1;
}

/* Closing animation - fades out over 2 seconds */
.mv2-container.mv2-closing {
    display: flex !important;
    flex-direction: column;
    pointer-events: none;
    opacity: 0 !important;
    transition: opacity 2s ease !important;
}

/* Fullscreen mode */
.mv2-container.mv2-fullscreen {
    width: 100% !important;
    left: 0 !important;
    max-width: 100% !important;
    border-left: none !important;
}

/* Wrapper */
.mv2-wrapper {
    display: flex;
    flex: 1;
    height: 100%;
    overflow: hidden;
    background: transparent !important;
}

/* Sidebar - conversations list */
.mv2-sidebar {
    width: 350px;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    background: transparent !important;
    border-right: none;
}

.mv2-sidebar.mv2-hidden {
    display: none;
}

/* Chat panel */
.mv2-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: transparent !important;
}

.mv2-chat.mv2-active {
    display: flex;
}

/* Header */
.mv2-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: transparent !important;
    border-bottom: none;
}

.mv2-title {
    color: var(--header-text-color) !important;
    font-size: 20px;
    font-weight: 600;
}

/* Header buttons */
.mv2-header-btns {
    display: flex;
    gap: 8px;
}

.mv2-icon-btn {
    background: transparent !important;
    border: none;
    color: var(--header-text-color) !important;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.mv2-icon-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* User info box */
.mv2-user-box {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: none;
    gap: 12px;
    background: transparent !important;
}

.mv2-user-info {
    flex: 1;
}

.mv2-user-name {
    color: var(--general-text-color) !important;
    font-size: 15px;
    font-weight: 600;
}

.mv2-user-role {
    color: var(--placeholder-color);
    font-size: 13px;
    text-transform: capitalize;
}

/* Toggle row */
.mv2-toggle-row {
    padding: 10px 20px;
    border-bottom: none;
    background: transparent !important;
}

.mv2-toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--general-text-color);
    font-size: 14px;
    cursor: pointer;
}

/* Avatar */
.mv2-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}

.mv2-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Conversation list */
.mv2-conv-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: transparent !important;
}

/* Conversation item - TRANSPARENT with white border */
.mv2-conv-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent !important;
    border: none;
}

.mv2-conv-item:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

.mv2-conv-item.mv2-selected,
.mv2-conv-item.active {
    background: rgba(255, 255, 255, 0.15) !important;
    border: none;
}

.mv2-conv-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
}

.mv2-conv-avatar-group {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.mv2-conv-info {
    flex: 1;
    margin-left: 12px;
    overflow: hidden;
}

.mv2-conv-name {
    color: var(--general-text-color) !important;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mv2-conv-preview {
    color: var(--placeholder-color);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mv2-conv-time {
    color: var(--timestamp-color);
    font-size: 12px;
    flex-shrink: 0;
    margin-left: 10px;
}

/* Chat area */
.mv2-chat-area {
    flex: 1;
    display: none;
    flex-direction: column;
    background: transparent !important;
}

.mv2-chat-area.mv2-active {
    display: flex;
}

/* Chat header */
.mv2-chat-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: transparent !important;
    border-bottom: none;
    gap: 12px;
}

.mv2-back-btn {
    display: none;
    background: transparent !important;
    border: none;
    color: var(--header-text-color) !important;
    cursor: pointer;
    padding: 5px;
}

.mv2-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.mv2-chat-info {
    flex: 1;
}

.mv2-chat-name {
    color: var(--header-text-color) !important;
    font-size: 16px;
    font-weight: 600;
}

.mv2-chat-role {
    color: var(--placeholder-color);
    font-size: 13px;
    text-transform: capitalize;
}

/* Messages area */
.mv2-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: transparent !important;
}

/* Message */
.mv2-msg {
    display: flex;
    flex-direction: column;
    max-width: 70%;
}

.mv2-msg-sent {
    align-self: flex-end;
    align-items: flex-end;
}

.mv2-msg-recv {
    align-self: flex-start;
    align-items: flex-start;
}

/* Message bubble - Uses CSS custom properties for user preferences */
.mv2-msg-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.4;
    word-wrap: break-word;
}

.mv2-msg-sent .mv2-msg-bubble {
    background: var(--my-bubble-bg, transparent) !important;
    border: 0.3px solid var(--my-bubble-border, rgba(255, 255, 255, 0.4));
    color: var(--my-text-color, white);
    border-bottom-right-radius: 4px;
}

.mv2-msg-recv .mv2-msg-bubble {
    background: var(--other-bubble-bg, transparent) !important;
    border: 0.3px solid var(--other-bubble-border, rgba(255, 255, 255, 0.4));
    color: var(--other-text-color, white);
    border-bottom-left-radius: 4px;
}

.mv2-msg-time {
    font-size: 11px;
    color: var(--timestamp-color);
    margin-top: 4px;
}

/* Input bar - TRANSPARENT */
.mv2-input-bar {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: transparent !important;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    gap: 10px;
}

/* Input field - TRANSPARENT with white border */
.mv2-input {
    flex: 1;
    background: transparent !important;
    background-color: transparent !important;
    border: 1px solid var(--input-border-color) !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    color: var(--input-text-color) !important;
    font-size: 15px !important;
    outline: none;
}

.mv2-input::placeholder {
    color: var(--placeholder-color) !important;
}

.mv2-input:focus {
    border-color: var(--input-border-color) !important;
    background: transparent !important;
    background-color: transparent !important;
}

/* Send button - TRANSPARENT with white border, shows SEND text */
.mv2-send-btn {
    background: transparent !important;
    border: 1px solid var(--input-border-color) !important;
    min-width: 70px;
    height: 44px;
    border-radius: 8px;
    color: var(--input-text-color) !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    padding: 0 16px;
}

.mv2-send-btn svg {
    display: none;
}

.mv2-send-btn::after {
    content: 'SEND';
}

.mv2-send-btn:hover {
    border-color: white !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Empty state */
.mv2-chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    background: transparent !important;
}

.mv2-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    padding: 40px;
    background: transparent !important;
}

/* Modal */
.mv2-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999999 !important;
    align-items: center;
    justify-content: center;
}

.mv2-modal.mv2-modal-open {
    display: flex;
}

.mv2-modal-content {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.mv2-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mv2-modal-title {
    color: white;
    font-size: 20px;
    font-family: 'Roboto', sans-serif;
    font-weight: 100;
}

.mv2-modal-close {
    background: transparent !important;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
}

.mv2-modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: 60vh;
}

.mv2-user-search {
    width: 100%;
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 12px 15px;
    color: white;
    font-size: 15px;
    margin-bottom: 15px;
    outline: none;
}

.mv2-user-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mv2-user-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.mv2-user-item:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

.mv2-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    font-weight: 600;
    margin-right: 12px;
}

.mv2-user-details {
    flex: 1;
}

.mv2-user-item-name {
    color: white !important;
    font-size: 15px;
    font-weight: 500;
}

.mv2-user-item-role {
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 13px;
    text-transform: capitalize;
}

/* Loading state */
.mv2-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.6);
    background: transparent !important;
}

/* Scrollbar */
.mv2-conv-list::-webkit-scrollbar,
.mv2-messages::-webkit-scrollbar,
.mv2-modal-body::-webkit-scrollbar {
    width: 6px;
}

.mv2-conv-list::-webkit-scrollbar-track,
.mv2-messages::-webkit-scrollbar-track,
.mv2-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.mv2-conv-list::-webkit-scrollbar-thumb,
.mv2-messages::-webkit-scrollbar-thumb,
.mv2-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* ============================================
   SETTINGS MODAL STYLES
   ============================================ */

.mv2-settings-section {
    margin-bottom: 20px;
}

.mv2-settings-label {
    display: block;
    color: white;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    font-weight: 100;
    margin-bottom: 8px;
}

.mv2-settings-select,
.mv2-settings-color,
.mv2-settings-range {
    width: 100% !important;
    padding: 10px !important;
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 8px !important;
    color: white !important;
    font-size: 14px !important;
    font-family: 'Roboto', sans-serif !important;
    font-weight: 100 !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.mv2-settings-select:focus,
.mv2-settings-select:active,
.mv2-settings-select:hover,
.mv2-settings-color:focus,
.mv2-settings-color:active,
.mv2-settings-color:hover,
.mv2-settings-range:focus,
.mv2-settings-range:active,
.mv2-settings-range:hover {
    border: 1px solid rgba(255, 255, 255, 0.7) !important;
    border-color: rgba(255, 255, 255, 0.7) !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1) !important;
}

.mv2-settings-color {
    height: 50px !important;
    cursor: pointer !important;
}

.mv2-settings-range {
    padding: 0 !important;
    height: 40px !important;
}

.mv2-settings-heading {
    color: white;
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    font-weight: 100;
    margin: 30px 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.mv2-settings-save-btn {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    font-weight: 100;
    cursor: pointer;
    margin-top: 30px;
    transition: all 0.2s;
}

.mv2-settings-save-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.6);
}

/* ============================================
   MOBILE STYLES - Still transparent
   ============================================ */

@media (max-width: 768px) {
    .mv2-container {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: rgba(0, 0, 0, 0.95) !important;
        z-index: 999999 !important;
    }

    .mv2-wrapper {
        flex-direction: column;
        height: 100% !important;
        overflow: hidden !important;
    }

    /* NEW Mobile-only input field - glass mode - OVERRIDE GLOBAL STYLES */
    .mv2-container .mv2-input-mobile[type="text"] {
        flex: 1 !important;
        background: transparent !important;
        background-color: transparent !important;
        border: 1px solid var(--input-border-color) !important;
        border-radius: 8px !important;
        padding: 12px 16px !important;
        color: var(--input-text-color) !important;
        font-size: 15px !important;
        outline: none !important;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
        box-shadow: none !important;
    }

    .mv2-container .mv2-input-mobile[type="text"]::placeholder {
        color: var(--placeholder-color) !important;
    }

    .mv2-container .mv2-input-mobile[type="text"]:focus {
        border: 1px solid var(--input-border-color) !important;
        border-color: var(--input-border-color) !important;
        background: transparent !important;
        background-color: transparent !important;
        box-shadow: none !important;
    }

    .mv2-sidebar {
        width: 100%;
        border-right: none;
        height: 100% !important;
        overflow: hidden !important;
    }

    .mv2-sidebar.mv2-hidden {
        display: none;
    }

    .mv2-conv-list {
        overflow-y: scroll !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior-y: contain !important;
    }

    .mv2-chat {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10;
        display: none;
        background: transparent !important;
    }

    .mv2-chat.mv2-active {
        display: flex;
    }

    .mv2-back-btn {
        display: block;
    }

    .mv2-msg {
        max-width: 85%;
    }
}

/* ============================================================
   NEW FEATURES STYLES
   ============================================================ */

/* Header action buttons */
.mv2-header-btn {
    background: transparent !important;
    border: none;
    color: var(--header-text-color) !important;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    transition: opacity 0.2s;
}

.mv2-header-btn:hover {
    opacity: 0.7;
}

.mv2-header-btn.recording {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Context menu */
.mv2-context-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9999999;
}

.mv2-context-menu {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.mv2-context-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mv2-context-item:last-child {
    border-bottom: none;
}

.mv2-context-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Search bar */
.mv2-search-bar {
    display: none;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--input-border-color);
}

.mv2-search-input {
    width: 100% !important;
    padding: 10px 12px !important;
    border: 1px solid var(--input-border-color) !important;
    border-radius: 8px !important;
    background: transparent !important;
    color: var(--input-text-color) !important;
    font-size: 15px !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.mv2-search-input::placeholder {
    color: var(--placeholder-color) !important;
}

.mv2-search-input:focus,
.mv2-search-input:active,
.mv2-search-input:hover,
.mv2-search-input:focus-visible,
.mv2-search-input:focus-within {
    border: 1px solid var(--input-border-color) !important;
    border-color: var(--input-border-color) !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}
