
.message-panel {
    display: flex;
    flex-direction: column;
    height: 100vh;
	background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.main-content {
    text-align: center;
    padding: 40px;
}

.main-content h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    opacity: 0.9;
}

.main-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.8;
}

.open-chat-btn {
    padding: 10px 30px;
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.open-chat-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.chat-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.chat-modal-overlay.show {
    display: flex;
    opacity: 1;
}

.chat-modal {
    max-width: 900px;
/*    height: 80vh;*/
    max-height: 700px;
    background: #0f0f0f;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    /*display: flex;
    flex-direction: column;*/
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-modal-overlay.show .chat-modal {
    transform: scale(1);
}

.chat-modal.light-theme {
    background: #f5f7fa;
    color: #333;
}

.chat-header {
    background: linear-gradient(135deg, #19359b 0%, #19359b 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.header-left {
    display: flex;
    align-items: center;
}

.header-right {
    display: flex;
    gap: 15px;
    align-items: center;
}

.theme-toggle, .settings-btn, .close-modal-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 16px;
}

.theme-toggle:hover, .settings-btn:hover, .close-modal-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.chat-header .avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b, #ffd93d);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 18px;
    position: relative;
}

.status-indicator::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #00ff88;
    border-radius: 50%;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(0, 255, 136, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}

.typing-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    margin-left: 15px;
    color: rgba(255,255,255,0.8);
    font-size: 14px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: rgba(255,255,255,0.8);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

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

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
/*     background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); */
    position: relative;
    color: white;
}

.light-theme .chat-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #dee2e6 100%);
    color: #333;
}

.message {
    display: flex;
    margin-bottom: 20px;
    animation: slideIn 0.4s ease;
    opacity: 0;
    animation-fill-mode: forwards;
}

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

.message.sent {
    justify-content: flex-end;
}

.sent .message-content {
    flex-direction: row-reverse;
}

.message-content {
    max-width: 70%;
    display: flex;
    align-items: flex-start;
}

.avatar {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    margin: 0 12px;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.avatar-image {
	width: 25px;
    height: 25px;
    border-radius: 50%;
}
.avatar.sender {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.avatar.receiver {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.message-bubble {
    position: relative;
    padding: 15px 18px;
    border-radius: 20px;
    word-wrap: break-word;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: all 0.3s ease;
}

.message-bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}

.sent .message-bubble {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border-bottom-right-radius: 6px;
}

.received .message-bubble {
    background: rgba(255,255,255,0.1);
    color: white;
    border-top-left-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
}

.light-theme .received .message-bubble {
    background: white;
    color: #333;
    border: 1px solid rgba(0,0,0,0.1);
}

.message-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.sent .message-info {
    align-items: flex-end;
}

.sender-name {
    font-size: 12px;
    font-weight: 600;
    opacity: 0.8;
}

.message-text {
    line-height: 1.5;
    font-size: 15px;
    word-break: break-word;
}

.message-time {
    font-size: 11px;
    margin-top: 6px;
    opacity: 0.6;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-input {
    background: transparent;
/*     backdrop-filter: blur(20px); */
    padding: 20px;
/*     border-top: 1px solid rgba(255,255,255,0.1); */
    display: flex;
    align-items: center;
    gap: 15px;
}

.light-theme .chat-input {
    background: white;
    border-top: 1px solid #e0e0e0;
}

.input-container {
    flex: 1;
    position: relative;
}

.chat-input input {
    width: 100%;
    padding: 10px 90px 10px 20px;
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 25px;
    outline: none;
    font-size: 15px;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.1);
    color: white;
}

.light-theme .chat-input input {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    color: #333;
}

.chat-input input::placeholder {
    color: rgba(255,255,255,0.6);
}

.light-theme .chat-input input::placeholder {
    color: #999;
}

.chat-input input:focus {
    border-color: #007bff;
    box-shadow: 0 0 20px rgba(0,123,255,0.3);
}

.emoji-btn, .image-upload-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-btn { right: 15px; }
.image-upload-btn { right: 55px; }

.light-theme .emoji-btn, .light-theme .image-upload-btn {
    color: #999;
}

.emoji-btn:hover, .image-upload-btn:hover {
    color: #007bff;
    background: rgba(0,123,255,0.1);
    transform: translateY(-50%) scale(1.1);
}

.send-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 16px;
}

.send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0,123,255,0.4);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.file-input { display: none; }

.image-preview {
    max-width: 90px;
    max-height: 60px;
    border-radius: 3px;
    margin: 8px 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-upload-preview {
    background: rgba(255,255,255,0.1);
    border: 2px dashed rgba(255,255,255,0.3);
    border-radius: 12px;
    padding: 20px;
    margin: 10px 0;
    text-align: center;
    display: none;
}

.light-theme .image-upload-preview {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
}

.image-upload-preview.show {
    display: block;
    animation: slideDown 0.3s ease;
}
.image-upload-preview img {
    max-width: 90px;
    max-height: 60px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.image-upload-preview .preview-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.preview-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.preview-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.preview-btn.remove {
    background: #dc3545;
    color: white;
}

.preview-btn.send {
    background: #28a745;
    color: white;
}

.drag-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,123,255,0.9);
    color: white;
    padding: 30px 40px;
    border-radius: 15px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    display: none;
}

.chat-container.drag-over .drag-overlay {
    display: block;
}

.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20000;
}

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

.image-modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

.image-modal .close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
}

.message-actions {
    position: fixed;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    z-index: 1000;
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.light-theme .message-actions {
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(0,0,0,0.1);
}

.message-actions.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.message-actions button {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: white;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.light-theme .message-actions button {
    color: #333;
}

.message-actions button:hover {
    background: rgba(255,255,255,0.1);
}

.reply-preview {
    background: rgba(0,123,255,0.1);
    border-left: 4px solid #007bff;
    padding: 12px 15px;
    margin-bottom: 12px;
    border-radius: 0 8px 8px 0;
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    display: none;
}

.light-theme .reply-preview {
    background: #e3f2fd;
    color: #666;
}

.reply-preview.show {
    display: block;
}

.reply-preview .reply-header {
    font-weight: 600;
    color: #007bff;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reply-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    font-size: 14px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.light-theme .reply-close {
    color: #999;
}

.reply-close:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.message-reply {
    background: rgba(0,123,255,0.1);
    border-left: 3px solid #007bff;
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 0 8px 8px 0;
    font-size: 13px;
    color: rgba(255,255,255,0.8);
}

.light-theme .message-reply {
    background: #f8f9fa;
    color: #666;
}

.message-reply .reply-author {
    font-weight: 600;
    color: #007bff;
    margin-bottom: 4px;
}

.message-edit-mode .message-text { display: none; }

.message-edit-input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #007bff;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    background: rgba(255,255,255,0.1);
    color: white;
    display: none;
}

.light-theme .message-edit-input {
    background: white;
    color: #333;
}

.message-edit-mode .message-edit-input { display: block; }

.edit-actions {
    margin-top: 10px;
    display: none;
    gap: 10px;
    justify-content: flex-end;
}

.message-edit-mode .edit-actions {
    display: flex;
}

.edit-btn {
    padding: 8px;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-btn.save {
    background: #28a745;
    color: white;
}


.emoji-picker {
    position: absolute;
    bottom: 60px;
    right: 20px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 15px;
    display: none;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    max-width: 280px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.light-theme .emoji-picker {
    background: white;
    border: 1px solid rgba(0,0,0,0.1);
}

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

.emoji-picker span {
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-align: center;
}

.emoji-picker span:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.2);
}

.light-theme .emoji-picker span:hover {
    background: #f0f0f0;
}

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

@media (max-width: 768px) {
    .chat-modal {
        width: 95vw;
        height: 90vh;
        border-radius: 15px;
    }
    .message-content { max-width: 85%; }
    .chat-container { padding: 15px; }
    .avatar { width: 40px; height: 40px; font-size: 14px; }
    .chat-input { padding: 15px; }
    .emoji-picker { max-width: 250px; }
    .main-content h1 { font-size: 2rem; }
    .main-content p { font-size: 1rem; }
}
