/* =====================================================
   VibeChat - WhatsApp-Inspired Premium Theme
   Clean, Familiar, Professional
   ===================================================== */

/* CSS Variables - WhatsApp Design Tokens */
:root {
    /* WhatsApp Colors */
    --wa-dark-green: #075E54;
    --wa-teal: #128C7E;
    --wa-light-green: #25D366;
    --wa-blue: #34B7F1;
    --wa-sent-bubble: #005C4B;
    --wa-received-bubble: #1F2C34;
    --wa-chat-bg: #0B141A;
    --wa-sidebar-bg: #111B21;
    --wa-header-bg: #1F2C34;
    --wa-input-bg: #2A3942;
    --wa-border: rgba(134, 150, 160, 0.15);

    /* Background Layers */
    --bg-base: #0B141A;
    --bg-primary: #111B21;
    --bg-secondary: #1F2C34;
    --bg-tertiary: #2A3942;
    --bg-elevated: #3B4A54;
    --bg-card: rgba(31, 44, 52, 0.95);

    /* Glass Effect */
    --glass-bg: rgba(17, 27, 33, 0.95);
    --glass-border: rgba(134, 150, 160, 0.1);

    /* Text Colors */
    --text-primary: #E9EDEF;
    --text-secondary: #8696A0;
    --text-tertiary: rgba(134, 150, 160, 0.7);
    --text-muted: rgba(134, 150, 160, 0.4);

    /* Accent Colors */
    --accent-primary: #00A884;
    --accent-secondary: #25D366;
    --accent-gradient: linear-gradient(135deg, #00A884 0%, #25D366 100%);
    --accent-gradient-soft: linear-gradient(135deg, rgba(0, 168, 132, 0.15) 0%, rgba(37, 211, 102, 0.1) 100%);
    --accent-green: #25D366;
    --accent-green-glow: rgba(37, 211, 102, 0.3);
    --accent-orange: #F5A623;
    --accent-red: #EA4335;
    --accent-blue: #34B7F1;
    --accent-teal: #00A884;

    /* Message Bubbles - WhatsApp Style */
    --bubble-sent: #005C4B;
    --bubble-sent-light: #025144;
    --bubble-received: #1F2C34;

    /* Semantic Colors */
    --success: #25D366;
    --warning: #F5A623;
    --error: #EA4335;

    /* Borders & Separators */
    --separator: rgba(134, 150, 160, 0.1);
    --border-color: rgba(134, 150, 160, 0.15);

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-glow-green: 0 0 12px rgba(37, 211, 102, 0.3);

    /* Safe Areas */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-xl: 12px;
    --radius-2xl: 16px;
    --radius-full: 9999px;
    --radius-bubble: 7.5px;

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;

    /* Component Sizes */
    --header-height: 56px;
    --avatar-size: 49px;
    --avatar-size-sm: 40px;
    --avatar-size-lg: 80px;
    --icon-btn-size: 40px;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --duration-fast: 0.15s;
    --duration-normal: 0.2s;

    /* Typography */
    --font-family: 'Segoe UI', Helvetica, Arial, sans-serif;

    /* Chat Wallpapers */
    --chat-wallpaper: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* =====================================================
   Light Theme Variables
   ===================================================== */
[data-theme="light"] {
    --bg-base: #F0F2F5;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F0F2F5;
    --bg-tertiary: #E4E6EB;
    --bg-elevated: #D8DADF;
    --bg-card: rgba(255, 255, 255, 0.98);

    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(0, 0, 0, 0.08);

    --text-primary: #1C1E21;
    --text-secondary: #65676B;
    --text-tertiary: rgba(0, 0, 0, 0.4);
    --text-muted: rgba(0, 0, 0, 0.25);

    --wa-chat-bg: #E5DDD5;
    --wa-sidebar-bg: #FFFFFF;
    --wa-header-bg: #F0F2F5;
    --wa-input-bg: #FFFFFF;
    --wa-border: rgba(0, 0, 0, 0.08);

    --bubble-sent: #DCF8C6;
    --bubble-sent-light: #E7FFDB;
    --bubble-received: #FFFFFF;

    --separator: rgba(0, 0, 0, 0.08);
    --border-color: rgba(0, 0, 0, 0.1);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);

    --chat-wallpaper: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23128C7E' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Light theme message text color fix */
[data-theme="light"] .message.sent .message-bubble {
    color: #111B21;
}

[data-theme="light"] .message.received .message-bubble {
    color: #111B21;
}

/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    height: 100%;
    font-family: var(--font-family);
    background: var(--bg-base);
    color: var(--text-primary);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* App Container */
#app {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-base);
}

/* =====================================================
   Connection Bar
   ===================================================== */
.connection-bar {
    padding: var(--space-2) var(--space-4);
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    z-index: 200;
}

.connection-bar.connecting {
    background: var(--accent-orange);
    color: white;
}

.connection-bar.connected {
    background: var(--accent-green);
    color: white;
    animation: slideOut 0.3s var(--ease-out) 1s forwards;
}

.connection-bar.disconnected {
    background: var(--accent-red);
    color: white;
}

.connection-bar.hidden {
    display: none;
}

@keyframes slideOut {
    to {
        transform: translateY(-100%);
        opacity: 0;
        height: 0;
        padding: 0;
    }
}

.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =====================================================
   Main Layout
   ===================================================== */
.main-container {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* =====================================================
   Sidebar - WhatsApp Style
   ===================================================== */
.sidebar {
    width: 400px;
    min-width: 350px;
    max-width: 40%;
    background: var(--bg-primary);
    border-right: 1px solid var(--separator);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        position: absolute;
        inset: 0;
        z-index: 50;
        transform: translateX(0);
        transition: transform var(--duration-normal) var(--ease-out);
    }

    .sidebar.mobile-hidden {
        transform: translateX(-100%);
        pointer-events: none;
    }
}

/* =====================================================
   Header - WhatsApp Style
   ===================================================== */
.header {
    background: var(--bg-secondary);
    padding: var(--space-3) var(--space-4);
    padding-top: calc(var(--safe-area-top) + var(--space-3));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    min-height: var(--header-height);
}

.header-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.header-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.header-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.header-subtitle::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    box-shadow: var(--shadow-glow-green);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.header-actions {
    display: flex;
    gap: var(--space-1);
}

/* Icon Buttons - WhatsApp Style */
.icon-btn {
    width: var(--icon-btn-size);
    height: var(--icon-btn-size);
    border-radius: var(--radius-full);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.icon-btn:hover {
    background: rgba(134, 150, 160, 0.1);
    color: var(--text-primary);
}

.icon-btn:active {
    transform: scale(0.95);
}

.icon-btn svg {
    width: 22px;
    height: 22px;
}

/* =====================================================
   Vibe Theme Badge - WhatsApp Style
   ===================================================== */
.vibe-theme-badge {
    display: none;
    /* Hide in WhatsApp theme */
}

.secure-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    background: rgba(37, 211, 102, 0.1);
    border: 1px solid rgba(37, 211, 102, 0.2);
    border-radius: var(--radius-full);
    color: var(--accent-green);
    font-size: 11px;
    font-weight: 500;
}

.secure-badge svg {
    width: 12px;
    height: 12px;
}

/* =====================================================
   Search Bar - WhatsApp Style
   ===================================================== */
.search-container {
    padding: var(--space-2) var(--space-3);
    background: var(--bg-primary);
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--space-2) var(--space-3);
    gap: var(--space-3);
    transition: all var(--duration-fast) var(--ease-out);
}

.search-bar:focus-within {
    background: var(--bg-elevated);
}

.search-bar svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.search-bar input::placeholder {
    color: var(--text-secondary);
}

/* =====================================================
   Tabs - WhatsApp Style
   ===================================================== */
.tabs-container {
    padding: var(--space-2) var(--space-3);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--separator);
}

.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid transparent;
}

.tab {
    flex: 1;
    padding: var(--space-3) var(--space-3);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tab::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-primary);
    border-radius: 3px 3px 0 0;
    opacity: 0;
    transition: opacity var(--duration-fast);
}

.tab.active {
    color: var(--accent-primary);
}

.tab.active::after {
    opacity: 1;
}

.tab:not(.active):hover {
    color: var(--text-primary);
}

/* =====================================================
   Filter Chips - WhatsApp Style
   ===================================================== */
.filters-panel {
    padding: var(--space-2) var(--space-3);
    background: var(--bg-primary);
}

.filter-chips {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    scrollbar-width: none;
    padding: var(--space-1) 0;
}

.filter-chips::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    padding: var(--space-2) var(--space-3);
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--duration-fast) var(--ease-out);
}

.filter-chip:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.filter-chip.active {
    background: var(--accent-primary);
    color: white;
}

/* =====================================================
   List Container
   ===================================================== */
.list-container {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.list-section-header {
    padding: var(--space-4) var(--space-4) var(--space-2);
    font-size: 14px;
    font-weight: 500;
    color: var(--accent-primary);
    background: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

/* =====================================================
   User/Chat Item - WhatsApp Style
   ===================================================== */
.user-item,
.chat-item {
    display: flex;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    gap: var(--space-3);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    position: relative;
    background: transparent;
}

.user-item::after,
.chat-item::after {
    content: '';
    position: absolute;
    left: calc(var(--avatar-size) + var(--space-4) + var(--space-3));
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--separator);
}

.user-item:last-child::after,
.chat-item:last-child::after {
    display: none;
}

.user-item:hover,
.chat-item:hover {
    background: rgba(134, 150, 160, 0.08);
}

.user-item:active,
.chat-item:active {
    background: rgba(134, 150, 160, 0.15);
}

.chat-item.active {
    background: rgba(0, 168, 132, 0.15);
}

/* =====================================================
   Avatar - WhatsApp Style (Clean Circles)
   ===================================================== */
.avatar {
    width: var(--avatar-size);
    height: var(--avatar-size);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 500;
    color: white;
    flex-shrink: 0;
    position: relative;
    text-transform: uppercase;
}

.avatar-sm {
    width: var(--avatar-size-sm);
    height: var(--avatar-size-sm);
    font-size: 15px;
}

.avatar-lg {
    width: var(--avatar-size-lg);
    height: var(--avatar-size-lg);
    font-size: 28px;
}

.status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 14px;
    height: 14px;
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-primary);
}

.status-indicator.online {
    background: var(--accent-green);
}

.status-indicator.offline {
    background: var(--text-tertiary);
}

/* =====================================================
   User/Chat Info
   ===================================================== */
.user-info,
.chat-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.user-name,
.chat-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.user-details,
.chat-preview {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-time {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
}

.unread-badge {
    background: var(--accent-primary);
    color: white;
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.friend-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 2px 6px;
    background: var(--accent-primary);
    color: white;
    font-size: 9px;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
}

.friend-badge svg {
    width: 10px;
    height: 10px;
}

/* =====================================================
   Chat Area - WhatsApp Style with Pattern Background
   ===================================================== */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-base);
    min-width: 0;
    position: relative;
}

/* WhatsApp-style chat background pattern */
.chat-area::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: #0B141A;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
    z-index: 0;
    pointer-events: none;
}

@media (max-width: 768px) {
    .chat-area {
        position: absolute;
        inset: 0;
        z-index: 60;
        transform: translateX(100%);
        transition: transform var(--duration-normal) var(--ease-out);
    }

    .chat-area.active {
        transform: translateX(0);
    }
}

/* Chat Header - WhatsApp Style */
.chat-header {
    background: var(--bg-secondary);
    padding: var(--space-2) var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-height: var(--header-height);
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .chat-header {
        padding: calc(var(--safe-area-top) + var(--space-2)) var(--space-3) var(--space-2);
    }
}

.back-btn {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: -8px;
}

.back-btn:hover {
    color: var(--text-primary);
}

.back-btn svg {
    width: 24px;
    height: 24px;
}

@media (max-width: 768px) {
    .back-btn {
        display: flex;
    }
}

.chat-header-info {
    flex: 1;
    min-width: 0;
}

.chat-header-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.chat-header-status {
    font-size: 13px;
    color: var(--text-secondary);
}

.chat-header-status.typing {
    color: var(--accent-primary);
}

.chat-header-actions {
    display: flex;
    gap: var(--space-1);
}

/* =====================================================
   Messages Container - WhatsApp Style
   ===================================================== */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4) var(--space-6);
    display: flex;
    flex-direction: column;
    gap: 2px;
    -webkit-overflow-scrolling: touch;
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .messages-container {
        padding: var(--space-3) var(--space-4);
    }
}

/* Date Separator - WhatsApp Style */
.date-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) 0;
    margin: var(--space-2) 0;
}

.date-separator span {
    padding: 6px 12px;
    background: rgba(31, 44, 52, 0.92);
    border-radius: var(--radius-lg);
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
    box-shadow: var(--shadow-sm);
}

/* Messages - WhatsApp Style with Tails */
.message {
    display: flex;
    flex-direction: column;
    max-width: 65%;
    margin: 1px 0;
}

@media (max-width: 768px) {
    .message {
        max-width: 85%;
    }
}

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

.message.received {
    align-self: flex-start;
    align-items: flex-start;
}

.message-bubble {
    padding: 6px 7px 8px 9px;
    border-radius: var(--radius-bubble);
    font-size: 14.2px;
    line-height: 19px;
    word-wrap: break-word;
    position: relative;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
    max-width: 100%;
}

/* Sent Messages - WhatsApp Dark Green */
.message.sent .message-bubble {
    background: var(--bubble-sent);
    color: var(--text-primary);
    border-top-right-radius: 0;
}

/* WhatsApp-style tail for sent messages */
.message.sent .message-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    right: -8px;
    width: 8px;
    height: 13px;
    background: var(--bubble-sent);
    clip-path: polygon(0 0, 0% 100%, 100% 0);
}

/* Received Messages */
.message.received .message-bubble {
    background: var(--bubble-received);
    color: var(--text-primary);
    border-top-left-radius: 0;
}

/* WhatsApp-style tail for received messages */
.message.received .message-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    width: 8px;
    height: 13px;
    background: var(--bubble-received);
    clip-path: polygon(100% 0, 100% 100%, 0 0);
}

/* Remove tail for consecutive messages */
.message+.message.sent .message-bubble::before,
.message+.message.received .message-bubble::before {
    display: none;
}

.message+.message.sent .message-bubble {
    border-top-right-radius: var(--radius-bubble);
}

.message+.message.received .message-bubble {
    border-top-left-radius: var(--radius-bubble);
}

.message-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.message-meta {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 8px;
    vertical-align: bottom;
    float: right;
    margin-top: 4px;
    position: relative;
    top: 3px;
}

.message-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
}

.message.received .message-time {
    color: var(--text-secondary);
}

/* WhatsApp Double Checkmark */
.message-status {
    display: inline-flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.5);
    margin-left: 2px;
}

.message-status.read {
    color: #53BDEB;
}

.message-status svg {
    width: 16px;
    height: 16px;
}

.message-media {
    margin-bottom: 4px;
}

.message-media img {
    max-width: 100%;
    border-radius: var(--radius-md);
    display: block;
}

/* Typing Indicator - WhatsApp Style */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--bubble-received);
    border-radius: var(--radius-bubble);
    border-top-left-radius: 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* =====================================================
   Input Container - WhatsApp Style
   ===================================================== */
.input-container {
    padding: var(--space-2) var(--space-3) calc(var(--safe-area-bottom) + var(--space-2));
    background: var(--bg-secondary);
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* Offline Banner */
.offline-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: rgba(234, 67, 53, 0.15);
    border: 1px solid rgba(234, 67, 53, 0.3);
    border-radius: var(--radius-lg);
    color: var(--accent-red);
    font-size: 13px;
    font-weight: 500;
    animation: fadeIn 0.3s ease-out;
}

.offline-banner svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Disabled Input State */
.input-wrapper.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.input-wrapper.disabled .message-input {
    cursor: not-allowed;
    background: var(--bg-tertiary);
}

.input-wrapper.disabled .send-btn {
    cursor: not-allowed;
    opacity: 0.5;
}

.media-preview {
    position: absolute;
    bottom: 100%;
    left: var(--space-3);
    margin-bottom: var(--space-2);
    display: inline-block;
    background: var(--bg-tertiary);
    padding: var(--space-2);
    border-radius: var(--radius-lg);
}

.media-preview img {
    max-height: 150px;
    border-radius: var(--radius-md);
}

.media-preview-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--accent-red);
    border: none;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.media-preview-close svg {
    width: 14px;
    height: 14px;
}

.input-wrapper {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: var(--space-2);
    background: var(--bg-tertiary);
    border-radius: 24px;
    padding: 5px 5px 5px 12px;
    min-height: 48px;
}

.input-actions {
    display: flex;
    align-items: center;
}

.input-actions .icon-btn {
    width: 36px;
    height: 36px;
}

.input-actions .icon-btn svg {
    width: 22px;
    height: 22px;
}

.input-field-container {
    flex: 1;
    display: flex;
    align-items: center;
}

.message-input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    resize: none;
    outline: none;
    max-height: 100px;
    padding: 9px 0;
    font-family: inherit;
    line-height: 20px;
}

.message-input::placeholder {
    color: var(--text-secondary);
}

.send-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    background: var(--accent-primary);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--duration-fast);
}

.send-btn:disabled {
    background: var(--bg-elevated);
    opacity: 0.5;
}

.send-btn:not(:disabled):hover {
    background: #00B894;
}

.send-btn:not(:disabled):active {
    transform: scale(0.95);
}

.send-btn svg {
    width: 20px;
    height: 20px;
}

/* =====================================================
   Empty State - WhatsApp Style
   ===================================================== */
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    text-align: center;
    position: relative;
    z-index: 1;
}

.empty-state-icon {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-full);
    background: rgba(0, 168, 132, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-5);
}

.empty-state-icon svg {
    width: 36px;
    height: 36px;
    color: var(--accent-primary);
}

.empty-state-title {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.empty-state-text {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 340px;
    line-height: 1.5;
}

/* =====================================================
   Modal - WhatsApp Style
   ===================================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--space-4);
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    background: var(--bg-tertiary);
}

.modal-title {
    font-size: 19px;
    font-weight: 500;
    color: var(--text-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.modal-close:hover {
    background: rgba(134, 150, 160, 0.1);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4) var(--space-5);
}

/* =====================================================
   Profile Card - WhatsApp Style
   ===================================================== */
.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-6) 0;
    margin-bottom: var(--space-4);
}

.profile-card .avatar-lg {
    margin-bottom: var(--space-4);
}

.profile-nickname-container {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.profile-nickname-input {
    background: transparent;
    border: none;
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    outline: none;
    max-width: 200px;
}

.profile-nickname-refresh {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: transparent;
    border: none;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.profile-nickname-refresh:hover {
    background: rgba(0, 168, 132, 0.1);
}

.profile-nickname-refresh svg {
    width: 18px;
    height: 18px;
}

.profile-id {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: monospace;
}

/* =====================================================
   Settings - WhatsApp Style
   ===================================================== */
.settings-section {
    margin-bottom: var(--space-5);
}

.settings-section-title {
    font-size: 14px;
    font-weight: 400;
    color: var(--accent-primary);
    margin-bottom: var(--space-2);
    padding-left: var(--space-4);
}

.settings-list {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.settings-item {
    display: flex;
    align-items: center;
    padding: var(--space-4);
    gap: var(--space-4);
    cursor: pointer;
    transition: background var(--duration-fast);
}

.settings-item:not(:last-child) {
    border-bottom: 1px solid var(--separator);
}

.settings-item:hover {
    background: var(--bg-elevated);
}

.settings-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

.settings-icon.purple {
    background: #A855F7;
}

.settings-icon.green {
    background: var(--accent-green);
}

.settings-icon.red {
    background: var(--accent-red);
}

.settings-icon.orange {
    background: var(--accent-orange);
}

.settings-icon.teal {
    background: var(--accent-primary);
}

.settings-label {
    flex: 1;
    font-size: 16px;
    color: var(--text-primary);
}

.settings-value {
    font-size: 14px;
    color: var(--text-secondary);
}

.settings-select {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: var(--space-2) var(--space-3);
    font-size: 14px;
    outline: none;
}

/* Toggle - WhatsApp Style */
.toggle {
    position: relative;
    width: 51px;
    height: 31px;
}

.toggle input {
    display: none;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background var(--duration-fast);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 27px;
    height: 27px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: transform var(--duration-fast);
    box-shadow: var(--shadow-sm);
}

.toggle input:checked+.toggle-slider {
    background: var(--accent-primary);
}

.toggle input:checked+.toggle-slider::before {
    transform: translateX(20px);
}

/* =====================================================
   Blocked Users - WhatsApp Style
   ===================================================== */
.blocked-users-list {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.blocked-user-item {
    display: flex;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    gap: var(--space-3);
}

.blocked-user-item:not(:last-child) {
    border-bottom: 1px solid var(--separator);
}

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

.unblock-btn {
    padding: var(--space-2) var(--space-4);
    background: transparent;
    border: 1px solid var(--accent-red);
    border-radius: var(--radius-full);
    color: var(--accent-red);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-fast);
}

.unblock-btn:hover {
    background: var(--accent-red);
    color: white;
}

/* =====================================================
   Report Modal - WhatsApp Style
   ===================================================== */
.report-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.report-option {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--duration-fast);
}

.report-option:hover {
    background: var(--bg-elevated);
}

.report-option input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--accent-primary);
}

.report-textarea {
    width: 100%;
    min-height: 80px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: var(--space-3);
    font-size: 15px;
    resize: none;
    outline: none;
    margin-bottom: var(--space-4);
    font-family: inherit;
}

.report-textarea:focus {
    border-color: var(--accent-primary);
}

.report-submit {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--accent-primary);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-fast);
}

.report-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.report-submit:not(:disabled):hover {
    background: #00B894;
}

/* =====================================================
   Toast Notifications - WhatsApp Style
   ===================================================== */
.toast-container {
    position: fixed;
    bottom: calc(var(--safe-area-bottom) + 80px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.toast {
    padding: var(--space-3) var(--space-5);
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 400;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s var(--ease-out);
}

.toast.success {
    background: var(--accent-primary);
}

.toast.error {
    background: var(--accent-red);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =====================================================
   Premium Button System - shadcn/Tailwind Inspired
   ===================================================== */

/* Base Button Reset & Common Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-weight: 500;
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    user-select: none;
    position: relative;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
}

/* Focus Ring - Accessibility */
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--bg-base), 0 0 0 4px var(--accent-primary);
}

/* Button Sizes */
.btn-sm {
    height: 32px;
    padding: 0 12px;
    font-size: 13px;
    border-radius: 6px;
}

.btn-md {
    height: 40px;
    padding: 0 16px;
    font-size: 14px;
    border-radius: 8px;
}

.btn-lg {
    height: 48px;
    padding: 0 24px;
    font-size: 15px;
    border-radius: 10px;
}

.btn-xl {
    height: 56px;
    padding: 0 32px;
    font-size: 16px;
    border-radius: 12px;
}

/* Full Width */
.btn-block {
    width: 100%;
}

/* =====================================================
   Primary Button - Main CTA
   ===================================================== */
.btn-primary {
    background: linear-gradient(135deg, #00A884 0%, #00C896 50%, #25D366 100%);
    color: white;
    border: none;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.1),
        0 4px 12px rgba(0, 168, 132, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.2s;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #00B894 0%, #00D99F 50%, #2EE370 100%);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.12),
        0 8px 24px rgba(0, 168, 132, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 168, 132, 0.2),
        inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary:disabled {
    background: linear-gradient(135deg, #3B4A54 0%, #4A5A64 100%);
    color: rgba(255, 255, 255, 0.5);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* =====================================================
   Secondary Button - Less Emphasis
   ===================================================== */
.btn-secondary {
    background: linear-gradient(135deg, #2A3942 0%, #3B4A54 100%);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #3B4A54 0%, #4D5D68 100%);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* =====================================================
   Outline Button - Subtle
   ===================================================== */
.btn-outline {
    background: transparent;
    color: var(--accent-primary);
    border: 1.5px solid var(--accent-primary);
    box-shadow: none;
}

.btn-outline:hover {
    background: rgba(0, 168, 132, 0.1);
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
    box-shadow: 0 0 20px rgba(0, 168, 132, 0.15);
}

.btn-outline:active {
    background: rgba(0, 168, 132, 0.15);
    transform: scale(0.98);
}

/* =====================================================
   Ghost Button - Minimal
   ===================================================== */
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    box-shadow: none;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-ghost:active {
    background: rgba(255, 255, 255, 0.12);
}

/* =====================================================
   Danger Button - Destructive Actions
   ===================================================== */
.btn-danger {
    background: linear-gradient(135deg, #DC2626 0%, #EA4335 50%, #EF4444 100%);
    color: white;
    border: none;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.1),
        0 4px 12px rgba(234, 67, 53, 0.25);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #EF4444 0%, #F55246 50%, #F87171 100%);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.12),
        0 8px 24px rgba(234, 67, 53, 0.35);
    transform: translateY(-1px);
}

/* =====================================================
   Icon Button - Circular
   ===================================================== */
.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid transparent;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-icon:active {
    transform: scale(0.95);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

/* =====================================================
   Button with Loading State
   ===================================================== */
.btn-loading {
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: btnSpin 0.6s linear infinite;
}

@keyframes btnSpin {
    to {
        transform: rotate(360deg);
    }
}

/* =====================================================
   Shimmer Effect for Premium Feel
   ===================================================== */
.btn-shimmer {
    position: relative;
    overflow: hidden;
}

.btn-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.15),
            transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* =====================================================
   Pill/Rounded Buttons
   ===================================================== */
.btn-pill {
    border-radius: 9999px;
}

/* =====================================================
   Button Group
   ===================================================== */
.btn-group {
    display: inline-flex;
    gap: 0;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: 8px 0 0 8px;
}

.btn-group .btn:last-child {
    border-radius: 0 8px 8px 0;
}

.btn-group .btn:not(:last-child) {
    border-right: 1px solid rgba(0, 0, 0, 0.2);
}

/* =====================================================
   Selection Buttons (Gender, Options)
   ===================================================== */
.btn-select {
    flex: 1;
    height: 48px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-select:hover {
    background: var(--bg-elevated);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.btn-select.active,
.btn-select[data-selected="true"] {
    background: linear-gradient(135deg, #00A884 0%, #00C896 100%);
    border-color: transparent;
    color: white;
    box-shadow:
        0 4px 12px rgba(0, 168, 132, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-select.active:hover,
.btn-select[data-selected="true"]:hover {
    background: linear-gradient(135deg, #00B894 0%, #00D99F 100%);
}

/* =====================================================
   Filter Chip Button Enhancements
   ===================================================== */
.filter-chip {
    height: 36px;
    padding: 0 16px;
    background: var(--bg-tertiary);
    border: 1.5px solid var(--border-color);
    border-radius: 18px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.filter-chip:hover {
    background: var(--bg-elevated);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.filter-chip.active {
    background: linear-gradient(135deg, #00A884 0%, #25D366 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 168, 132, 0.3);
}

.filter-chip.active:hover {
    box-shadow: 0 6px 16px rgba(0, 168, 132, 0.4);
}

/* =====================================================
   Tab Button Enhancements
   ===================================================== */
.tab {
    position: relative;
    height: 44px;
    padding: 0 16px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 3px;
    background: linear-gradient(90deg, #00A884, #25D366);
    border-radius: 3px 3px 0 0;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab.active {
    color: var(--accent-primary);
}

.tab.active::after {
    transform: translateX(-50%) scaleX(1);
}

/* =====================================================
   Send Button Enhancement
   ===================================================== */
.send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00A884 0%, #25D366 100%);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 2px 8px rgba(0, 168, 132, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.send-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #00B894 0%, #2EE370 100%);
    box-shadow:
        0 4px 16px rgba(0, 168, 132, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.send-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.send-btn:disabled {
    background: var(--bg-elevated);
    color: var(--text-tertiary);
    box-shadow: none;
    cursor: not-allowed;
}

.send-btn svg {
    width: 20px;
    height: 20px;
}

/* =====================================================
   Icon Button Enhancements
   ===================================================== */
.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.icon-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    transform: scale(0);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-btn:hover {
    color: var(--text-primary);
}

.icon-btn:hover::before {
    transform: scale(1);
}

.icon-btn:active {
    transform: scale(0.92);
}

.icon-btn:active::before {
    background: rgba(255, 255, 255, 0.12);
}

.icon-btn svg {
    width: 22px;
    height: 22px;
    position: relative;
    z-index: 1;
}

/* =====================================================
   Report Submit Button
   ===================================================== */
.report-submit {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, #00A884 0%, #25D366 100%);
    border: none;
    border-radius: 24px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 168, 132, 0.25);
}

.report-submit:hover:not(:disabled) {
    box-shadow: 0 8px 24px rgba(0, 168, 132, 0.35);
    transform: translateY(-2px);
}

.report-submit:active:not(:disabled) {
    transform: translateY(0);
}

.report-submit:disabled {
    background: var(--bg-elevated);
    color: var(--text-tertiary);
    box-shadow: none;
    cursor: not-allowed;
}

/* =====================================================
   Unblock Button Enhancement
   ===================================================== */
.unblock-btn {
    height: 32px;
    padding: 0 16px;
    background: transparent;
    border: 1.5px solid var(--accent-red);
    border-radius: 16px;
    color: var(--accent-red);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.unblock-btn:hover {
    background: var(--accent-red);
    color: white;
    box-shadow: 0 4px 12px rgba(234, 67, 53, 0.3);
}

/* =====================================================
   Onboarding Modal - Premium Styling
   ===================================================== */
.onboarding-modal {
    max-width: 380px;
    border-radius: 20px;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

.onboarding-subtitle {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 14px;
    line-height: 1.5;
}

.onboarding-avatar-container {
    margin-bottom: 28px;
    display: flex;
    justify-content: center;
}

.onboarding-avatar {
    position: relative;
    box-shadow:
        0 0 0 4px var(--bg-primary),
        0 0 0 6px rgba(0, 168, 132, 0.3),
        0 8px 24px rgba(0, 0, 0, 0.3);
    animation: avatarPulse 2s ease-in-out infinite;
}

@keyframes avatarPulse {

    0%,
    100% {
        box-shadow: 0 0 0 4px var(--bg-primary), 0 0 0 6px rgba(0, 168, 132, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
    }

    50% {
        box-shadow: 0 0 0 4px var(--bg-primary), 0 0 0 10px rgba(0, 168, 132, 0.15), 0 8px 24px rgba(0, 0, 0, 0.3);
    }
}

.onboarding-field {
    margin-bottom: 20px;
    text-align: left;
}

.onboarding-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.onboarding-input-group {
    display: flex;
    gap: 10px;
}

.onboarding-input {
    flex: 1;
    height: 48px;
    background: var(--bg-tertiary);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    padding: 0 16px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.onboarding-input::placeholder {
    color: var(--text-muted);
}

.onboarding-input:focus {
    border-color: var(--accent-primary);
    box-shadow:
        0 0 0 3px rgba(0, 168, 132, 0.15),
        inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.onboarding-input:hover:not(:focus) {
    border-color: rgba(255, 255, 255, 0.2);
}

.onboarding-refresh-btn {
    width: 48px;
    height: 48px;
    padding: 0;
    flex-shrink: 0;
    border-radius: 12px;
}

.onboarding-refresh-btn svg {
    width: 20px;
    height: 20px;
}

.onboarding-gender-group {
    display: flex;
    gap: 10px;
}

.onboarding-start-btn {
    margin-top: 8px;
    border-radius: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.onboarding-privacy-note {
    color: var(--text-tertiary);
    margin-top: 20px;
    font-size: 12px;
    line-height: 1.5;
}

/* =====================================================
   Online Status Badge - Green Dot on Avatars
   ===================================================== */
.status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
    background: var(--text-tertiary);
    transition: all 0.3s ease;
}

.status-indicator.online {
    background: #25D366;
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.4);
    animation: statusPulse 2s infinite;
}

.status-indicator.idle {
    background: #F5A623;
}

.status-indicator.offline {
    background: var(--text-tertiary);
}

@keyframes statusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(37, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* =====================================================
   Typing Indicator - Animated Dots
   ===================================================== */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: var(--bubble-received);
    border-radius: 18px 18px 18px 4px;
    width: fit-content;
}

.typing-indicator span {
    display: block;
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* =====================================================
   E2E Encryption Badge
   ===================================================== */
.e2e-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(37, 211, 102, 0.1);
    border: 1px solid rgba(37, 211, 102, 0.2);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    color: var(--accent-secondary);
    transition: all 0.2s ease;
}

.e2e-badge svg {
    width: 14px;
    height: 14px;
}

.e2e-badge:hover {
    background: rgba(37, 211, 102, 0.15);
    transform: scale(1.02);
}

/* =====================================================
   Theme Toggle Button
   ===================================================== */
.theme-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #FDB813 0%, #F5A623 100%);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .theme-toggle::before {
    transform: translateX(20px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.theme-toggle-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    transition: all 0.3s ease;
}

.theme-toggle-icon.sun {
    left: 4px;
    opacity: 1;
}

.theme-toggle-icon.moon {
    right: 4px;
    opacity: 0.5;
}

[data-theme="light"] .theme-toggle-icon.sun {
    opacity: 0.5;
}

[data-theme="light"] .theme-toggle-icon.moon {
    opacity: 1;
}

/* =====================================================
   Smooth Scroll Animation
   ===================================================== */
.messages-container {
    scroll-behavior: smooth;
}

/* Scroll to bottom button */
.scroll-bottom-btn {
    position: absolute;
    bottom: 80px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all 0.2s ease;
    z-index: 10;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.scroll-bottom-btn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.scroll-bottom-btn:hover {
    background: var(--accent-primary);
    color: white;
    transform: scale(1.1);
}

.scroll-bottom-btn svg {
    width: 20px;
    height: 20px;
}

.scroll-bottom-btn .unread-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    background: var(--accent-primary);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

/* =====================================================
   Chat Wallpapers
   ===================================================== */
.chat-area {
    background-color: var(--wa-chat-bg);
    background-image: var(--chat-wallpaper);
    background-repeat: repeat;
}

/* Wallpaper options */
[data-wallpaper="doodles"] {
    --chat-wallpaper: url("data:image/svg+xml,%3Csvg width='52' height='26' viewBox='0 0 52 26' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M10 10c0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6h2c0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4v2c-3.314 0-6-2.686-6-6 0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6zm25.464-1.95l8.486 8.486-1.414 1.414-8.486-8.486 1.414-1.414z' /%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

[data-wallpaper="gradient"] {
    --chat-wallpaper: none;
    background: linear-gradient(180deg, var(--wa-chat-bg) 0%, rgba(0, 0, 0, 0.1) 100%);
}

[data-wallpaper="bubbles"] {
    --chat-wallpaper: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='25' cy='25' r='20'/%3E%3Ccircle cx='75' cy='75' r='20'/%3E%3C/g%3E%3C/svg%3E");
}



/* =====================================================
   Last Seen Status
   ===================================================== */
.last-seen {
    font-size: 12px;
    color: var(--text-tertiary);
    font-style: italic;
}

.last-seen-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--text-tertiary);
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.last-seen.online .last-seen-dot {
    background: #25D366;
    box-shadow: 0 0 6px rgba(37, 211, 102, 0.5);
}

/* =====================================================
   Theme Toggle in Settings
   ===================================================== */
.settings-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    margin-bottom: 16px;
}

.settings-theme-toggle label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-primary);
}

.settings-theme-toggle .icon {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

/* Transition for theme changes */
html {
    transition: background-color 0.3s ease, color 0.3s ease;
}

html * {
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}