@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

html, body {
    height: 100%;
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background-color: #f0f2f5;
}

/* DASHBOARD */
#chatArea.dashboard-view {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.chat-item {
    cursor: pointer;
    padding: 12px 10px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.chat-item strong {
    font-weight: 500;
}

.chat-item small {
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    display: inline-block;
}

.chat-item:hover {
    background: #f5f5f5;
}

.unread-badge {
    background: #25d366;
    color: white;
    border-radius: 50%;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
}

.online-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #25d366;
    border-radius: 50%;
    margin-left: 6px;
    vertical-align: middle;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.connected-person {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.connected-person:hover {
    background-color: #f5f5f5;
}

.delete-chat {
    color: #999;
    cursor: pointer;
    font-size: 0.8rem;
}

#startChatForm {
    margin-bottom: 15px;
}

/* AUTHENTICATION */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.auth-container .card {
    width: 400px;
}

/* CHAT VIEW */
.delete-msg {
    font-size: 0.9rem;
    cursor: pointer;
    color: #999;
    margin-left: 5px;
    visibility: hidden;
}

.bubble:hover .delete-msg {
    visibility: visible;
}

/* NEW LAYOUT */
.main-container {
    display: flex;
    height: 100vh;
}


.sidebar {
    width: 350px;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    background-color: #fff;
}

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f5f5f5;
}

.sidebar-header h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.sidebar-content {
    padding: 15px;
    overflow-y: auto;
    flex-grow: 1;
}

.sidebar-content h5,
.sidebar-content h6 {
    color: #333;
    font-weight: 500;
    margin-top: 20px;
    margin-bottom: 10px;
}

.chat-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.chat-welcome-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
    color: #6c757d;
}

.chat-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}



@media (max-width: 768px) {
    .chat-area {
        display: none;
    }

    .sidebar {
        width: 100%;
    }

    .main-container.chat-open .sidebar {
        display: none;
    }

    .main-container.chat-open .chat-area {
        display: block;
        width: 100%;
    }
}

/* Messages */


/* Message bubbles */
.message {
    margin-bottom: 15px;
}

.bubble {
    padding: 10px 15px;
    border-radius: 7.5px;
    display: inline-block;
    max-width: 75%;
    word-wrap: break-word;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
}

.message.me {
    text-align: right;
}

.message.me .bubble {
    background: #072915 !important;
    color: #ffffff !important;
    text-align: left;
}

.message.them {
    text-align: left;
}

.message.them .bubble {
    background: #ffffff;
}

.time {
    font-size: 0.7rem;
    margin-top: 2px;
    color: #666;
}

.status-icon {
    font-size: 0.8rem;
    margin-left: 5px;
}

.status-icon.read {
    color: #34b7f1;
}

.status-icon.delivered {
    color: #666;
}

/* Chat input */
#chatInput {
    position: relative;
}

emoji-picker {
    position: absolute;
    bottom: 60px;
    left: 10px;
    z-index: 100;
}

/* MOBILE FIXES */
@media (max-width: 768px) {

    /* Hide sidebar when chat is open */
    .chat-open #sidebar {
        display: none;
    }

    .chat-open #chatArea {
        width: 100%;
    }

    .bubble {
        max-width: 90%;
    }

    /* Sticky input */
    #chatInput {
        position: sticky;
        bottom: 0;
    }
}

