/* Global Styles */
:root {
    --primary-color: #4a6fa5;
    --secondary-color: #166088;
    --accent-color: #4fc3f7;
    --text-color: #333;
    --light-text: #f5f5f5;
    --bg-color: #f9f9f9;
    --sidebar-bg: #ffffff;
    --message-bg: #e6f7ff;
    --own-message-bg: #dcf8c6;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

/* App Container */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
}

.app-header {
    padding: 20px;
    background-color: var(--primary-color);
    color: var(--light-text);
    text-align: center;
}

.app-header h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.user-profile {
    padding: 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.profile-pic {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    margin-right: 15px;
}

.user-info {
    flex-grow: 1;
}

.sidebar-menu {
    padding: 15px;
}

.menu-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: none;
    border-radius: 5px;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.menu-btn i {
    margin-right: 10px;
}

.menu-btn:hover {
    background-color: var(--secondary-color);
}

.chat-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
}

.chat-item {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.chat-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.chat-item.active {
    background-color: var(--message-bg);
}

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background-color: var(--bg-color);
}

.welcome-content {
    text-align: center;
    padding: 30px;
    border-radius: 10px;
    background-color: white;
    box-shadow: var(--shadow);
    max-width: 500px;
}

.welcome-content h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.welcome-content p {
    margin-bottom: 10px;
}

/* Auth Container */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background-color: var(--bg-color);
}

.auth-form {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    width: 400px;
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 16px;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

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

/* Chat Container */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    padding: 15px 20px;
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.messages-container {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: var(--bg-color);
}

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

.message.received {
    background-color: var(--message-bg);
    align-self: flex-start;
    border-bottom-left-radius: 0;
}

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

.message-info {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
    display: flex;
    justify-content: space-between;
}

.message-input {
    padding: 15px;
    background-color: white;
    border-top: 1px solid var(--border-color);
}

.message-input form {
    display: flex;
}

.message-input input {
    flex-grow: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    font-size: 16px;
    margin-right: 10px;
}

.message-input button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 18px;
    transition: background-color 0.3s;
}

.message-input button:hover {
    background-color: var(--secondary-color);
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    background-color: #333;
    color: white;
    box-shadow: var(--shadow);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1000;
}

.notification.show {
    opacity: 1;
}

.notification.success {
    background-color: #4caf50;
}

.notification.error {
    background-color: #f44336;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 200px;
        overflow-y: auto;
    }
    
    .chat-list {
        display: flex;
        overflow-x: auto;
        padding: 10px;
    }
    
    .chat-item {
        min-width: 150px;
        margin-right: 10px;
    }
    
    .message {
        max-width: 85%;
    }
}