/* --- Global Customizations & Variables --- */
:root {
    --bg-gradient: linear-gradient(135deg, #FFF0F5 0%, #FFE4E1 40%, #FFF9E6 100%);
    --primary-pink: #FF8DA1;
    --hover-pink: #FF6B8B;
    --light-pink: #FFD1DC;
    --sweet-lavender: #E6E6FA;
    --deep-lavender: #DCD0FF;
    --bubble-sent: #FFB7C5;
    --bubble-received: #FFFFFF;
    --text-dark: #4A3E40;
    --text-light: #8E7C80;
    --white: #FFFFFF;
    --border-color: #FFF0F2;
    --card-shadow: 0 15px 35px rgba(255, 141, 161, 0.12);
    --bubble-shadow: 0 4px 10px rgba(255, 183, 197, 0.1);
    --font-cute: 'Nunito', sans-serif;
    --border-radius-lg: 24px;
    --border-radius-md: 18px;
    --border-radius-sm: 12px;
}

/* --- Resets --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    width: 100%;
    height: 100%;
    font-family: var(--font-cute);
    background: var(--bg-gradient);
    color: var(--text-dark);
    overflow: hidden;
}

/* --- Floating Hearts Decor --- */
.floating-hearts {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.heart {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0.6;
    animation: floatUp 15s infinite linear;
}

.h1 { left: 10%; animation-duration: 12s; font-size: 2rem; }
.h2 { left: 30%; animation-delay: 2s; animation-duration: 18s; }
.h3 { left: 55%; animation-delay: 5s; animation-duration: 14s; font-size: 1.8rem; }
.h4 { left: 75%; animation-delay: 1s; animation-duration: 16s; }
.h5 { left: 90%; animation-delay: 7s; animation-duration: 20s; font-size: 2.2rem; }

@keyframes floatUp {
    0% {
        transform: translateY(105vh) rotate(0deg) scale(0.8);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-10vh) rotate(360deg) scale(1.2);
        opacity: 0;
    }
}

/* --- Main App Container --- */
#app {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

/* --- Hidden Utility --- */
.hidden {
    display: none !important;
}

/* --- Auth View Layout --- */
.view-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    width: 100%;
    max-width: 420px;
    padding: 40px 30px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--card-shadow);
    border: 3px solid var(--white);
    position: relative;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-icon {
    font-size: 3.5rem;
    margin-bottom: 10px;
    animation: bounce 2s infinite ease-in-out;
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--hover-pink);
    margin-bottom: 5px;
}

.auth-header p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* --- Form Fields --- */
.input-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 8px;
    padding-left: 5px;
}

.input-group label i {
    color: var(--primary-pink);
    margin-right: 5px;
}

.input-group input {
    width: 100%;
    padding: 14px 18px;
    border-radius: var(--border-radius-md);
    border: 2px solid var(--light-pink);
    background: rgba(255, 255, 255, 0.9);
    font-family: var(--font-cute);
    font-size: 1rem;
    color: var(--text-dark);
    outline: none;
    transition: all 0.3s ease;
}

.input-group input:focus {
    border-color: var(--primary-pink);
    box-shadow: 0 0 10px rgba(255, 141, 161, 0.25);
    background: var(--white);
}

/* --- Buttons --- */
.pink-btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: var(--border-radius-md);
    background: var(--primary-pink);
    color: var(--white);
    font-family: var(--font-cute);
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 15px rgba(255, 141, 161, 0.3);
    margin-top: 10px;
}

.pink-btn:hover {
    background: var(--hover-pink);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 141, 161, 0.4);
}

.pink-btn:active {
    transform: translateY(1px);
}

.sparkle {
    display: inline-block;
    animation: pulse 1s infinite alternate;
}

/* --- Auth Footer --- */
.auth-footer {
    text-align: center;
    margin-top: 25px;
    font-size: 0.9rem;
}

.auth-footer a {
    color: var(--hover-pink);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s ease;
}

.auth-footer a:hover {
    color: var(--primary-pink);
    text-decoration: underline;
}

/* --- Error/Alert Banner --- */
.error-banner {
    background: #FFF0F2;
    color: #FF5A79;
    padding: 12px 15px;
    border-radius: var(--border-radius-sm);
    border: 1px dashed var(--primary-pink);
    margin-top: 20px;
    font-size: 0.88rem;
    font-weight: 700;
    text-align: center;
    animation: shake 0.4s ease;
}

/* --- Main Chat Layout --- */
.chat-layout {
    width: 100%;
    height: 100%;
    max-width: 1200px;
    max-height: 800px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--card-shadow);
    border: 4px solid var(--white);
    display: flex;
    overflow: hidden;
}

/* --- Sidebar Style --- */
.chat-sidebar {
    width: 350px;
    height: 100%;
    border-right: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.4);
}

.sidebar-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
}

.profile-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--light-pink);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.3rem;
    box-shadow: 0 4px 8px rgba(255, 183, 197, 0.3);
}

.avatar.small {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
}

.profile-area .username {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.logout-icon {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 5px;
}

.logout-icon:hover {
    color: var(--hover-pink);
    transform: scale(1.1);
}

/* --- Search Area --- */
.search-container {
    padding: 15px 20px;
    position: relative;
}

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

.search-bar input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border-radius: var(--border-radius-md);
    border: 2px solid var(--light-pink);
    outline: none;
    font-family: var(--font-cute);
    font-size: 0.95rem;
    background: var(--white);
    transition: all 0.3s ease;
}

.search-bar input:focus {
    border-color: var(--primary-pink);
    box-shadow: 0 0 8px rgba(255, 141, 161, 0.15);
}

.search-icon {
    position: absolute;
    left: 15px;
    color: var(--primary-pink);
    font-size: 0.95rem;
}

/* --- Search Results Dropdown --- */
.search-results {
    position: absolute;
    top: 60px;
    left: 20px;
    right: 20px;
    background: var(--white);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 10px 25px rgba(255, 141, 161, 0.15);
    border: 2px solid var(--border-color);
    z-index: 10;
    max-height: 250px;
    overflow-y: auto;
}

.search-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

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

.search-item:hover {
    background: var(--bg-gradient);
}

.search-item span {
    font-weight: 700;
}

.chat-now-btn {
    background: var(--primary-pink);
    color: var(--white);
    border: none;
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-cute);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.chat-now-btn:hover {
    background: var(--hover-pink);
}

/* --- Conversations List --- */
.conversations-wrapper {
    flex: 1;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.conversations-wrapper h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    padding: 0 20px 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
}

.no-chats-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    font-size: 0.95rem;
}

.conversation-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 240, 242, 0.5);
}

.conversation-card:hover {
    background: rgba(255, 209, 220, 0.25);
}

.conversation-card.active {
    background: rgba(255, 209, 220, 0.45);
    border-left: 5px solid var(--primary-pink);
}

.conversation-card .info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
}

.conversation-card .info-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.conversation-card .info-top .name {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--text-dark);
}

.conversation-card .info-top .time {
    font-size: 0.75rem;
    color: var(--text-light);
}

.conversation-card .last-msg {
    font-size: 0.88rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Chat Panel Style --- */
.chat-main {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.2);
}

/* Placeholder state */
.chat-placeholder {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px;
}

.placeholder-content {
    max-width: 400px;
}

.placeholder-emoji {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: floatUpSlow 4s infinite ease-in-out alternate;
}

.chat-placeholder h2 {
    color: var(--hover-pink);
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.chat-placeholder p {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.5;
}

/* Active chat screen */
.chat-active {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.chat-header {
    padding: 15px 20px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.5);
}

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

.active-name-group {
    display: flex;
    flex-direction: column;
}

.header-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.active-name-group #active-chat-username {
    font-weight: 800;
    font-size: 1.1rem;
}

.safe-badge {
    background: rgba(255, 77, 109, 0.1);
    color: #FF4D6D;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(255, 77, 109, 0.25);
    animation: pulse 1.5s infinite alternate;
}

.online-status {
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.online-status.online {
    color: #4cd137;
}

.online-status.online::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #4cd137;
    border-radius: 50%;
}

.online-status.offline {
    color: var(--text-light);
}

.online-status.offline::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--text-light);
    border-radius: 50%;
}

.block-toggle-btn {
    background: none;
    border: 2px solid #ffccd5;
    color: #ff4d6d;
    padding: 6px 12px;
    border-radius: var(--border-radius-md);
    font-family: var(--font-cute);
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.block-toggle-btn:hover {
    background: #ff4d6d;
    color: var(--white);
    border-color: #ff4d6d;
}

.back-btn {
    display: none; /* Only visible on mobile */
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--primary-pink);
    cursor: pointer;
    padding-right: 15px;
}

/* --- Messages Log Area --- */
.messages-log {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: rgba(255, 255, 255, 0.1);
}

/* --- Message Bubbles --- */
.message-bubble {
    max-width: 70%;
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    position: relative;
    animation: popBubble 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popBubble {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.message-bubble.sent {
    align-self: flex-end;
    background: var(--bubble-sent);
    color: var(--white);
    border-radius: var(--border-radius-md) var(--border-radius-md) 4px var(--border-radius-md);
    box-shadow: 0 4px 12px rgba(255, 141, 161, 0.15);
}

.message-bubble.received {
    align-self: flex-start;
    background: var(--bubble-received);
    color: var(--text-dark);
    border-radius: var(--border-radius-md) var(--border-radius-md) var(--border-radius-md) 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
}

.msg-meta {
    font-size: 0.72rem;
    margin-top: 5px;
    align-self: flex-end;
    opacity: 0.8;
}

.message-bubble.sent .msg-meta {
    color: rgba(255, 255, 255, 0.85);
}

.message-bubble.received .msg-meta {
    color: var(--text-light);
}

/* --- Anti-Download Blockers --- */
.media-container-relative {
    position: relative;
    display: inline-block;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    user-select: none;
    -webkit-user-drag: none;
}

.media-overlay-blocker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0);
    z-index: 2;
    cursor: default;
    user-select: none;
    -webkit-user-drag: none;
}

.bubble-media {
    max-width: 100%;
    border-radius: var(--border-radius-sm);
    margin-bottom: 5px;
    object-fit: cover;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.bubble-media-wrapper {
    position: relative;
    max-width: 280px;
    user-select: none;
    -webkit-user-drag: none;
}

/* --- Vanishing Message indicator --- */
.message-bubble.vanishing-msg::before {
    content: '⏱️';
    position: absolute;
    top: -8px;
    right: 5px;
    font-size: 0.72rem;
    opacity: 0.8;
}

.message-bubble.received.vanishing-msg::before {
    left: 5px;
    right: auto;
}

/* --- View Once Revealer Envelope bubble --- */
.reveal-media-bubble {
    cursor: pointer;
    background: linear-gradient(135deg, #FFCCD5, #FFE3E8);
    border: 2px dashed #FF4D6D !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 18px 22px !important;
    border-radius: var(--border-radius-md);
    transition: all 0.25s ease;
    text-align: center;
    box-shadow: 0 4px 10px rgba(255, 77, 109, 0.15) !important;
}

.reveal-media-bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 77, 109, 0.25) !important;
    background: linear-gradient(135deg, #FFB3C1, #FFCCD5);
}

.reveal-envelope-icon {
    font-size: 2.2rem;
    color: #FF4D6D;
    animation: bounce 1.5s infinite ease-in-out;
}

.reveal-text-title {
    font-weight: 800;
    font-size: 0.9rem;
    color: #A3263E;
}

.reveal-text-desc {
    font-size: 0.74rem;
    color: #C1435D;
}

/* --- Vanished Spent placeholder --- */
.vanished-placeholder-bubble {
    background: rgba(220, 220, 220, 0.35) !important;
    color: var(--text-light) !important;
    border: 1px dashed var(--text-light) !important;
    font-style: italic;
    padding: 8px 15px !important;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: none !important;
    font-size: 0.88rem;
}

/* --- Bouncy Typing Indicator --- */
.typing-indicator {
    padding: 10px 25px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 700;
    align-self: flex-start;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--primary-pink);
    border-radius: 50%;
    display: inline-block;
    animation: bounceDot 1.4s infinite ease-in-out both;
}

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

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

@keyframes bounceDot {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* --- Blocked Overlay --- */
.blocked-overlay {
    background: #FFF0F2;
    border-top: 2px solid var(--light-pink);
    padding: 15px;
    text-align: center;
    font-weight: 800;
    color: #ff4d6d;
    font-size: 0.9rem;
}

/* --- Chat Input Bar --- */
.chat-input-bar {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.6);
    border-top: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.attach-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--primary-pink);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attach-btn:hover {
    color: var(--hover-pink);
    transform: scale(1.1);
}

.vanish-toggle-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 2px 5px;
}

.vanish-toggle-btn .toggle-label {
    font-size: 0.62rem;
    font-weight: 800;
    color: var(--text-light);
}

.vanish-toggle-btn i {
    transition: transform 0.2s ease;
}

.vanish-toggle-btn.active {
    color: #FF4D6D;
    transform: scale(1.15);
}

.vanish-toggle-btn.active i {
    filter: drop-shadow(0 0 4px rgba(255, 77, 109, 0.45));
}

.vanish-toggle-btn.active .toggle-label {
    color: #FF4D6D;
}

.msg-form {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.msg-form input {
    flex: 1;
    padding: 12px 20px;
    border-radius: 25px;
    border: 2px solid var(--light-pink);
    outline: none;
    font-family: var(--font-cute);
    font-size: 0.98rem;
    background: var(--white);
    transition: border-color 0.3s ease;
}

.msg-form input:focus {
    border-color: var(--primary-pink);
}

.send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-pink);
    border: none;
    color: var(--white);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(255, 141, 161, 0.25);
}

.send-btn:hover {
    background: var(--hover-pink);
    transform: scale(1.08) rotate(10deg);
}

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

/* --- Media Upload Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(74, 62, 64, 0.4);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-card {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--card-shadow);
    max-width: 450px;
    width: 90%;
    border: 3px solid var(--light-pink);
    text-align: center;
}

.modal-card h3 {
    color: var(--hover-pink);
    margin-bottom: 20px;
    font-weight: 800;
}

.media-preview-container {
    width: 100%;
    max-height: 250px;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    margin-bottom: 20px;
    background: #FAFAFA;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px dashed var(--light-pink);
}

.media-preview-container img, 
.media-preview-container video {
    max-width: 100%;
    max-height: 250px;
    object-fit: contain;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.modal-btn {
    padding: 10px 25px;
    border: none;
    border-radius: var(--border-radius-md);
    font-family: var(--font-cute);
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn.cancel {
    background: var(--sweet-lavender);
    color: var(--text-dark);
}

.modal-btn.cancel:hover {
    background: var(--deep-lavender);
}

.modal-btn.confirm {
    background: var(--primary-pink);
    color: var(--white);
}

.modal-btn.confirm:hover {
    background: var(--hover-pink);
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #EEE;
    border-radius: 4px;
    margin-top: 15px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--primary-pink);
    transition: width 0.1s ease;
}

/* --- FULLSCREEN VIEW ONCE MEDIA VIEWER MODAL --- */
.view-once-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(20, 15, 17, 0.95);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease;
}

.view-once-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 90%;
    width: 500px;
}

.view-once-media-container {
    width: 100%;
    max-height: 70vh;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    border: 3px solid var(--primary-pink);
    box-shadow: 0 10px 30px rgba(255, 77, 109, 0.3);
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.view-once-media-container img,
.view-once-media-container video {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    user-select: none;
    pointer-events: none;
    -webkit-user-drag: none;
}

.view-once-timer-container {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.timer-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 3.5;
}

.timer-fill {
    fill: none;
    stroke: #FF4D6D;
    stroke-width: 3.5;
    stroke-linecap: round;
    transition: stroke-dasharray 0.1s linear;
}

#view-once-countdown {
    font-size: 1.3rem;
    font-weight: 800;
    color: #FFF;
    z-index: 2;
}

.view-once-warning {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-once-blur-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 8, 9, 0.85);
    backdrop-filter: blur(35px);
    -webkit-backdrop-filter: blur(35px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2100;
}

.blur-warning-box {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius-lg);
    border: 3px solid #ffccd5;
    text-align: center;
    max-width: 350px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}

.blur-warning-box h2 {
    color: #FF4D6D;
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.blur-warning-box p {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* --- GLOBAL PRIVACY BLUR FOR SCREENSHOT PROTECTION --- */
.privacy-blur-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 240, 242, 0.6);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.25s ease;
}

.privacy-blur-card {
    background: var(--white);
    padding: 35px 30px;
    border-radius: var(--border-radius-lg);
    border: 3px solid var(--light-pink);
    text-align: center;
    box-shadow: var(--card-shadow);
    max-width: 320px;
}

.privacy-emoji {
    font-size: 3rem;
    margin-bottom: 15px;
    animation: bounce 2s infinite ease-in-out;
}

.privacy-blur-card h2 {
    font-size: 1.3rem;
    color: var(--hover-pink);
    margin-bottom: 8px;
}

.privacy-blur-card p {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* --- Scrollbars --- */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--light-pink);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-pink);
}

/* --- Animations --- */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

@keyframes floatUpSlow {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-10px) rotate(5deg); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* --- Responsive & Mobile first styles --- */
@media (max-width: 768px) {
    body, html {
        height: 100dvh;
    }

    .view-container {
        padding: 0;
    }

    .chat-layout {
        position: relative;
        border-radius: 0;
        border: none;
        max-height: 100dvh;
        max-width: 100%;
        width: 100%;
        height: 100dvh;
        overflow: hidden;
    }
    
    .chat-sidebar {
        width: 100%;
        height: 100dvh;
        flex: none;
    }
    
    .chat-main {
        width: 100%;
        position: absolute;
        top: 0;
        left: 0;
        height: 100dvh;
        z-index: 5;
        background: var(--bg-gradient);
        transition: transform 0.3s ease;
        transform: translateX(100%);
    }
    
    /* When active chat is showing, slide the main chat panel in */
    .chat-layout.chat-open .chat-main {
        transform: translateX(0);
    }
    
    .back-btn {
        display: block;
        padding-right: 8px;
    }
    
    .message-bubble {
        max-width: 85%;
    }

    /* Padding & spacing reduction for mobile suitability */
    .chat-header {
        padding: 10px 12px;
    }

    .active-user-info {
        gap: 8px;
    }

    .active-name-group #active-chat-username {
        font-size: 1rem;
    }

    .messages-log {
        padding: 12px 10px;
        gap: 10px;
    }

    .chat-input-bar {
        padding: 8px 12px;
        gap: 8px;
    }

    /* Hide text label on Vanish toggle button to maximize input width */
    .vanish-toggle-btn {
        padding: 6px;
        font-size: 1.4rem;
        flex-direction: row;
    }

    .vanish-toggle-btn .toggle-label {
        display: none;
    }

    /* Ensure form and inputs have a clean layout and prevent Safari auto-zoom (min-size 16px) */
    .msg-form input {
        font-size: 16px;
        padding: 10px 16px;
        width: 100%;
        min-width: 0;
    }

    .search-bar input {
        font-size: 16px;
    }

    .input-group input {
        font-size: 16px;
    }

    .attach-btn, .vanish-toggle-btn, .send-btn {
        flex-shrink: 0;
    }

    .send-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .attach-btn {
        font-size: 1.6rem;
    }

    .reply-banner {
        padding: 8px 12px;
    }
}

/* Extra adjustments for smaller viewports to prevent crowding */
@media (max-width: 400px) {
    .block-toggle-btn {
        font-size: 0;
        padding: 6px 10px;
    }
    .block-toggle-btn i {
        font-size: 0.85rem;
    }
}

@media (max-width: 380px) {
    .safe-badge {
        font-size: 0;
        padding: 4px 6px;
        margin: 0;
    }
    .safe-badge i {
        font-size: 0.75rem;
        margin: 0;
    }
}

/* --- Message Replies & Deletions --- */

/* Action bar shown on hover of message bubbles */
.bubble-action-bar {
    position: absolute;
    top: -26px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    border: 1.5px solid var(--light-pink);
    border-radius: 12px;
    padding: 2px 6px;
    display: flex;
    gap: 6px;
    box-shadow: 0 4px 10px rgba(255, 141, 161, 0.15);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 10;
}

.message-bubble.sent .bubble-action-bar {
    right: 12px;
}

.message-bubble.received .bubble-action-bar {
    left: 12px;
}

.message-bubble:hover .bubble-action-bar {
    opacity: 1;
    pointer-events: auto;
    top: -20px;
}

/* Actions buttons styling */
.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-light);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
}

.action-btn:hover {
    transform: scale(1.15);
}

.action-btn.reply:hover {
    color: #4cd137;
    background: rgba(76, 209, 55, 0.1);
}

.action-btn.delete:hover {
    color: #ff4d6d;
    background: rgba(255, 77, 109, 0.1);
}

/* Quoted message container inside message bubbles */
.reply-quote-in-bubble {
    background: rgba(0, 0, 0, 0.04);
    border-left: 3px solid var(--primary-pink);
    border-radius: 4px;
    padding: 6px 10px;
    margin-bottom: 6px;
    font-size: 0.82rem;
    cursor: pointer;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.message-bubble.sent .reply-quote-in-bubble {
    border-left-color: var(--white);
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
}

.reply-quote-in-bubble .quote-user {
    font-weight: 800;
    display: block;
    font-size: 0.76rem;
    margin-bottom: 2px;
}

.reply-quote-in-bubble .quote-text {
    font-style: italic;
    opacity: 0.9;
}

/* Reply preview banner above the input bar */
.reply-banner {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 2.5px solid var(--primary-pink);
    border-bottom: 1.5px solid var(--border-color);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideUpReply 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

@keyframes slideUpReply {
    0% { transform: translateY(100%); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.reply-banner-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    flex: 1;
    text-align: left;
}

.reply-banner-content .reply-title {
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--hover-pink);
}

.reply-banner-content .reply-text {
    font-size: 0.85rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-style: italic;
}

.cancel-reply-btn {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 5px;
    transition: all 0.2s ease;
}

.cancel-reply-btn:hover {
    color: var(--hover-pink);
    transform: scale(1.15);
}

/* --- Minimal Notification Toast --- */
.notification-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-120px);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 2px solid var(--primary-pink);
    box-shadow: 0 10px 30px rgba(255, 141, 161, 0.25);
    border-radius: 30px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    min-width: 290px;
    max-width: 90%;
    z-index: 5000;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.25);
    cursor: pointer;
}

.notification-toast:hover {
    transform: translateX(-50%) translateY(2px) scale(1.02);
}

.notification-toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    overflow: hidden;
}

.toast-avatar {
    width: 32px;
    height: 32px;
    background: var(--light-pink);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.toast-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    text-align: left;
}

.toast-sender {
    font-weight: 800;
    font-size: 0.88rem;
    color: var(--hover-pink);
}

.toast-body {
    font-size: 0.82rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.close-toast-btn {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 3px;
    transition: color 0.2s ease;
}

.close-toast-btn:hover {
    color: var(--hover-pink);
}

/* --- PWA Install Banner --- */
.install-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(200px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 3px solid var(--primary-pink);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 15px 40px rgba(255, 141, 161, 0.3);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    width: 90%;
    max-width: 480px;
    z-index: 6000;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.25);
}

.install-banner.show {
    transform: translateX(-50%) translateY(0);
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 200px;
    text-align: left;
}

.banner-icon {
    font-size: 2.2rem;
    animation: bounce 1.8s infinite ease-in-out;
}

.banner-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.banner-text strong {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--hover-pink);
}

.banner-text span {
    font-size: 0.82rem;
    color: var(--text-light);
    line-height: 1.3;
}

.banner-actions {
    display: flex;
    gap: 8px;
}

.banner-btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--border-radius-md);
    font-family: var(--font-cute);
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.banner-btn.cancel {
    background: var(--sweet-lavender);
    color: var(--text-dark);
}

.banner-btn.cancel:hover {
    background: var(--deep-lavender);
}

.banner-btn.confirm {
    background: var(--primary-pink);
    color: var(--white);
}

.banner-btn.confirm:hover {
    background: var(--hover-pink);
}

.banner-close-icon {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-close-icon:hover {
    color: var(--hover-pink);
}



