/* Snapchat & WhatsApp Hybrid Chatbox Theme */

.chat-header {
    padding: 12px 16px;
    background: rgba(15, 20, 28, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #1e293b;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 20;
}

.header-partner-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.partner-avatar-wrapper {
    position: relative;
}

.partner-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: #fff;
    border: 2px solid var(--snap-yellow);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: absolute;
    bottom: 0;
    right: 0;
    border: 2px solid var(--snap-dark);
}

.status-dot.online {
    background-color: #10b981;
    box-shadow: 0 0 6px #10b981;
}

.status-dot.offline {
    background-color: #64748b;
}

.partner-details h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--snap-text);
}

.partner-presence-text {
    font-size: 12px;
    color: var(--snap-subtext);
}

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

.icon-btn {
    background: #1e293b;
    border: none;
    color: var(--snap-text);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.15s;
}

.icon-btn:hover {
    background: #334155;
}

/* Chat Message Stream */
.message-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.message-bubble {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 18px;
    position: relative;
    word-break: break-word;
    font-size: 14.5px;
    line-height: 1.4;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.msg-outgoing {
    align-self: flex-end;
    background: var(--snap-bubble-me);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.msg-incoming {
    align-self: flex-start;
    background: var(--snap-bubble-them);
    color: var(--snap-text);
    border-bottom-left-radius: 4px;
}

.media-container {
    margin: -4px -8px 6px -8px;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background: #000;
}

.snap-media-preview {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s;
}

.snap-media-preview.loading {
    opacity: 0.3;
    min-height: 120px;
}

.snap-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    padding: 3px 8px;
    border-radius: 12px;
}

.voice-note-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.voice-play-btn {
    background: var(--snap-yellow);
    color: #000;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.voice-waveform {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.msg-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

.msg-status {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
}

.msg-status.seen .seen-check {
    color: var(--seen-blue);
    font-weight: bold;
}

.msg-status.seen .seen-time {
    color: var(--seen-blue);
    font-size: 10px;
}

/* Typing Bubble */
.typing-bubble {
    align-self: flex-start;
    background: var(--snap-card);
    padding: 8px 14px;
    border-radius: 16px;
    font-size: 12px;
    color: var(--snap-subtext);
    display: flex;
    align-items: center;
    gap: 6px;
}

.typing-dot {
    width: 5px;
    height: 5px;
    background: var(--snap-yellow);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

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

@keyframes typingBounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-4px); }
}

/* Bottom Chat Input Bar */
.chat-input-bar {
    padding: 10px 14px;
    background: rgba(15, 20, 28, 0.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 20;
}

.snap-camera-btn {
    background: var(--snap-yellow);
    color: #000;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255, 252, 0, 0.3);
    flex-shrink: 0;
}

.chat-input-wrapper {
    flex: 1;
    background: #1e293b;
    border-radius: 22px;
    display: flex;
    align-items: center;
    padding: 4px 14px;
    border: 1px solid #334155;
}

.chat-text-input {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 15px;
    outline: none;
    padding: 8px 0;
}

.chat-send-btn {
    background: #3b82f6;
    color: #fff;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

/* In-App Camera Viewfinder Overlay */
.camera-modal {
    position: absolute;
    inset: 0;
    background: #000;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.camera-video, .camera-preview-img, .camera-preview-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-top-bar {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    display: flex;
    justify-content: space-between;
    z-index: 102;
}

.camera-record-indicator {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #ef4444;
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    z-index: 103;
    animation: pulse 1s infinite;
}

.camera-controls {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
    z-index: 102;
}

.snap-shutter-btn {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: 4px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.snap-shutter-btn .inner-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--snap-yellow);
}

.camera-send-controls {
    position: absolute;
    bottom: 24px;
    left: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 102;
}

.caption-emojis {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    padding-bottom: 4px;
}

.snap-emoji-tag {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 6px 10px;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
    user-select: none;
}

.snap-emoji-tag:hover, .snap-emoji-tag:active {
    background: rgba(255, 252, 0, 0.25);
    transform: scale(1.2);
}

.caption-input {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    color: #fff;
    font-size: 15px;
    outline: none;
}

.send-snap-btn {
    background: var(--snap-yellow);
    color: #000;
    border: none;
    border-radius: 14px;
    padding: 14px;
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
}

/* Lightbox Modal */
.lightbox-modal {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-img, .lightbox-video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.lightbox-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 151;
}

/* Emoji Keyboard Styles */
.emoji-trigger-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 2px 6px;
    margin-right: 4px;
    transition: transform 0.15s;
    line-height: 1;
}

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

.emoji-keyboard {
    position: absolute;
    bottom: 68px;
    left: 12px;
    right: 12px;
    background: rgba(24, 34, 50, 0.96);
    backdrop-filter: blur(16px);
    border: 1px solid #334155;
    border-radius: 18px;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.6);
    z-index: 40;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: emojiSlideUp 0.18s ease-out;
}

@keyframes emojiSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.emoji-tabs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 20, 28, 0.5);
}

.emoji-tab {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.55;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.15s;
}

.emoji-tab.active {
    opacity: 1;
    background: rgba(255, 252, 0, 0.15);
    transform: scale(1.15);
}

.emoji-tab-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    font-weight: bold;
}

.emoji-tab-close:hover {
    color: #fff;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    padding: 10px 8px;
    max-height: 180px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}

.emoji-item {
    font-size: 22px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 6px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s, background 0.1s;
    user-select: none;
}

.emoji-item:hover, .emoji-item:active {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.25);
}
