.fancy-chat-wrapper {
    max-width: 900px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.speed-dating-banner {
    background: linear-gradient(135deg, #4f46e5 100%, #9333ea 0%);
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.speed-dating-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background-color: #22c55e;
    border-radius: 50%;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.speed-dating-btn {
    background: #ffffff;
    color: #4f46e5;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 12px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.speed-dating-btn:hover {
    background: #f8fafc;
}

.fancy-chat-container {
    background: #0f172a;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    display: flex;
    height: 550px;
    overflow: hidden;
    border: 1px solid #1e293b;
    border-top: none;
}

.fancy-chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.fancy-chat-header {
    background: #1e293b;
    color: #ffffff;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #334155;
}

.fancy-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-bubble {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 85%;
}

.chat-bubble.mine {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #334155;
    flex-shrink: 0;
}

.chat-content {
    background: #1e293b;
    color: #f8fafc;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid #334155;
    word-break: break-word;
    max-width: 100%;
}

.chat-bubble.mine .chat-content {
    background: #4f46e5;
    color: #ffffff;
    border: none;
}

.chat-user-link {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-decoration: none;
    margin-bottom: 3px;
    display: block;
}

.chat-bubble.mine .chat-user-link {
    color: #c7d2fe;
    text-align: right;
}

.chat-user-link:hover {
    text-decoration: underline;
    color: #38bdf8;
}

/* WhatsApp Style Voice Note Player */
.custom-voice-player {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    border-radius: 20px;
    min-width: 180px;
    max-width: 220px;
    margin-top: 5px;
}

.vn-play-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #38bdf8;
    color: #0f172a;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
    font-weight: bold;
}

.chat-bubble.mine .vn-play-btn {
    background: #ffffff;
    color: #4f46e5;
}

.vn-waveform-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.vn-waveform-bars {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 16px;
}

.vn-bar {
    flex: 1;
    width: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    height: 40%;
    transition: background 0.2s, height 0.2s;
}

.vn-bar.active {
    background: #38bdf8;
}

.chat-bubble.mine .vn-bar.active {
    background: #ffffff;
}

.vn-timer {
    font-size: 10px;
    color: #94a3b8;
}

.chat-bubble.mine .vn-timer {
    color: #c7d2fe;
}

/* Shared Media Formatting */
.chat-media {
    margin-top: 6px;
    max-width: 100%;
}

.chat-media img {
    max-width: 100%;
    max-height: 250px;
    border-radius: 8px;
    display: block;
    object-fit: cover;
}

.chat-media video {
    max-width: 100%;
    max-height: 220px;
    border-radius: 8px;
}

.fancy-chat-footer {
    padding: 12px 15px;
    background: #1e293b;
    border-top: 1px solid #334155;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-input-row input[type="text"] {
    flex: 1;
    padding: 10px 14px;
    background: #0f172a;
    border: 1px solid #334155;
    color: #fff;
    border-radius: 20px;
    outline: none;
    font-size: 13px;
    min-width: 0;
}

.chat-input-row input[type="text"]:focus {
    border-color: #4f46e5;
}

.chat-btn {
    background: #334155;
    border: none;
    color: #cbd5e1;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    transition: background 0.2s;
}

.chat-btn:hover {
    background: #475569;
    color: #fff;
}

.chat-btn.send-btn {
    background: #4f46e5;
    color: #fff;
}

.chat-btn.send-btn:hover {
    background: #4338ca;
}

.chat-btn.recording {
    background: #ef4444;
    color: #fff;
    animation: pulse 1.5s infinite;
}

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

.emoji-picker-box {
    display: none;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 8px;
    gap: 6px;
    flex-wrap: wrap;
    max-height: 90px;
    overflow-y: auto;
}

.emoji-item {
    font-size: 18px;
    cursor: pointer;
    user-select: none;
}

.preview-attachment {
    font-size: 11px;
    color: #34d399;
    display: none;
    align-items: center;
    gap: 5px;
}

.preview-attachment a {
    color: #ef4444;
    text-decoration: none;
    font-weight: bold;
}

@media (max-width: 768px) {
    .fancy-chat-container {
        height: 480px;
    }
}