/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header styles */
.header {
    text-align: center;
    padding: 40px 0;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border-radius: 10px;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Main content styles */
.main-content {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.welcome-section {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.welcome-section p {
    font-size: 1.1rem;
    margin-bottom: 30px;
}

/* Features section */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.feature-item {
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-item h3 {
    color: #4f46e5;
    margin-bottom: 10px;
}

/* Button styles */
.cta-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 30px 0;
}

.btn {
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #4f46e5;
    color: white;
}

.btn-primary:hover {
    background-color: #4338ca;
}

.btn-secondary {
    background-color: #6366f1;
    color: white;
}

.btn-secondary:hover {
    background-color: #4f46e5;
}

.btn-outline {
    border: 2px solid #4f46e5;
    color: #4f46e5;
}

.btn-outline:hover {
    background-color: #4f46e5;
    color: white;
}

/* Footer styles */
.footer {
    text-align: center;
    padding: 20px 0;
    color: #666;
    margin-top: 40px;
}

/* Responsive design */
@media (max-width: 768px) {
    .header {
        padding: 30px 0;
    }

    .header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .main-content {
        padding: 20px;
    }

    .features {
        grid-template-columns: 1fr;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
}

/* Message Styles */
.message {
    display: flex;
    margin-bottom: 1rem;
    position: relative;
    max-width: 70%;
}

.message.sent {
    margin-left: auto;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin: 0 8px;
    object-fit: cover;
}

.message-bubble {
    background: white;
    padding: 8px 12px;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
}

.message.sent .message-bubble {
    background: #4f46e5;
    color: white;
}

.message-sender {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: #666;
}

.message.sent .message-sender {
    color: #fff;
}

.message-content {
    position: relative;
}

.message-body {
    word-break: break-word;
}

.message-text {
    margin-bottom: 4px;
}

.message-image {
    max-width: 300px;
    border-radius: 8px;
    margin-top: 4px;
}

.message-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
    font-size: 0.75rem;
}

.message-time {
    color: #666;
    font-size: 0.75rem;
}

.message.sent .message-time {
    color: rgba(255, 255, 255, 0.8);
}

/* Message Actions Styles */
.message-actions {
    position: relative;
    display: inline-block;
    margin-left: 8px;
}

.action-button {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #54656f;
    opacity: 1;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.message.sent .action-button {
    color: #54656f;
}

.message:hover .action-button {
    opacity: 1;
}

.action-button:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.message-actions-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 4px 0;
    min-width: 150px;
    display: none;
    z-index: 1000;
}

.message.sent .message-actions-menu {
    background: #fff;
}

.message-actions-menu.show {
    display: block;
}

.message-actions-menu button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 16px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    color: #333;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.message-actions-menu button:hover {
    background-color: #f5f5f5;
}

.message-actions-menu button i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
    font-size: 0.9rem;
}

/* Edit Message Form */
.edit-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.save-button, .cancel-button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 8px;
    font-size: 0.9rem;
}

.save-button {
    background-color: #4CAF50;
    color: white;
}

.cancel-button {
    background-color: #f44336;
    color: white;
}

/* Forward Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 16px;
}

.user-list {
    max-height: 300px;
    overflow-y: auto;
    margin: 16px 0;
}

.user-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.user-item img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin: 0 12px;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

.modal-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.modal-buttons button:first-child {
    background-color: #f5f5f5;
    color: #333;
}

.modal-buttons button:last-child {
    background-color: #4CAF50;
    color: white;
}

/* Success and Error Messages */
.success-message, .error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 4px;
    color: white;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.success-message {
    background-color: #4CAF50;
}

.error-message {
    background-color: #f44336;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}