/* Global Styles */
:root {
    --primary-color: #128C7E;
    --secondary-color: #25D366;
    --light-color: #DCF8C6;
    --dark-color: #075E54;
    --message-out-bg: #DCF8C6;
    --message-in-bg: #FFFFFF;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
}

/* Chat Styles */
.chat-container {
    max-width: 1200px;
    height: 100vh;
    background: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.chat-sidebar {
    border-right: 1px solid #e0e0e0;
    height: 100%;
    overflow-y: auto;
}

.sidebar-header {
    background-color: #f0f0f0;
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.chat-list-item {
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.chat-list-item:hover {
    background-color: #f5f5f5;
}

.chat-list-item.active {
    background-color: #e8f5fe;
}

.chat-list-item .unread-badge {
    background-color: var(--secondary-color);
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.profile-pic {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.small-profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.chat-header {
    background-color: #f0f0f0;
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #e4ddd6;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23bbb8b8' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
}

.message {
    max-width: 75%;
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 10px;
    position: relative;
}

.message.outgoing {
    align-self: flex-end;
    background-color: var(--message-out-bg);
    margin-left: auto;
    border-top-right-radius: 0;
}

.message.incoming {
    align-self: flex-start;
    background-color: var(--message-in-bg);
    margin-right: auto;
    border-top-left-radius: 0;
}

.message .message-time {
    font-size: 11px;
    color: #999;
    text-align: right;
    margin-top: 5px;
}

.message .message-status {
    display: inline-block;
    margin-left: 5px;
    font-size: 14px;
}

.message .message-status.sent {
    color: #999;
}

.message .message-status.delivered {
    color: #999;
}

.message .message-status.read {
    color: #4fc3f7;
}

.message .message-image {
    max-width: 100%;
    border-radius: 5px;
    margin-top: 5px;
}

.input-group .attachment-btn {
    background-color: transparent;
    border: none;
    color: #666;
}

.typing-indicator {
    color: #666;
    font-style: italic;
    padding: 5px 10px;
}

/* Login/Register Styles */
.auth-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
}

.auth-logo {
    font-size: 3rem;
    color: var(--primary-color);
}

/* Profile Styles */
.profile-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.profile-header {
    text-align: center;
    margin-bottom: 30px;
}

.large-profile-pic {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 20px;
    display: block;
}

/* Custom Overrides */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--dark-color);
    border-color: var(--dark-color);
}

.text-primary {
    color: var(--primary-color) !important;
}

/* Responsive Fixes */
@media (max-width: 767.98px) {
    .chat-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
        background: white;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .chat-sidebar.show {
        transform: translateX(0);
    }
    
    .back-to-chats {
        display: block !important;
    }
}

@media (min-width: 768px) {
    .mobile-only {
        display: none !important;
    }
}
