/* ============================================
   Chat Widget (Sidebar Full Height)
   ============================================ */
.chat-widget {
    position: fixed;
    top: 0;
    right: 0;
    width: 350px;
    height: 100vh;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(25px);
    border-left: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

.chat-widget.minimized {
    transform: translateX(100%);
    box-shadow: none;
}

.chat-header {
    background: var(--gradient-gold);
    color: #1a1040;
    padding: 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-weight: 800;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.chat-toggle-btn {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 45px;
    height: 70px;
    background: var(--gradient-gold);
    border-radius: 15px 0 0 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1040;
    cursor: pointer;
    z-index: 2999;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.4);
    transition: all 0.4s ease;
}

.chat-widget:not(.minimized)~.chat-toggle-btn {
    right: 350px;
}

.chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.conversation-list,
.message-history {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.conv-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
    border: 1px solid transparent;
}

.conv-item:hover {
    background: rgba(212, 175, 55, 0.05);
    border-color: rgba(212, 175, 55, 0.2);
}

.conv-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-gold);
}

.conv-info {
    flex: 1;
    min-width: 0;
}

.conv-name {
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
}

.conv-last {
    color: var(--text-secondary);
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unread-dot {
    width: 10px;
    height: 10px;
    background: var(--ruby-red);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--ruby-red);
}

.chat-footer {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
}

.chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 10px 18px;
    color: white;
    font-size: 0.9rem;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary-gold);
}

.chat-btn {
    background: none;
    border: none;
    color: var(--primary-gold);
    cursor: pointer;
    font-size: 1.2rem;
    transition: transform 0.2s;
}

.chat-btn:hover {
    transform: scale(1.1);
}

.back-btn {
    margin-right: 12px;
    color: #1a1040;
    cursor: pointer;
}

.mini-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 15px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.mini-msg.sent {
    align-self: flex-end;
    background: var(--gradient-gold);
    color: #1a1040;
    border-bottom-right-radius: 2px;
    font-weight: 500;
}

.mini-msg.received {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-bottom-left-radius: 2px;
}

.mini-msg-media {
    max-width: 100%;
    border-radius: 10px;
    margin-top: 5px;
}
/* Message Status */
.msg-status {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 4px;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.6);
}

.msg-status.read {
    color: #60A5FA; /* Blue */
}

/* Media & File Types */
.mini-msg-file {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.1);
    padding: 10px;
    border-radius: 8px;
    margin-top: 5px;
    text-decoration: none;
    color: white;
    transition: background 0.2s;
}

.mini-msg-file:hover {
    background: rgba(255,255,255,0.2);
}

.mini-msg-file i {
    font-size: 1.5rem;
    color: var(--primary-gold);
}

/* Recording UI */
.recording-ui {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    padding: 0 10px;
    color: #ef4444;
}

.waveform {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 20px;
    flex: 1;
}

.wave-bar {
    width: 3px;
    background: #ef4444;
    border-radius: 3px;
    animation: wave 0.5s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { height: 20%; }
    50% { height: 100%; }
}

/* Input Actions */
.chat-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.preview-container {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    padding: 10px;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 10;
}

.preview-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.1);
    padding: 8px;
    border-radius: 8px;
}

.preview-remove {
    color: #ef4444;
    cursor: pointer;
}
