/* ============================================================ */
/* ===== PREMIUM QUICKIE - PURPLE DREAM ===== */
/* ============================================================ */

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #faf5ff;
    height: 100vh;
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.4s ease;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
}

.app-container {
    width: 100%;
    max-width: 1200px;
    height: 100vh;
    height: 100dvh;
    max-height: 900px;
    background: white;
    box-shadow:
        0 0 60px rgba(102, 126, 234, 0.15),
        0 25px 50px -12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: background 0.4s ease;
}

/* ============================================================ */
/* ===== LUCIDE ICON BASE STYLING ===== */
/* ============================================================ */
.lucide {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    transition: all 0.2s ease;
    vertical-align: middle;
    flex-shrink: 0;
}

button .lucide {
    pointer-events: none;
}

.btn .lucide,
.btn-small .lucide,
.send-btn .lucide,
.leave-btn .lucide,
.header-btn .lucide,
.icon-btn .lucide {
    margin-right: 0.35rem;
}

.header-btn .lucide,
.icon-btn .lucide {
    margin-right: 0;
}

/* ============================================================ */
/* ===== LOGIN SCREEN ===== */
/* ============================================================ */
.login-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    gap: 1rem;
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 50%, #ede9fe 100%);
    overflow-y: auto;
    transition: background 0.4s ease;
    position: relative;
}

.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    z-index: 0;
    pointer-events: none;
    animation: floatBlob 20s infinite ease-in-out;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.blob-2 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    bottom: -100px;
    right: -100px;
    animation-delay: 7s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    top: 50%;
    right: 10%;
    animation-delay: 14s;
}

@keyframes floatBlob {

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

    33% {
        transform: translate(30px, -30px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.95);
    }
}

.login-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.dark-mode-toggle {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0.6rem;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6d28d9;
}

.dark-mode-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    background: rgba(255, 255, 255, 0.9);
    color: #764ba2;
}

.dark-mode-toggle:active {
    transform: scale(0.95) rotate(15deg);
}

.dark-mode-toggle .lucide {
    width: 20px;
    height: 20px;
}

.login-screen .logo {
    font-size: 3.8rem;
    font-weight: 800;
    letter-spacing: -2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
    line-height: 1;
    padding-bottom: 0.2rem;
}

.login-screen .logo span {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.login-screen .subtitle {
    color: #6b7280;
    text-align: center;
    font-size: 0.9rem;
    margin-top: -0.3rem;
    font-weight: 400;
}

.login-section {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow:
        0 8px 32px rgba(102, 126, 234, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.glass-card:hover {
    box-shadow:
        0 12px 40px rgba(102, 126, 234, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.pin-section {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.input-group {
    margin-bottom: 0.4rem;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.input-group label .lucide {
    width: 16px;
    height: 16px;
    color: #764ba2;
}

.input-group input {
    width: 100%;
    padding: 0.9rem 1.1rem;
    border: 2px solid rgba(139, 92, 246, 0.15);
    border-radius: 14px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a2e;
}

.input-group input:focus {
    border-color: #764ba2;
    box-shadow: 0 0 0 4px rgba(118, 75, 162, 0.12);
    background: white;
}

/* ===== PASSWORD STRENGTH METER ===== */
.password-strength {
    margin-top: 0.5rem;
    display: none;
    animation: fadeInUp 0.3s ease;
}

.password-strength.show {
    display: block;
}

.password-strength-bar-track {
    height: 5px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.35rem;
}

.password-strength-bar {
    height: 100%;
    width: 0%;
    background: #ef4444;
    border-radius: 3px;
    transition: width 0.3s ease, background 0.3s ease;
}

.password-strength-text {
    font-size: 0.72rem;
    font-weight: 600;
    color: #ef4444;
    transition: color 0.3s ease;
}

.pin-actions {
    display: flex;
    gap: 0.6rem;
}

.pin-actions .btn {
    flex: 1;
}

.pin-display-area {
    margin-top: 0.8rem;
    text-align: center;
    padding: 1.2rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08));
    border-radius: 14px;
    border: 2px dashed rgba(118, 75, 162, 0.4);
    animation: fadeInUp 0.5s ease;
}

.pin-display-area.hidden {
    display: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.pin-label {
    display: block;
    font-size: 0.7rem;
    color: #7c3aed;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.3rem;
}

.pin-display {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Inter', monospace;
    letter-spacing: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
    padding: 0.5rem;
    margin: 0.3rem 0;
    line-height: 1.2;
}

.pin-display-area .btn-small {
    margin: 0.2rem;
}

.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #8b5cf6;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.divider hr {
    flex: 1;
    border: none;
    border-top: 1.5px solid rgba(139, 92, 246, 0.2);
}

.login-form label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.login-form label .lucide {
    width: 16px;
    height: 16px;
    color: #764ba2;
}

.login-row {
    display: flex;
    gap: 0.5rem;
}

.login-row .pin-input {
    flex: 1;
    padding: 0.9rem 1.1rem;
    border: 2px solid rgba(139, 92, 246, 0.15);
    border-radius: 14px;
    font-size: 1.15rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 5px;
    outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a2e;
    font-family: 'Inter', monospace;
    min-width: 0;
}

.login-row .pin-input:focus {
    border-color: #764ba2;
    box-shadow: 0 0 0 4px rgba(118, 75, 162, 0.12);
    background: white;
}

.login-row .pin-input::placeholder {
    letter-spacing: 0;
    font-weight: 400;
    font-size: 0.85rem;
    color: #a78bfa;
}

.login-row .btn {
    flex-shrink: 0;
}

/* ===== FORGOT PASSWORD LINK ===== */
.forgot-password-link {
    display: block;
    text-align: center;
    margin-top: 0.8rem;
    font-size: 0.82rem;
    color: #764ba2;
    cursor: pointer;
    font-weight: 600;
    background: none;
    border: none;
    padding: 0.3rem;
    width: 100%;
    font-family: 'Inter', sans-serif;
    transition: color 0.2s;
}

.forgot-password-link:hover {
    color: #6d28d9;
    text-decoration: underline;
}

/* ============================================================ */
/* ===== BUTTONS ===== */
/* ============================================================ */
.btn {
    padding: 0.85rem 1.5rem;
    border: none;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.55);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.55);
    transform: translateY(-2px);
}

.btn-success:active {
    transform: translateY(0) scale(0.98);
}

.btn-secondary {
    background: rgba(139, 92, 246, 0.1);
    color: #6d28d9;
    border: 2px solid rgba(139, 92, 246, 0.2);
}

.btn-secondary:hover {
    background: rgba(139, 92, 246, 0.18);
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
}

.btn-secondary:active {
    transform: translateY(0) scale(0.98);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.55);
    transform: translateY(-2px);
}

.btn-small {
    padding: 0.45rem 1rem;
    border: none;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
}

.btn-small .lucide {
    width: 13px;
    height: 13px;
}

.btn-small:hover {
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.45);
    transform: translateY(-1px);
}

.btn-small:active {
    transform: scale(0.97);
}

.btn-block {
    width: 100%;
    text-align: center;
}

.hidden {
    display: none !important;
}

.error-msg {
    color: #dc2626;
    font-size: 0.85rem;
    min-height: 1.2rem;
    text-align: center;
    max-width: 440px;
    font-weight: 600;
    padding: 0.5rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.error-msg:not(:empty) {
    background: rgba(220, 38, 38, 0.08);
    animation: fadeInUp 0.3s ease;
}

/* ============================================================ */
/* ===== CHAT MENU ===== */
/* ============================================================ */
.chat-menu {
    flex: 1;
    display: none;
    flex-direction: row;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.chat-menu.active {
    display: flex;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ============================================================ */
/* ===== SIDEBAR ===== */
/* ============================================================ */
.sidebar {
    width: 320px;
    min-width: 320px;
    background: linear-gradient(180deg, #ffffff 0%, #faf5ff 100%);
    border-right: 1px solid rgba(139, 92, 246, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.3s ease, background 0.4s ease;
    z-index: 20;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.sidebar-logo {
    font-weight: 800;
    font-size: 1.3rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.sidebar-logo span {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #8b5cf6;
    display: none;
    padding: 0.4rem;
    border-radius: 8px;
    transition: all 0.2s;
    align-items: center;
    justify-content: center;
}

.sidebar-close:hover {
    color: #6d28d9;
    background: rgba(139, 92, 246, 0.1);
}

.user-profile {
    padding: 0.9rem 1.2rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(240, 147, 251, 0.05));
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    flex-shrink: 0;
}

.user-pin-display {
    font-size: 0.85rem;
    font-weight: 700;
    color: #6d28d9;
    font-family: 'Inter', monospace;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0.3rem 0.5rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.user-pin-display .lucide {
    width: 14px;
    height: 14px;
}

.user-pin-display:hover {
    background: rgba(139, 92, 246, 0.1);
}

.user-pin-display:active {
    transform: scale(0.98);
}

.user-pin-display span {
    color: #1a1a2e;
}

.user-phone-display {
    font-size: 0.72rem;
    color: #8b5cf6;
    margin-top: 0.15rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.user-phone-display .lucide {
    width: 12px;
    height: 12px;
}

.user-name-edit {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.user-name-edit input {
    flex: 1;
    min-width: 0;
    padding: 0.4rem 0.7rem;
    border: 1.5px solid rgba(139, 92, 246, 0.15);
    border-radius: 10px;
    font-size: 0.82rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.8);
}

.user-name-edit input:focus {
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.1);
    background: white;
}

.user-name-edit .btn-small {
    flex-shrink: 0;
    white-space: nowrap;
}

.pending-requests {
    padding: 0.6rem 1.2rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    flex-shrink: 0;
    max-height: 200px;
    overflow-y: auto;
}

.section-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: #8b5cf6;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.section-title .lucide {
    width: 12px;
    height: 12px;
}

.request-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(139, 92, 246, 0.08);
    animation: slideInRight 0.4s ease;
    flex-wrap: wrap;
    gap: 0.3rem;
}

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

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

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

.request-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: #1a1a2e;
}

.request-pin {
    font-size: 0.65rem;
    color: #8b5cf6;
    font-family: 'Inter', monospace;
    font-weight: 600;
}

.request-time {
    font-size: 0.6rem;
    color: #a78bfa;
    margin-top: 0.1rem;
}

.request-actions {
    display: flex;
    gap: 0.3rem;
    flex-shrink: 0;
}

.request-actions .btn-small {
    font-size: 0.65rem;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
}

.request-actions .accept-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.request-actions .accept-btn:hover {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.45);
}

.request-actions .decline-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.request-actions .decline-btn:hover {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.45);
}

.no-requests {
    font-size: 0.72rem;
    color: #a78bfa;
    padding: 0.3rem 0;
    font-style: italic;
}

.chat-list-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.chat-list {
    padding: 0.5rem 0;
}

.chat-list .section-title {
    padding: 0 1.2rem;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid rgba(139, 92, 246, 0.06);
    position: relative;
    animation: fadeIn 0.3s ease;
}

.chat-item:hover {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.08), rgba(240, 147, 251, 0.05));
    transform: translateX(3px);
}

.chat-item.active {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.15), rgba(240, 147, 251, 0.1));
    border-left: 3px solid #764ba2;
}

.chat-item-avatar-wrap {
    position: relative;
    flex-shrink: 0;
    margin-right: 0.75rem;
}

.chat-item-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.chat-item-status {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    background: #a78bfa;
    transition: background 0.3s ease;
}

.chat-item-status.online {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
    animation: pulseDot 2s infinite;
}

.chat-item-status.offline {
    background: #9ca3af;
}

@keyframes pulseDot {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    50% {
        box-shadow: 0 0 0 5px rgba(16, 185, 129, 0);
    }
}

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

.chat-item-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: #1a1a2e;
}

.chat-item-name .chat-pin {
    font-size: 0.6rem;
    color: #8b5cf6;
    font-weight: 500;
    font-family: 'Inter', monospace;
}

.chat-item-preview {
    font-size: 0.73rem;
    color: #8b5cf6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.1rem;
}

.chat-item-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.chat-item-time {
    font-size: 0.6rem;
    color: #a78bfa;
    font-weight: 500;
}

.chat-delete-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #ef4444;
    padding: 0.3rem;
    border-radius: 6px;
    transition: all 0.2s;
    opacity: 0.3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-delete-btn .lucide {
    width: 15px;
    height: 15px;
}

.chat-item:hover .chat-delete-btn {
    opacity: 0.7;
}

.chat-delete-btn:hover {
    opacity: 1 !important;
    background: rgba(239, 68, 68, 0.1);
    transform: scale(1.1);
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.2rem;
    text-align: center;
    gap: 0.8rem;
    animation: fadeIn 0.4s ease;
}

.empty-state-emoji {
    font-size: 3rem;
    animation: wave 2s ease-in-out infinite;
    transform-origin: 70% 70%;
}

@keyframes wave {

    0%,
    100% {
        transform: rotate(0deg);
    }

    15% {
        transform: rotate(20deg);
    }

    30% {
        transform: rotate(-10deg);
    }

    45% {
        transform: rotate(15deg);
    }

    60% {
        transform: rotate(-5deg);
    }
}

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a2e;
}

.empty-state-text {
    font-size: 0.82rem;
    color: #8b5cf6;
    line-height: 1.5;
    max-width: 220px;
}

.empty-state-pin-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(240, 147, 251, 0.1));
    border: 2px dashed rgba(139, 92, 246, 0.3);
    border-radius: 14px;
    padding: 0.9rem 1.2rem;
    margin-top: 0.3rem;
    width: 100%;
    max-width: 240px;
}

.empty-state-pin-label {
    font-size: 0.65rem;
    color: #7c3aed;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.3rem;
}

.empty-state-pin-display {
    font-size: 1.4rem;
    font-weight: 800;
    font-family: 'Inter', monospace;
    letter-spacing: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
    margin-bottom: 0.5rem;
}

.empty-state-pin-card .btn-small {
    font-size: 0.7rem;
    padding: 0.35rem 0.9rem;
}

.sidebar-footer {
    padding: 0;
    border-top: 1px solid rgba(139, 92, 246, 0.1);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.add-friend-section {
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    overflow: hidden;
    transition: background 0.3s ease;
}

.add-friend-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: #6d28d9;
    text-align: left;
}

.add-friend-toggle:hover {
    background: rgba(139, 92, 246, 0.08);
}

.add-friend-toggle .toggle-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.add-friend-toggle .toggle-label .lucide {
    width: 16px;
    height: 16px;
}

.add-friend-toggle .toggle-icon {
    font-size: 1.1rem;
    font-weight: 700;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    line-height: 1;
}

.add-friend-section.expanded .add-friend-toggle .toggle-icon {
    transform: rotate(45deg);
}

.add-friend-hint {
    padding: 0 1.2rem 0.6rem;
    font-size: 0.7rem;
    color: #8b5cf6;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.add-friend-hint .lucide {
    width: 12px;
    height: 12px;
}

.add-friend-hint span {
    font-family: 'Inter', monospace;
    font-weight: 700;
    color: #6d28d9;
    letter-spacing: 1px;
}

.add-friend-form-inline {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        padding 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.25s ease;
    padding: 0 1.2rem;
    opacity: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.add-friend-section.expanded .add-friend-form-inline {
    max-height: 220px;
    padding: 0 1.2rem 1rem;
    opacity: 1;
}

.add-friend-form-inline .pin-input {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 2px solid rgba(139, 92, 246, 0.15);
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: 'Inter', monospace;
    text-align: center;
    letter-spacing: 4px;
    font-weight: 700;
    outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a2e;
}

.add-friend-form-inline .pin-input:focus {
    border-color: #764ba2;
    box-shadow: 0 0 0 4px rgba(118, 75, 162, 0.12);
    background: white;
}

.add-friend-form-inline .pin-input::placeholder {
    letter-spacing: 0;
    font-weight: 400;
    font-size: 0.82rem;
    color: #a78bfa;
}

.add-friend-form-inline .name-input {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 2px solid rgba(139, 92, 246, 0.15);
    border-radius: 12px;
    font-size: 0.92rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a2e;
}

.add-friend-form-inline .name-input:focus {
    border-color: #764ba2;
    box-shadow: 0 0 0 4px rgba(118, 75, 162, 0.12);
    background: white;
}

.add-friend-form-inline .name-input::placeholder {
    color: #a78bfa;
}

.add-friend-form-inline .btn-block {
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: 0.88rem;
    border-radius: 12px;
    margin-top: 0.2rem;
}

.sidebar-footer>#logoutBtn {
    margin: 0.7rem 1.2rem;
    width: calc(100% - 2.4rem);
    padding: 0.6rem;
    font-size: 0.82rem;
    border-radius: 12px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 35, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 15;
}

.sidebar-overlay.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    color: #6d28d9;
    margin-right: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: rgba(139, 92, 246, 0.1);
}

/* ============================================================ */
/* ===== MAIN CHAT ===== */
/* ============================================================ */
.main-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: linear-gradient(180deg, #faf5ff 0%, #ffffff 100%);
    transition: background 0.4s ease;
    position: relative;
    min-width: 0;
}

.chat-header {
    padding: 0.7rem 1.5rem;
    padding-top: calc(0.7rem + env(safe-area-inset-top));
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(139, 92, 246, 0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    transition: background 0.4s ease, border-color 0.4s ease;
    z-index: 5;
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.06);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    min-width: 0;
}

.partner-name {
    font-weight: 700;
    font-size: 1rem;
    color: #1a1a2e;
}

.partner-pin {
    font-size: 0.65rem;
    color: #8b5cf6;
    font-family: 'Inter', monospace;
    background: rgba(139, 92, 246, 0.1);
    padding: 0.15rem 0.6rem;
    border-radius: 6px;
    font-weight: 600;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    transition: all 0.3s ease;
}

.status-dot.online {
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
}

.status-dot.offline {
    background: #a78bfa;
}

.status-text {
    font-size: 0.65rem;
    color: #8b5cf6;
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.header-btn {
    background: rgba(139, 92, 246, 0.08);
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 10px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}

.header-btn:hover {
    background: rgba(139, 92, 246, 0.18);
    transform: translateY(-1px);
    color: #764ba2;
}

.header-btn:hover .lucide {
    stroke-width: 2.3;
}

.badge {
    font-size: 0.65rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(240, 147, 251, 0.15));
    padding: 0.25rem 0.8rem;
    border-radius: 20px;
    color: #6d28d9;
    font-weight: 700;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.leave-btn {
    background: rgba(239, 68, 68, 0.08);
    border: none;
    color: #dc2626;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 10px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.leave-btn .lucide {
    width: 14px;
    height: 14px;
}

.leave-btn:hover {
    background: rgba(239, 68, 68, 0.18);
    transform: translateY(-1px);
}

.search-bar {
    display: none;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    flex-shrink: 0;
    position: relative;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

.search-bar.show {
    display: block;
}

.search-bar input {
    width: 100%;
    padding: 0.6rem 2.5rem 0.6rem 1rem;
    border: 2px solid rgba(139, 92, 246, 0.15);
    border-radius: 20px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.2s;
}

.search-bar input:focus {
    border-color: #764ba2;
    box-shadow: 0 0 0 4px rgba(118, 75, 162, 0.1);
    background: white;
}

.search-close {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    color: #8b5cf6;
    padding: 0.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.search-close:hover {
    background: rgba(139, 92, 246, 0.1);
}

.search-results {
    max-height: 150px;
    overflow-y: auto;
    margin-top: 0.4rem;
    padding: 0.3rem;
    border-radius: 12px;
    background: rgba(250, 245, 255, 0.95);
    display: none;
}

.search-results.show {
    display: block;
}

.search-result-item {
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.08);
    transition: background 0.15s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(139, 92, 246, 0.1);
}

.search-result-item .highlight {
    background: rgba(240, 147, 251, 0.4);
    padding: 0 0.15rem;
    border-radius: 3px;
    font-weight: 700;
}

.search-result-item .result-sender {
    font-weight: 700;
    font-size: 0.7rem;
    color: #8b5cf6;
}

.search-no-results {
    padding: 0.6rem;
    text-align: center;
    color: #a78bfa;
    font-size: 0.85rem;
}

/* ===== MESSAGES ===== */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-height: 0;
    max-height: 100%;
    scroll-behavior: smooth;
}

.message-wrapper {
    display: flex;
    flex-direction: column;
    animation: messageSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.98);
    }

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

.message {
    max-width: 80%;
    padding: 0.7rem 1rem;
    border-radius: 18px;
    font-size: 0.93rem;
    line-height: 1.45;
    word-wrap: break-word;
    position: relative;
    font-weight: 400;
}

.message.me {
    align-self: flex-end;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.message.other {
    align-self: flex-start;
    background: white;
    color: #1a1a2e;
    border-bottom-left-radius: 6px;
    box-shadow:
        0 2px 8px rgba(102, 126, 234, 0.08),
        0 0 0 1px rgba(139, 92, 246, 0.08);
}

.message.system {
    align-self: center;
    background: rgba(139, 92, 246, 0.08);
    color: #8b5cf6;
    font-size: 0.75rem;
    font-weight: 600;
    max-width: 100%;
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
}

.message.deleted {
    opacity: 0.5;
    font-style: italic;
}

/* ===== MESSAGE META (timestamp + ticks) ===== */
.message-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.3rem;
    margin-top: 0.2rem;
}

.timestamp {
    font-size: 0.58rem;
    opacity: 0.65;
    display: block;
    text-align: right;
    font-weight: 500;
}

.message.me .timestamp {
    color: rgba(255, 255, 255, 0.85);
}

.message.other .timestamp {
    color: #8b5cf6;
}

.message.system .timestamp {
    display: none;
}

/* ===== TICK ICONS ===== */
.tick-container {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.tick {
    display: inline-flex;
    align-items: center;
    transition: color 0.2s;
}

.tick .lucide {
    width: 14px;
    height: 14px;
    stroke-width: 2.5;
    margin: 0;
}

.message.me .tick {
    color: rgba(255, 255, 255, 0.85);
}

.message.me .tick-delivered {
    color: rgba(255, 255, 255, 0.95);
}

.message.me .tick-seen {
    color: #7dd3fc;
    /* light blue */
}

/* ===== REPLY QUOTE BLOCK (in bubble) ===== */
.reply-quote {
    background: rgba(0, 0, 0, 0.06);
    border-left: 3px solid rgba(139, 92, 246, 0.6);
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    margin-bottom: 0.4rem;
    cursor: pointer;
    transition: background 0.2s;
    max-width: 100%;
    overflow: hidden;
}

.message.me .reply-quote {
    background: rgba(255, 255, 255, 0.15);
    border-left-color: rgba(255, 255, 255, 0.8);
}

.reply-quote:hover {
    background: rgba(0, 0, 0, 0.1);
}

.message.me .reply-quote:hover {
    background: rgba(255, 255, 255, 0.25);
}

.reply-quote-name {
    font-size: 0.68rem;
    font-weight: 700;
    color: #764ba2;
    margin-bottom: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message.me .reply-quote-name {
    color: rgba(255, 255, 255, 0.95);
}

.reply-quote-text {
    font-size: 0.78rem;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== REPLY PREVIEW BAR (above input) ===== */
.reply-preview-bar {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    background: rgba(139, 92, 246, 0.06);
    border-left: 3px solid #764ba2;
    border-radius: 10px 10px 0 0;
    margin-bottom: 0.4rem;
    animation: slideDown 0.2s ease;
}

.reply-preview-bar.show {
    display: flex;
}

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

.reply-preview-name {
    font-size: 0.72rem;
    font-weight: 700;
    color: #764ba2;
    margin-bottom: 0.1rem;
}

.reply-preview-text {
    font-size: 0.78rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reply-preview-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #8b5cf6;
    padding: 0.3rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reply-preview-close:hover {
    background: rgba(139, 92, 246, 0.15);
}

/* ===== MESSAGE CONTEXT MENU ===== */
.message-context-menu {
    display: none;
    position: fixed;
    z-index: 999;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(139, 92, 246, 0.1);
    padding: 0.4rem;
    min-width: 180px;
    animation: popUp 0.15s ease;
}

.message-context-menu.show {
    display: block;
}

@keyframes popUp {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

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

.ctx-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.9rem;
    background: none;
    border: none;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a1a2e;
    cursor: pointer;
    transition: background 0.15s;
    text-align: left;
}

.ctx-btn:hover {
    background: rgba(139, 92, 246, 0.1);
}

.ctx-btn .lucide {
    width: 16px;
    height: 16px;
    color: #764ba2;
    margin: 0;
}

.ctx-btn.ctx-danger {
    color: #dc2626;
}

.ctx-btn.ctx-danger .lucide {
    color: #dc2626;
}

.ctx-btn.ctx-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.ctx-divider {
    height: 1px;
    background: rgba(139, 92, 246, 0.1);
    margin: 0.3rem 0.5rem;
}

/* ===== TYPING INDICATOR ===== */
.typing-indicator {
    padding: 0.4rem 1.5rem;
    min-height: 1.6rem;
    display: none;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.typing-indicator.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    animation: typingBounce 1.4s infinite ease-in-out;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

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

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

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

@keyframes typingBounce {

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

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

.quick-replies {
    display: none;
    padding: 0.4rem 1rem;
    gap: 0.4rem;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(139, 92, 246, 0.1);
    flex-shrink: 0;
}

.quick-replies.show {
    display: flex;
}

.quick-reply {
    background: rgba(139, 92, 246, 0.08);
    border: 1.5px solid rgba(139, 92, 246, 0.15);
    border-radius: 20px;
    padding: 0.3rem 0.9rem;
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    color: #6d28d9;
}

.quick-reply:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.quick-reply:active {
    transform: scale(0.95);
}

.chat-input-area {
    padding: 0.5rem 1rem 0.8rem;
    padding-bottom: calc(0.8rem + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(139, 92, 246, 0.1);
    flex-shrink: 0;
}

.input-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.input-row textarea {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 2px solid rgba(139, 92, 246, 0.15);
    border-radius: 14px;
    font-size: 0.93rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    background: rgba(255, 255, 255, 0.85);
    color: #1a1a2e;
    line-height: 1.4;
    resize: none;
    overflow-y: auto;
    min-height: 42px;
    max-height: 120px;
    transition: all 0.2s;
}

.input-row textarea:focus {
    border-color: #764ba2;
    box-shadow: 0 0 0 4px rgba(118, 75, 162, 0.1);
    background: white;
}

.input-row textarea::placeholder {
    color: #a78bfa;
}

.send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 0.6rem 1.4rem;
    font-weight: 700;
    font-size: 0.88rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    height: 42px;
    align-self: flex-end;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.send-btn .lucide {
    width: 15px;
    height: 15px;
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);
}

.send-btn:active {
    transform: translateY(0) scale(0.96);
}

.toolbar-row {
    display: flex;
    gap: 0.15rem;
    padding: 0.35rem 0 0;
    align-items: center;
}

.toolbar-row .icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.45rem;
    border-radius: 10px;
    color: #6b7280;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.toolbar-row .icon-btn .lucide {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.toolbar-row .icon-btn:hover {
    background: rgba(139, 92, 246, 0.12);
    color: #764ba2;
    transform: translateY(-2px);
}

.toolbar-row .icon-btn:hover .lucide {
    stroke-width: 2.4;
}

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

.toolbar-row .icon-btn.recording {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
    animation: recordPulse 1s infinite;
}

@keyframes recordPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

/* ===== MODALS ===== */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

.image-modal.show {
    display: flex;
}

.modal-image {
    max-width: 90%;
    max-height: 80%;
    border-radius: 16px;
    object-fit: contain;
    box-shadow: 0 25px 60px rgba(102, 126, 234, 0.4);
    animation: zoomIn 0.3s ease;
}

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

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

.close-modal {
    position: absolute;
    top: 1rem;
    right: 2rem;
    color: white;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.close-modal:hover {
    color: #f093fb;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.download-btn {
    margin-top: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 0.7rem 1.8rem;
    font-weight: 700;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.download-btn .lucide {
    width: 16px;
    height: 16px;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.55);
}

.voice-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 35, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.voice-modal.show {
    display: flex;
}

.voice-modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    padding: 2rem;
    text-align: center;
    max-width: 350px;
    width: 90%;
    box-shadow: 0 25px 60px rgba(102, 126, 234, 0.3);
    animation: zoomIn 0.3s ease;
}

.voice-modal-content h3 {
    margin-bottom: 0.5rem;
    color: #1a1a2e;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.voice-modal-content h3 .lucide {
    width: 20px;
    height: 20px;
    color: #764ba2;
}

.voice-wave {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    height: 60px;
    margin: 0.8rem 0;
}

.voice-wave span {
    width: 5px;
    background: linear-gradient(180deg, #667eea, #764ba2);
    border-radius: 3px;
    animation: wave 0.6s ease-in-out infinite alternate;
}

.voice-wave span:nth-child(1) {
    animation-delay: 0s;
    height: 15px;
}

.voice-wave span:nth-child(2) {
    animation-delay: 0.1s;
    height: 30px;
}

.voice-wave span:nth-child(3) {
    animation-delay: 0.2s;
    height: 25px;
}

.voice-wave span:nth-child(4) {
    animation-delay: 0.3s;
    height: 40px;
}

.voice-wave span:nth-child(5) {
    animation-delay: 0.4s;
    height: 20px;
}

.voice-wave span:nth-child(6) {
    animation-delay: 0.5s;
    height: 35px;
}

.voice-wave span:nth-child(7) {
    animation-delay: 0.6s;
    height: 25px;
}

.voice-wave span:nth-child(8) {
    animation-delay: 0.7s;
    height: 40px;
}

.voice-wave span:nth-child(9) {
    animation-delay: 0.8s;
    height: 15px;
}

.voice-wave span:nth-child(10) {
    animation-delay: 0.9s;
    height: 30px;
}

.voice-wave span:nth-child(11) {
    animation-delay: 1.0s;
    height: 25px;
}

.voice-wave span:nth-child(12) {
    animation-delay: 1.1s;
    height: 35px;
}

@keyframes wave {
    0% {
        height: 5px;
        opacity: 0.6;
    }

    100% {
        height: 40px;
        opacity: 1;
    }
}

.voice-timer {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0.5rem 0 1rem;
    font-family: 'Inter', monospace;
}

.voice-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.audio-player-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 35, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.audio-player-modal.show {
    display: flex;
}

.audio-player-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    padding: 2rem;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 25px 60px rgba(102, 126, 234, 0.3);
    animation: zoomIn 0.3s ease;
}

.audio-player-content h3 {
    margin-bottom: 0.6rem;
    color: #1a1a2e;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.audio-player-content h3 .lucide {
    width: 20px;
    height: 20px;
    color: #764ba2;
}

.audio-player-content audio {
    width: 100%;
    margin: 0.6rem 0;
}

/* ===== PASSWORD PROMPT MODAL ===== */
.password-prompt-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 35, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.password-prompt-modal.show {
    display: flex;
}

.password-prompt-content {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 1.8rem;
    text-align: center;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 25px 60px rgba(102, 126, 234, 0.3);
    animation: zoomIn 0.3s ease;
}

.password-prompt-content h3 {
    margin-bottom: 0.5rem;
    color: #1a1a2e;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.password-prompt-content h3 .lucide {
    width: 20px;
    height: 20px;
    color: #764ba2;
}

.password-prompt-content p {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.password-prompt-content input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 2px solid rgba(139, 92, 246, 0.15);
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a2e;
    margin-bottom: 1rem;
    transition: all 0.25s;
}

.password-prompt-content input:focus {
    border-color: #764ba2;
    box-shadow: 0 0 0 4px rgba(118, 75, 162, 0.12);
    background: white;
}

.password-prompt-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.password-prompt-actions .btn {
    flex: 1;
}

.password-prompt-pin-label {
    display: inline-block;
    font-family: 'Inter', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    background: rgba(139, 92, 246, 0.1);
    color: #6d28d9;
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    margin-bottom: 0.8rem;
}

/* ===== FORGOT PASSWORD MODAL ===== */
.forgot-password-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 35, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.forgot-password-modal.show {
    display: flex;
}

.forgot-password-content {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 1.8rem;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 25px 60px rgba(102, 126, 234, 0.3);
    animation: zoomIn 0.3s ease;
    position: relative;
}

.forgot-password-content h3 {
    margin-bottom: 0.5rem;
    color: #1a1a2e;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.forgot-password-content h3 .lucide {
    width: 20px;
    height: 20px;
    color: #764ba2;
}

.forgot-password-content>p {
    font-size: 0.82rem;
    color: #6b7280;
    margin-bottom: 1.2rem;
    line-height: 1.5;
}

.forgot-password-close {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    background: rgba(139, 92, 246, 0.08);
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8b5cf6;
    transition: all 0.2s;
}

.forgot-password-close:hover {
    background: rgba(139, 92, 246, 0.18);
    color: #6d28d9;
}

.forgot-password-content .input-group {
    margin-bottom: 0.8rem;
}

.forgot-password-content .input-group label {
    font-size: 0.8rem;
}

.forgot-password-content input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(139, 92, 246, 0.15);
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a2e;
    transition: all 0.25s;
}

.forgot-password-content input:focus {
    border-color: #764ba2;
    box-shadow: 0 0 0 4px rgba(118, 75, 162, 0.12);
    background: white;
}

.forgot-password-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.forgot-password-actions .btn {
    flex: 1;
}

.forgot-password-pin-reveal {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(240, 147, 251, 0.1));
    border: 2px dashed rgba(139, 92, 246, 0.4);
    border-radius: 14px;
    text-align: center;
    animation: fadeInUp 0.3s ease;
}

.forgot-password-pin-reveal.hidden {
    display: none;
}

.forgot-password-pin-label {
    font-size: 0.68rem;
    color: #7c3aed;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.3rem;
}

.forgot-password-pin-value {
    font-size: 1.6rem;
    font-weight: 800;
    font-family: 'Inter', monospace;
    letter-spacing: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
}

.forgot-password-divider {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 1.2rem 0 1rem;
    color: #8b5cf6;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.forgot-password-divider hr {
    flex: 1;
    border: none;
    border-top: 1.5px solid rgba(139, 92, 246, 0.2);
}

/* ===== EMOJI PICKER ===== */
.emoji-picker {
    display: none;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 18px;
    width: 360px;
    max-width: calc(100vw - 2rem);
    box-shadow: 0 20px 50px rgba(102, 126, 234, 0.3);
    position: absolute;
    bottom: 7rem;
    right: 1rem;
    z-index: 10;
    overflow: hidden;
    animation: popUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.emoji-picker.show {
    display: flex;
}

.emoji-header {
    padding: 0.6rem 0.6rem 0.3rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.08);
}

.emoji-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.emoji-search-icon {
    position: absolute;
    left: 0.7rem;
    width: 15px;
    height: 15px;
    color: #a78bfa;
    pointer-events: none;
}

.emoji-search {
    width: 100%;
    padding: 0.5rem 0.7rem 0.5rem 2rem;
    border: 1.5px solid rgba(139, 92, 246, 0.15);
    border-radius: 10px;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    background: rgba(250, 245, 255, 0.7);
    color: #1a1a2e;
    transition: all 0.2s;
}

.emoji-search:focus {
    border-color: #764ba2;
    background: white;
    box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.1);
}

.emoji-tabs {
    display: flex;
    gap: 0.1rem;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.08);
    overflow-x: auto;
    scrollbar-width: none;
}

.emoji-tabs::-webkit-scrollbar {
    display: none;
}

.emoji-tab {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.4rem 0.55rem;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a78bfa;
    flex-shrink: 0;
}

.emoji-tab .lucide {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.emoji-tab:hover {
    background: rgba(139, 92, 246, 0.1);
    color: #764ba2;
}

.emoji-tab.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.emoji-body {
    padding: 0.5rem;
    max-height: 260px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.1rem;
    min-height: 180px;
}

.emoji-item {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 8px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.emoji-item:hover {
    background: rgba(139, 92, 246, 0.15);
    transform: scale(1.2);
}

.emoji-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem 1rem;
    color: #a78bfa;
    font-size: 0.82rem;
    font-style: italic;
}

/* ===== UPLOAD PROGRESS ===== */
.upload-wrapper {
    width: 100%;
}

.upload-message {
    display: flex !important;
    align-items: center;
    gap: 0.6rem;
    min-width: 220px;
    max-width: 320px;
}

.upload-message .file-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-message .file-icon .lucide {
    width: 26px;
    height: 26px;
    stroke-width: 1.8;
}

.upload-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.upload-body .file-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.upload-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #f093fb, #ffffff);
    border-radius: 4px;
    transition: width 0.15s ease-out;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.upload-progress-bar.failed .upload-progress-fill {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.upload-progress-text {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* ===== FILE MESSAGE ===== */
.file-message {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.2rem 0;
    min-width: 180px;
}

.file-icon {
    flex-shrink: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
}

.message.me .file-icon {
    background: rgba(255, 255, 255, 0.22);
    color: white;
}

.message.other .file-icon {
    background: rgba(139, 92, 246, 0.12);
    color: #764ba2;
}

.file-icon .lucide {
    width: 22px;
    height: 22px;
    stroke-width: 1.8;
}

.file-icon.icon-image {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}

.file-icon.icon-video {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.file-icon.icon-audio {
    background: rgba(168, 85, 247, 0.15);
    color: #9333ea;
}

.file-icon.icon-pdf {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.file-icon.icon-doc {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}

.file-icon.icon-sheet {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.file-icon.icon-slides {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.file-icon.icon-archive {
    background: rgba(107, 114, 128, 0.15);
    color: #4b5563;
}

.file-icon.icon-code {
    background: rgba(6, 182, 212, 0.15);
    color: #0891b2;
}

.message.me .file-icon.icon-image,
.message.me .file-icon.icon-video,
.message.me .file-icon.icon-audio,
.message.me .file-icon.icon-pdf,
.message.me .file-icon.icon-doc,
.message.me .file-icon.icon-sheet,
.message.me .file-icon.icon-slides,
.message.me .file-icon.icon-archive,
.message.me .file-icon.icon-code {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.file-meta {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 0.68rem;
    opacity: 0.75;
    margin-top: 0.1rem;
}

.file-download-btn {
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 8px;
    transition: all 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-download-btn .lucide {
    width: 15px;
    height: 15px;
    stroke-width: 2.2;
}

.message.other .file-download-btn {
    background: rgba(139, 92, 246, 0.1);
    color: #764ba2;
}

.file-download-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

/* ===== VIDEO MESSAGE ===== */
.video-message {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-width: 280px;
}

.video-player {
    width: 100%;
    max-width: 280px;
    max-height: 320px;
    border-radius: 12px;
    background: #000;
    display: block;
    outline: none;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.72rem;
}

.video-meta .file-name {
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.video-meta .file-size {
    flex-shrink: 0;
    opacity: 0.75;
    font-size: 0.68rem;
}

.video-actions {
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

.video-download-btn {
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-download-btn .lucide {
    width: 14px;
    height: 14px;
}

.message.other .video-download-btn {
    background: rgba(139, 92, 246, 0.1);
    color: #764ba2;
}

.video-download-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

/* ===== AUDIO MESSAGE ===== */
.audio-message {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 220px;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.audio-play-btn {
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.audio-play-btn .lucide {
    width: 16px;
    height: 16px;
    stroke-width: 2.4;
}

.message.other .audio-play-btn {
    background: rgba(139, 92, 246, 0.12);
    color: #764ba2;
}

.audio-play-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.08);
}

.audio-waveform {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 28px;
    flex: 1;
    min-width: 60px;
}

.audio-waveform span {
    display: block;
    width: 3px;
    height: 8px;
    border-radius: 2px;
    background: currentColor;
    opacity: 0.5;
    transition: height 0.2s;
}

.audio-waveform span:nth-child(odd) {
    height: 14px;
}

.audio-waveform span:nth-child(3n) {
    height: 20px;
}

.audio-waveform span:nth-child(5n) {
    height: 10px;
}

.audio-waveform.playing span {
    animation: audioBar 0.7s ease-in-out infinite alternate;
    opacity: 0.9;
}

@keyframes audioBar {
    0% {
        height: 6px;
    }

    100% {
        height: 24px;
    }
}

.audio-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.4rem;
}

.audio-meta .file-name {
    font-size: 0.78rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audio-meta .file-size {
    font-size: 0.65rem;
    flex-shrink: 0;
}

.audio-download-btn {
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.audio-download-btn .lucide {
    width: 13px;
    height: 13px;
}

.message.other .audio-download-btn {
    background: rgba(139, 92, 246, 0.1);
    color: #764ba2;
}

/* ===== VOICE MESSAGE ACTIONS ===== */
.voice-actions-row {
    display: flex;
    gap: 0.3rem;
    align-items: center;
    margin-top: 0.3rem;
}

.voice-download-btn {
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-download-btn .lucide {
    width: 13px;
    height: 13px;
}

.message.other .voice-download-btn {
    background: rgba(139, 92, 246, 0.1);
    color: #764ba2;
}

/* ===== IMAGE DOWNLOAD BUTTON ===== */
.image-download-btn {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    backdrop-filter: blur(4px);
}

.image-download-btn .lucide {
    width: 14px;
    height: 14px;
}

.message-wrapper:hover .image-download-btn {
    opacity: 1;
}

.image-message-wrap {
    position: relative;
    display: inline-block;
}

/* ============================================================ */
/* ===== DARK MODE ===== */
/* ============================================================ */
body.dark-mode {
    background: #0f0f23;
}

body.dark-mode .app-container {
    background: #1a1a2e;
    box-shadow:
        0 0 60px rgba(102, 126, 234, 0.2),
        0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

body.dark-mode .login-screen {
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
}

body.dark-mode .blob-1 {
    opacity: 0.3;
}

body.dark-mode .blob-2 {
    opacity: 0.25;
}

body.dark-mode .blob-3 {
    opacity: 0.2;
}

body.dark-mode .login-screen .subtitle {
    color: #a78bfa;
}

body.dark-mode .dark-mode-toggle {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
    color: #f093fb;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

body.dark-mode .glass-card,
body.dark-mode .voice-modal-content,
body.dark-mode .audio-player-content,
body.dark-mode .password-prompt-content,
body.dark-mode .forgot-password-content {
    background: rgba(30, 30, 60, 0.95);
    border-color: rgba(139, 92, 246, 0.25);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.dark-mode .input-group label,
body.dark-mode .login-form label {
    color: #e0e0ff;
}

body.dark-mode .input-group input,
body.dark-mode .login-row .pin-input,
body.dark-mode .password-prompt-content input,
body.dark-mode .forgot-password-content input {
    background: rgba(30, 30, 60, 0.8);
    border-color: rgba(139, 92, 246, 0.25);
    color: #e0e0ff;
}

body.dark-mode .input-group input:focus,
body.dark-mode .login-row .pin-input:focus,
body.dark-mode .password-prompt-content input:focus,
body.dark-mode .forgot-password-content input:focus {
    border-color: #a78bfa;
    background: rgba(40, 40, 70, 0.9);
    box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.15);
}

body.dark-mode .pin-display-area,
body.dark-mode .empty-state-pin-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(240, 147, 251, 0.1));
    border-color: rgba(167, 139, 250, 0.4);
}

body.dark-mode .pin-label,
body.dark-mode .empty-state-pin-label {
    color: #a78bfa;
}

body.dark-mode .divider {
    color: #a78bfa;
}

body.dark-mode .divider hr {
    border-color: rgba(167, 139, 250, 0.2);
}

body.dark-mode .error-msg {
    color: #f87171;
}

body.dark-mode .error-msg:not(:empty) {
    background: rgba(248, 113, 113, 0.1);
}

body.dark-mode .btn-secondary {
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    border-color: rgba(139, 92, 246, 0.3);
}

body.dark-mode .sidebar {
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f23 100%);
    border-color: rgba(139, 92, 246, 0.15);
}

body.dark-mode .sidebar-header {
    border-color: rgba(139, 92, 246, 0.15);
}

body.dark-mode .user-profile {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(240, 147, 251, 0.08));
    border-color: rgba(139, 92, 246, 0.15);
}

body.dark-mode .user-pin-display span {
    color: #e0e0ff;
}

body.dark-mode .user-phone-display {
    color: #a78bfa;
}

body.dark-mode .user-name-edit input {
    background: rgba(30, 30, 60, 0.8);
    border-color: rgba(139, 92, 246, 0.25);
    color: #e0e0ff;
}

body.dark-mode .pending-requests {
    border-color: rgba(139, 92, 246, 0.15);
}

body.dark-mode .request-item {
    border-color: rgba(139, 92, 246, 0.1);
}

body.dark-mode .request-name {
    color: #e0e0ff;
}

body.dark-mode .no-requests {
    color: #7c7ca8;
}

body.dark-mode .chat-item {
    border-color: rgba(139, 92, 246, 0.08);
}

body.dark-mode .chat-item:hover {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.12), rgba(240, 147, 251, 0.06));
}

body.dark-mode .chat-item.active {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.2), rgba(240, 147, 251, 0.1));
    border-left-color: #a78bfa;
}

body.dark-mode .chat-item-name {
    color: #e0e0ff;
}

body.dark-mode .chat-item-preview {
    color: #a78bfa;
}

body.dark-mode .chat-item-time {
    color: #7c7ca8;
}

body.dark-mode .chat-item-status {
    border-color: #1a1a2e;
}

body.dark-mode .sidebar-footer {
    border-color: rgba(139, 92, 246, 0.15);
}

body.dark-mode .add-friend-section {
    border-color: rgba(139, 92, 246, 0.15);
}

body.dark-mode .add-friend-toggle {
    color: #c4b5fd;
}

body.dark-mode .add-friend-form-inline .pin-input,
body.dark-mode .add-friend-form-inline .name-input {
    background: rgba(30, 30, 60, 0.8);
    border-color: rgba(139, 92, 246, 0.25);
    color: #e0e0ff;
}

body.dark-mode .empty-state-title {
    color: #e0e0ff;
}

body.dark-mode .empty-state-text {
    color: #a78bfa;
}

body.dark-mode .main-chat {
    background: linear-gradient(180deg, #0f0f23 0%, #1a1a2e 100%);
}

body.dark-mode .chat-header {
    background: rgba(26, 26, 46, 0.85);
    border-color: rgba(139, 92, 246, 0.15);
}

body.dark-mode .partner-name {
    color: #e0e0ff;
}

body.dark-mode .partner-pin {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

body.dark-mode .status-text {
    color: #a78bfa;
}

body.dark-mode .badge {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(240, 147, 251, 0.2));
    color: #c4b5fd;
    border-color: rgba(139, 92, 246, 0.3);
}

body.dark-mode .leave-btn {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

body.dark-mode .header-btn {
    background: rgba(139, 92, 246, 0.12);
    color: #c4b5fd;
}

body.dark-mode .search-bar {
    background: rgba(26, 26, 46, 0.9);
    border-color: rgba(139, 92, 246, 0.15);
}

body.dark-mode .search-bar input {
    background: rgba(30, 30, 60, 0.8);
    border-color: rgba(139, 92, 246, 0.25);
    color: #e0e0ff;
}

body.dark-mode .search-results {
    background: rgba(30, 30, 60, 0.95);
}

body.dark-mode .search-result-item {
    border-color: rgba(139, 92, 246, 0.1);
}

body.dark-mode .message.other {
    background: rgba(30, 30, 60, 0.9);
    color: #e0e0ff;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(139, 92, 246, 0.15);
}

body.dark-mode .message.system {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

body.dark-mode .message.other .timestamp {
    color: #a78bfa;
}

body.dark-mode .reply-quote {
    background: rgba(255, 255, 255, 0.08);
    border-left-color: rgba(139, 92, 246, 0.6);
}

body.dark-mode .reply-quote-name {
    color: #a78bfa;
}

body.dark-mode .reply-quote-text {
    color: #c4b5fd;
}

body.dark-mode .message.other .file-icon {
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
}

body.dark-mode .message.other .file-download-btn,
body.dark-mode .message.other .audio-play-btn,
body.dark-mode .message.other .audio-download-btn,
body.dark-mode .message.other .video-download-btn,
body.dark-mode .message.other .voice-download-btn {
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
}

body.dark-mode .quick-reply {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
}

body.dark-mode .chat-input-area {
    background: rgba(26, 26, 46, 0.9);
    border-color: rgba(139, 92, 246, 0.15);
}

body.dark-mode .input-row textarea {
    background: rgba(30, 30, 60, 0.8);
    border-color: rgba(139, 92, 246, 0.25);
    color: #e0e0ff;
}

body.dark-mode .input-row textarea:focus {
    border-color: #a78bfa;
    background: rgba(40, 40, 70, 0.9);
}

body.dark-mode .toolbar-row .icon-btn {
    color: #a78bfa;
}

body.dark-mode .emoji-picker {
    background: rgba(26, 26, 46, 0.98);
    border-color: rgba(139, 92, 246, 0.25);
}

body.dark-mode .emoji-search {
    background: rgba(30, 30, 60, 0.8);
    border-color: rgba(139, 92, 246, 0.25);
    color: #e0e0ff;
}

body.dark-mode .emoji-item:hover {
    background: rgba(139, 92, 246, 0.25);
}

/* ===== DARK MODE: Reply preview + Context menu ===== */
body.dark-mode .reply-preview-bar {
    background: rgba(139, 92, 246, 0.15);
    border-left-color: #a78bfa;
}

body.dark-mode .reply-preview-name {
    color: #a78bfa;
}

body.dark-mode .reply-preview-text {
    color: #c4b5fd;
}

body.dark-mode .message-context-menu {
    background: #1a1a2e;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(139, 92, 246, 0.2);
}

body.dark-mode .ctx-btn {
    color: #e0e0ff;
}

body.dark-mode .ctx-btn:hover {
    background: rgba(139, 92, 246, 0.2);
}

body.dark-mode .ctx-btn.ctx-danger {
    color: #f87171;
}

body.dark-mode .ctx-btn.ctx-danger:hover {
    background: rgba(239, 68, 68, 0.15);
}

body.dark-mode .ctx-divider {
    background: rgba(139, 92, 246, 0.15);
}

body.dark-mode .password-strength-bar-track {
    background: rgba(139, 92, 246, 0.2);
}

body.dark-mode .forgot-password-divider {
    color: #a78bfa;
}

body.dark-mode .forgot-password-divider hr {
    border-color: rgba(167, 139, 250, 0.2);
}

body.dark-mode .forgot-password-pin-reveal {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(240, 147, 251, 0.1));
    border-color: rgba(167, 139, 250, 0.4);
}

body.dark-mode .password-prompt-pin-label {
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
}

/* ============================================================ */
/* ===== MOBILE RESPONSIVE ===== */
/* ============================================================ */
@media (max-width: 768px) {
    .app-container {
        max-height: 100dvh;
        height: 100dvh;
        border-radius: 0;
    }

    .login-screen {
        padding: 1.5rem 1.2rem;
        gap: 0.8rem;
    }

    .login-screen .logo {
        font-size: 2.8rem;
    }

    .login-screen .subtitle {
        font-size: 0.82rem;
    }

    .login-section {
        max-width: 100%;
        gap: 0.8rem;
    }

    .glass-card {
        padding: 1.2rem;
        border-radius: 16px;
    }

    .pin-display {
        font-size: 1.8rem;
        letter-spacing: 4px;
    }

    .pin-actions {
        flex-direction: column;
    }

    .pin-actions .btn {
        width: 100%;
        text-align: center;
    }

    .login-row {
        flex-direction: column;
    }

    .login-row .btn {
        width: 100%;
    }

    .divider {
        font-size: 0.7rem;
        gap: 0.8rem;
    }

    .dark-mode-toggle {
        top: 1rem;
        right: 1rem;
        padding: 0.5rem;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 290px;
        height: 100%;
        transform: translateX(-100%);
        z-index: 20;
        box-shadow: 4px 0 20px rgba(102, 126, 234, 0.2);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: flex;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .sidebar-toggle {
        display: flex;
    }

    .main-chat {
        width: 100%;
    }

    .chat-header {
        padding: 0.6rem 1rem;
        padding-top: calc(0.6rem + env(safe-area-inset-top));
    }

    .header-right .badge {
        display: none;
    }

    .chat-messages {
        padding: 0.6rem 0.8rem;
    }

    .message {
        max-width: 85%;
        font-size: 0.88rem;
        padding: 0.6rem 0.9rem;
    }

    .quick-replies {
        padding: 0.3rem 0.5rem;
        gap: 0.3rem;
    }

    .quick-reply {
        font-size: 0.68rem;
        padding: 0.25rem 0.7rem;
    }

    .chat-input-area {
        padding: 0.4rem 0.7rem 0.7rem;
        padding-bottom: calc(0.7rem + env(safe-area-inset-bottom));
    }

    .input-row textarea {
        font-size: 0.88rem;
        padding: 0.5rem 0.8rem;
        min-height: 38px;
        max-height: 90px;
    }

    .send-btn {
        font-size: 0.82rem;
        padding: 0.5rem 1rem;
        height: 38px;
    }

    .toolbar-row .icon-btn {
        padding: 0.4rem;
    }

    .toolbar-row .icon-btn .lucide {
        width: 19px;
        height: 19px;
    }

    .emoji-picker {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 60vh;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .emoji-body {
        max-height: calc(60vh - 130px);
        grid-template-columns: repeat(7, 1fr);
    }

    .emoji-item {
        font-size: 1.5rem;
        padding: 0.35rem;
    }

    .partner-name {
        font-size: 0.88rem;
    }

    .partner-pin {
        font-size: 0.6rem;
        padding: 0.1rem 0.4rem;
    }

    .status-text {
        font-size: 0.6rem;
    }

    .status-dot {
        width: 8px;
        height: 8px;
    }

    .header-btn {
        padding: 0.4rem;
    }

    .header-btn .lucide {
        width: 16px;
        height: 16px;
    }

    .leave-btn {
        font-size: 0.72rem;
        padding: 0.3rem 0.6rem;
    }

    .chat-item {
        padding: 0.5rem 0.9rem;
    }

    .chat-item-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }

    .chat-item-avatar-wrap {
        margin-right: 0.6rem;
    }

    .chat-item-status {
        width: 10px;
        height: 10px;
    }

    .password-prompt-content {
        padding: 1.5rem;
    }

    .forgot-password-content {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .login-screen {
        padding: 1rem;
        gap: 0.6rem;
    }

    .login-screen .logo {
        font-size: 2.2rem;
    }

    .glass-card {
        padding: 1rem;
        border-radius: 14px;
    }

    .pin-display {
        font-size: 1.6rem;
        letter-spacing: 3px;
    }

    .input-group input {
        padding: 0.75rem 0.9rem;
        font-size: 0.92rem;
    }

    .btn {
        padding: 0.75rem 1.1rem;
        font-size: 0.9rem;
    }

    .sidebar {
        width: 260px;
        min-width: 260px;
    }

    .message {
        font-size: 0.85rem;
        padding: 0.5rem 0.8rem;
        max-width: 90%;
    }

    .emoji-body {
        grid-template-columns: repeat(6, 1fr);
    }

    .emoji-item {
        font-size: 1.4rem;
        padding: 0.3rem;
    }

    .message-context-menu {
        min-width: 160px;
    }
}