/* assets/css/messages.css - Additional styling for messaging system */

/* Chat container animations */
#messages-container {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f7fafc;
}

#messages-container::-webkit-scrollbar {
    width: 6px;
}

#messages-container::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 3px;
}

#messages-container::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

#messages-container::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Message bubble animations */
.message-bubble {
    animation: slideInUp 0.3s ease-out;
    transform-origin: bottom;
}

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

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: #f1f5f9;
    border-radius: 18px;
    margin: 10px 0;
    max-width: 80px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #64748b;
    margin: 0 2px;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

/* Message status indicators */
.message-status {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 2px;
}

.message-status.sent {
    color: #6b7280;
}

.message-status.delivered {
    color: #10b981;
}

.message-status.read {
    color: #3b82f6;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    #messages-container {
        height: 300px;
    }
    
    .message-bubble {
        max-width: 85%;
    }
    
    #message-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    #messages-container {
        background-color: #1f2937;
        border-color: #374151;
    }
    
    .message-bubble.sender {
        background-color: #3b82f6;
        color: white;
    }
    
    .message-bubble.receiver {
        background-color: #374151;
        color: #f9fafb;
    }
    
    #message-input {
        background-color: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    #message-input::placeholder {
        color: #9ca3af;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.notification.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.notification.info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

/* Message timestamp hover effect */
.message-timestamp {
    transition: opacity 0.2s ease;
    opacity: 0.7;
}

.message-bubble:hover .message-timestamp {
    opacity: 1;
}

/* Character counter animations */
.char-counter {
    transition: color 0.2s ease;
}

.char-counter.warning {
    color: #f59e0b;
    animation: pulse 1s infinite;
}

.char-counter.danger {
    color: #ef4444;
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Empty state styling */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.empty-state svg {
    margin: 0 auto 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
    margin: 0;
}

/* Focus states for accessibility */
#message-input:focus,
#send-message-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .message-bubble {
        border: 2px solid currentColor;
    }
    
    .message-bubble.sender {
        background-color: #0000ff;
        color: #ffffff;
    }
    
    .message-bubble.receiver {
        background-color: #ffffff;
        color: #000000;
        border-color: #000000;
    }
}




