:root {
    --primary-color: #00a884;
    --secondary-color: #f0f2f5;
    --bg-color: #d1d7db;
    --white: #ffffff;
    --chat-bg: #efeae2;
    --incoming-msg: #ffffff;
    --outgoing-msg: #d9fdd3;
    --text-color: #111b21;
    --gray: #8696a0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#app {
    width: 100%;
    height: 100%;
    max-width: 1400px;
    background: var(--white);
    display: flex;
    overflow: hidden;
    position: relative; 
    /* Box shadow for larger screens */
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

@media (min-width: 1440px) {
    #app {
        height: 95vh;
        width: 95vw;
        border-radius: 8px;
    }
}

/* Auth Styles */
.auth-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--secondary-color);
}

.auth-box {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-align: center;
    width: 350px;
}

.auth-box h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.auth-box input {
    width: 100%;
    padding: 10px;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.auth-box button {
    width: 100%;
    padding: 10px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.auth-box p {
    margin-top: 1rem;
    font-size: 0.9rem;
}

.auth-box a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Main App Layout */
.main-container {
    display: flex;
    width: 100%;
    height: 100%;
}

.sidebar {
    width: 30%;
    min-width: 300px;
    border-right: 1px solid #e9edef;
    display: flex;
    flex-direction: column;
    background: var(--white);
}

.chat-area {
    width: 70%;
    display: flex;
    flex-direction: column;
    background: var(--chat-bg);
    position: relative;
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png'); /* WhatsApp-like doodle bg */
    background-size: 300px;
}

/* Sidebar Components */
.header {
    height: 60px;
    background: var(--secondary-color);
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #d1d7db;
}

.user-profile {
    display: flex;
    align-items: center;
    font-weight: bold;
}

.avatar {
    width: 40px;
    height: 40px;
    background: #ccc;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    margin-right: 10px;
    background-color: var(--primary-color);
}

.header button {
    border: none;
    background: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--gray);
}

.user-list {
    flex: 1;
    overflow-y: auto;
}

.user-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f2f5;
}

.user-item:hover {
    background-color: #f5f6f6;
}

.user-item.active {
    background-color: #f0f2f5;
}

.user-item .status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ccc;
    margin-left: auto;
}

.user-item .status.online {
    background-color: #00a884;
}

/* Chat Components */
.chat-header {
    height: 60px;
    background: var(--secondary-color);
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #d1d7db;
}

.messages-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message {
    max-width: 60%;
    padding: 8px 12px;
    border-radius: 8px;
    position: relative;
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.sent {
    background-color: var(--outgoing-msg);
    align-self: flex-end;
    border-top-right-radius: 0;
}

.message.received {
    background-color: var(--incoming-msg);
    align-self: flex-start;
    border-top-left-radius: 0;
}

.message .time {
    font-size: 0.7rem;
    color: var(--gray);
    text-align: right;
    margin-top: 4px;
}

.input-area {
    height: 62px;
    background: var(--secondary-color);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-area input {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    outline: none;
}

.input-area button {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray);
    cursor: pointer;
}

.placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--gray);
}

.placeholder i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #d1d7db;
}

.hidden {
    display: none !important;
}

/* Modals */
.modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    min-width: 300px;
}

.btn-green {
    padding: 10px 20px;
    background: #00a884;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    margin: 0 10px;
}

.btn-red {
    padding: 10px 20px;
    background: #ea0038;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    margin: 0 10px;
}
