* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    height: 100vh;
    background: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Auth Containers */
.auth-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.auth-container h1 {
    margin-bottom: 20px;
    color: #075e54;
}

.auth-container input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.auth-container button {
    padding: 10px 20px;
    background: #075e54;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.auth-container p {
    margin-top: 15px;
}

.auth-container a {
    color: #075e54;
    text-decoration: none;
}

/* App Container */
.app-container {
    width: 100%;
    height: 100vh;
    max-width: 1400px;
}

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

/* Sidebar (User List) */
.sidebar {
    width: 30%;
    min-width: 250px;
    background: #f8f9fa;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 15px;
    background: #075e54;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-buttons {
    display: flex;
    gap: 10px;
}

.profile-logo {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: white;
}

.logout-btn {
    background: #d32f2f;
    border: none;
    padding: 5px 10px;
    color: white;
    border-radius: 5px;
    cursor: pointer;
}

.search-box {
    padding: 10px;
}

.search-box input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.user-list {
    flex: 1;
    overflow-y: auto;
}

.user-item {
    padding: 15px;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
}

.user-item:hover {
    background: #e9ecef;
}

.user-item.active {
    background: #075e54;
    color: white;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.chat-header {
    padding: 15px;
    background: #075e54;
    color: white;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.chat-header-content {
    display: flex;
    flex-direction: column;
}

.user-status {
    font-size: 12px;
    color: #d1d1d1;
}

.user-status.online {
    color: #34c759; /* Green for online */
}

.user-status.offline {
    color: #ff3b30; /* Red for offline */
}

.back-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: none;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #e5ddd5;
    min-height: 0;
}

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

.message.sent {
    background: #dcf8c6;
    margin-left: auto;
}

.message.received {
    background: white;
}

.chat-input {
    padding: 10px;
    display: flex;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
    flex-shrink: 0;
}

.chat-input input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-right: 10px;
    min-width: 0;
}

.chat-input button {
    padding: 8px 15px;
    background: #075e54;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Popup Styles */
.popup {
    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;
}

.popup-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 300px;
    width: 90%;
}

.popup-content h3 {
    margin-bottom: 15px;
    color: #075e54;
}

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

.popup-content button {
    padding: 10px 20px;
    background: #075e54;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .app-container {
        overflow: hidden;
    }
    .chat-container {
        position: relative;
        height: 100vh;
    }
    .sidebar {
        width: 100%;
        height: 100%;
        min-width: 0;
        transform: translateX(0);
        position: absolute;
        z-index: 1;
    }
    .chat-area {
        width: 100%;
        height: 100%;
        transform: translateX(100%);
        position: absolute;
        z-index: 2;
    }
    .chat-area.active {
        transform: translateX(0);
    }
    .back-btn {
        display: block;
    }
    .user-list {
        height: calc(100% - 110px);
    }
    .chat-header {
        height: 60px;
    }
    .chat-messages {
        height: calc(100% - 120px);
    }
    .chat-input {
        height: 60px;
        margin-bottom: 50px;
    }
}