/* EMOJI REACTIONS */
.msg-reactions {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}
.msg-reaction {
    background: #232d34;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 18px;
    cursor: pointer;
    user-select: none;
    border: 1px solid #222d34;
    transition: background 0.2s;
}
.msg-reaction:hover {
    background: #2a3a43;
}
#emoji-picker-popup {
    display: flex;
    gap: 8px;
    padding: 8px;
    background: #202c33;
    border: 1px solid #222d34;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    position: absolute;
    z-index: 10001;
}
*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:sans-serif;
}

:root{

    --bg:#0b141a;

    --sidebar:#111b21;

    --hover:#202c33;

    --border:#222d34;

    --accent:#00a884;

    --text:#e9edef;

    --muted:#8696a0;

    --out:#00a884;

    --in:#202c33;

    --danger:#f15c6d;
}

body{

    background:var(--bg);

    color:var(--text);

    width:100%;

    height:100dvh;

    overflow:hidden;
}

button{

    border:none;

    outline:none;

    cursor:pointer;
}

input{

    border:none;

    outline:none;
}

/* AUTOFILL */

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus{

    -webkit-box-shadow:
        0 0 0px 1000px #202c33 inset !important;

    -webkit-text-fill-color:
        white !important;
}

/* AUTH */

#auth-container{

    width:100%;

    height:100dvh;

    display:flex;

    justify-content:center;

    align-items:center;

    background:#0b141a;
}

.auth-card{

    width:400px;

    max-width:95%;

    background:#111b21;

    border:1px solid var(--border);

    border-radius:22px;

    padding:30px;

    display:flex;

    flex-direction:column;

    gap:15px;
}

.logo-area{

    text-align:center;

    margin-bottom:10px;
}

.auth-logo{

    width:90px;

    height:90px;

    border-radius:25px;

    margin-bottom:15px;
}

.logo-area p{

    color:var(--muted);

    margin-top:5px;
}

.auth-card input{

    width:100%;

    background:#202c33;

    color:white;

    padding:15px;

    border-radius:12px;

    font-size:15px;
}

.auth-card button{

    width:100%;

    padding:14px;

    border-radius:12px;

    background:var(--accent);

    color:white;

    font-size:15px;

    font-weight:bold;
}

.auth-divider{

    text-align:center;

    color:var(--muted);

    margin-top:5px;
}

/* APP */

#chat-app{

    width:100%;

    height:100dvh;

    display:flex;
}

/* SIDEBAR */

.sidebar{

    width:380px;

    min-width:380px;

    background:var(--sidebar);

    border-right:1px solid var(--border);

    display:flex;

    flex-direction:column;
}

.sidebar-top{

    padding:15px;

    display:flex;

    justify-content:space-between;

    align-items:center;

    border-bottom:1px solid var(--border);
}

.profile-area{

    display:flex;

    align-items:center;

    gap:12px;
}

.profile-pic{

    width:45px;

    height:45px;

    min-width:45px;

    border-radius:50%;

    object-fit:cover;

    border: 1px solid var(--border);

}

.profile-area h3{
    font-size:15px;
    margin-bottom:2px;
}

.profile-area small{
    color:var(--muted);
    font-size:12px;
}

.sidebar-actions{

    display:flex;

    gap:10px;

    position: relative;
}

.settings-menu {
    position: absolute;
    top: 50px;
    right: 0;
    background: #233138;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    z-index: 2000;
    min-width: 190px;
    padding: 10px 0;
    display: none;
    flex-direction: column;
}

.settings-menu button {
    background: none !important;
    border: none;
    color: #e9edef !important;
    padding: 12px 20px !important;
    text-align: left !important;
    width: 100%;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    border-radius: 0 !important;
}

.settings-menu button:hover {
    background: #182229 !important;
}

.settings-menu .logout-btn {
    color: #f15c6d !important;
}

.sidebar-actions button{

    background:var(--hover);

    color:white;

    padding:10px 12px;

    border-radius:10px;
}

/* STATUS */

.status-tray{
    display:flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap:20px;
    padding:15px;
    overflow-x:auto;
    scrollbar-width:none;
    border-bottom:1px solid var(--border);
    align-items:center;
    width: 100%;
}

.status-tray::-webkit-scrollbar{
    display:none;
}


/* SEARCH */

.search-box{

    padding:12px;
}

.search-box input{

    width:100%;

    background:var(--hover);

    color:white;

    padding:13px;

    border-radius:12px;
}

/* CONTACTS */

#contact-list{

    flex:1;

    overflow-y:auto;
}

.contact-item{

    display:flex;

    gap:12px;

    align-items:center;

    padding:15px;

    cursor:pointer;

    transition:.2s;
}

.contact-item:hover{

    background:var(--hover);
}

.unread-badge {
    background: #00a884;
    color: #111b21;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 11px;
    font-weight: bold;
    padding: 0 6px;
}

.contact-item img{

    width:50px;

    height:50px;

    border-radius:50%;

    object-fit:cover;
}

.contact-status{

    color:var(--muted);

    font-size:13px;

    margin-top:3px;
}

/* CHAT */

.chat-area{

    flex:1;

    display:flex;

    flex-direction:column;

    background:#0b141a;
}

/* TOPBAR */

.chat-topbar{

    height:70px;

    background:#111b21;

    border-bottom:1px solid var(--border);

    display:flex;

    justify-content:space-between;

    align-items:center;

    padding:0 20px;
}

.chat-user{

    display:flex;

    align-items:center;

    gap:12px;
}

.chat-user-pic{

    width:40px;

    height:40px;

    min-width:40px;

    border-radius:50%;

    object-fit:cover;

    border: 1px solid var(--border);

    cursor:pointer;

}

.chat-user small{

    color:var(--muted);
}

.chat-actions{

    display:flex;

    gap:10px;

    align-items:center;
}

.chat-actions button{

    width:45px;

    height:45px;

    border-radius:50%;

    background:var(--hover);

    color:white;

    font-size:18px;
}

/* CHAT BOX */

#chat-box{

    flex:1;

    overflow-y:auto;

    padding:20px;

    display:none; /* Hidden until chat selected */

    flex-direction:column;

    gap:10px;

    background-image:
        url("../assets/wallpapers/chat-bg.png");

    background-size:cover;
}

#welcome-screen{
    flex:1;
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    text-align:center;
    padding:40px;
    background:#0b141a;
}

.welcome-illustration{
    width:250px;
    height:250px;
    margin-bottom:30px;
    opacity:0.8;
}

#welcome-screen h1{
    font-size:32px;
    margin-bottom:10px;
    color:white;
}

#welcome-screen p{
    color:var(--muted);
    font-size:16px;
    max-width:400px;
    line-height:1.5;
}

/* MESSAGE */

.message{

    max-width:75%;

    padding:12px;

    border-radius:15px;

    word-wrap:break-word;

    position:relative;
}

.message.out{

    align-self:flex-end;

    background:var(--out);
}

.message.in{

    align-self:flex-start;

    background:var(--in);
}

.message-time{

    font-size:11px;

    opacity:.7;

    text-align:right;

    margin-top:5px;
}

.tick{
    margin-left:5px;
    font-size:12px;
    color: #8696a0;
}

.tick.seen{
    color: #53bdeb;
}


/* REPLY */

#reply-preview-container{

    background:#202c33;

    padding:10px 15px;

    border-top:1px solid var(--border);

    display:flex;

    justify-content:space-between;

    align-items:center;
}

/* INPUT */

.chat-input-area{

    min-height:70px;

    background:#111b21;

    padding:10px;

    display:flex;

    gap:10px;

    align-items:center;
}

.chat-input-area input[type="text"]{

    flex:1;

    background:#202c33;

    color:white;

    padding:14px;

    border-radius:30px;
}

.chat-input-area button{

    width:45px;

    height:45px;

    border-radius:50%;

    background:var(--accent);

    color:white;

    font-size:18px;

    display:flex;

    justify-content:center;

    align-items:center;
}

/* MODAL */

.modal{

    position:fixed;

    inset:0;

    background:rgba(0,0,0,.7);

    display:flex;

    justify-content:center;

    align-items:center;

    z-index:99999;
}
/* BACK BUTTON */

.back-btn{

    width:40px;

    height:40px;

    border-radius:50%;

    background:var(--hover);

    color:white;

    font-size:20px;

    margin-right:10px;

    display:flex;

    justify-content:center;

    align-items:center;
}

/* SETTINGS MENU */

.settings-btn{

    position:relative;
}

.settings-menu{

    position:absolute;

    top:100%;

    right:0;

    background:#202c33;

    border:1px solid var(--border);

    border-radius:10px;

    padding:5px 0;

    margin-top:10px;

    z-index:1001;

    min-width:150px;
}

.settings-menu button{

    width:100%;

    padding:12px 15px;

    text-align:left;

    background:transparent;

    color:white;

    font-size:14px;
}

.settings-menu button:hover{

    background:var(--hover);
}

.settings-menu .logout-btn{

    color:var(--danger);
}

.settings-menu .logout-btn:hover{

    background:rgba(241, 92, 109, 0.1);
}

/* PROFILE PHOTO MODAL */

.profile-photo-container{

    display:flex;

    flex-direction:column;

    align-items:center;

    gap:20px;
}

.profile-photo-view{

    width:300px;

    height:300px;

    border-radius:15px;

    object-fit:cover;
}

.profile-info{

    text-align:center;

    color:white;
}

.profile-info h2{

    margin-bottom:5px;
}

.profile-info p{

    color:var(--muted);
}
.modal-card{

    width:400px;

    max-width:95%;

    background:#111b21;

    border-radius:20px;

    padding:25px;

    display:flex;

    flex-direction:column;

    gap:15px;
}

.modal-card input{

    background:#202c33;

    color:white;

    padding:14px;

    border-radius:12px;
}

.modal-actions{

    display:flex;

    gap:10px;

    justify-content:flex-end;
}

.modal-actions button{

    padding:12px 16px;

    border-radius:10px;

    background:var(--accent);

    color:white;
}

/* IMAGE */

.full-image{

    max-width:95%;

    max-height:95%;

    border-radius:15px;
}

/* MESSAGE ACTIONS MENU */
.msg-menu{
    position:fixed;
    background:#202c33;
    border:1px solid var(--border);
    border-radius:10px;
    padding:5px 0;
    z-index:10000;
    min-width:180px;
    box-shadow:0 4px 20px rgba(0,0,0,0.5);
}

.msg-menu button{
    width:100%;
    padding:10px 15px;
    text-align:left;
    background:transparent;
    color:white;
    font-size:14px;
    display:block;
}

.msg-menu button:hover{
    background:var(--hover);
}

.msg-menu .danger{
    color:var(--danger);
}

/* PROFILE PHOTO ACTIONS */
.profile-photo-actions{
    display:flex;
    gap:10px;
    margin-top:20px;
}

.profile-action-btn{
    background:var(--accent);
    color:white;
    padding:10px 20px;
    border-radius:20px;
    font-weight:bold;
    font-size:14px;
}

.profile-action-btn.secondary{
    background:var(--hover);
}

/* CHAT SETTINGS MENU */
.chat-settings-menu{
    position:absolute;
    top:60px;
    right:20px;
    background:#202c33;
    border:1px solid var(--border);
    border-radius:10px;
    padding:5px 0;
    z-index:1001;
    min-width:180px;
    display:none;
    flex-direction:column;
}

.chat-settings-menu button{
    width:100%;
    padding:12px 15px;
    text-align:left;
    background:transparent;
    color:white;
    font-size:14px;
}

.chat-settings-menu button:hover{
    background:var(--hover);
}

/* TOAST */

#toast-container{

    position:fixed;

    top:20px;

    right:20px;

    z-index:999999;

    display:flex;

    flex-direction:column;

    gap:10px;
}

.toast{

    background:#202c33;

    color:white;

    padding:14px 18px;

    border-radius:10px;

    animation:fade .25s ease;
}

.toast.error{

    background:var(--danger);
}

@keyframes fade{

    from{

        opacity:0;

        transform:translateY(-10px);
    }

    to{

        opacity:1;

        transform:translateY(0);
    }
}

/* MOBILE */

@media(max-width:900px){

    .sidebar{

        width:100%;

        min-width:100%;
    }

    .chat-area{

        display:none;
    }

    .chat-area.active{

        display:flex;

        position:fixed;

        inset:0;

        z-index:100;
    }

    .back-btn{

        display:flex !important;
    }
}

/* STATUS VIEWER ENHANCEMENTS */
.status-bars{
    position:absolute;
    top:10px;
    left:10px;
    right:10px;
    display:flex;
    gap:5px;
    z-index:20;
}

.status-bar{
    flex:1;
    height:3px;
    background:rgba(255,255,255,0.3);
    border-radius:2px;
    overflow:hidden;
}

.status-bar-inner{
    height:100%;
    background:white;
    width:0%;
}

.status-header{
    position:absolute;
    top:25px;
    left:20px;
    display:flex;
    align-items:center;
    gap:10px;
    z-index:20;
    color:white;
}

.status-header img{
    width:40px;
    height:40px;
    border-radius:50%;
}

.status-reply-area{
    position:absolute;
    bottom:20px;
    left:20px;
    right:20px;
    display:flex;
    gap:10px;
    z-index:20;
}

.status-reply-input{
    flex:1;
    background:rgba(255,255,255,0.1);
    border:1px solid rgba(255,255,255,0.2);
    border-radius:25px;
    padding:12px 20px;
    color:white;
    outline:none;
}

.status-views-info{
    position:absolute;
    bottom:30px;
    left:0;
    right:0;
    text-align:center;
    color:white;
    font-size:18px;
    z-index:20;
    padding:10px;
}