/* --- RESET & BASE --- */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
    -webkit-tap-highlight-color: transparent;
}

body { 
    background-color: #e0f7fa; 
    height: 100vh; 
    height: 100dvh; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
}

/* --- AUTH SCREEN --- */
#auth-screen {
    position: fixed; width: 100%; height: 100%; background: #007bff;
    display: flex; justify-content: center; align-items: center; z-index: 1000;
}
.auth-box { 
    background: white; padding: 30px; border-radius: 15px; text-align: center; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); width: 90%; max-width: 350px; 
}
.auth-box input { width: 100%; padding: 12px; margin: 15px 0; border: 2px solid #e0f7fa; border-radius: 8px; font-size: 18px; text-align: center; outline: none;}
.auth-box button { background: #007bff; color: white; border: none; padding: 12px 20px; border-radius: 8px; font-size: 16px; width: 100%; cursor: pointer; font-weight: bold;}

/* --- MAIN APP LAYOUT --- */
#chat-app { 
    display: flex; flex-direction: column; 
    height: 100vh; height: 100dvh; 
    width: 100%; max-width: 600px; 
    margin: 0 auto; background: white; 
    box-shadow: 0 0 20px rgba(0,0,0,0.1); 
}

header { 
    background: #007bff; color: white; padding: 12px 15px; 
    display: flex; justify-content: space-between; align-items: center; 
    z-index: 10;
}
.header-info h2 { font-size: 1.1rem; }
.status { font-size: 11px; color: #b3e5fc; }
.share-btn { background: rgba(255,255,255,0.2); border: none; color: white; padding: 6px 10px; border-radius: 5px; cursor: pointer; font-size: 13px;}

/* --- CHAT WINDOW (LIGHT BLUE BACKGROUND) --- */
#chat-window { 
    flex: 1; padding: 15px; overflow-y: auto; 
    background-color: #d0ebf7 !important; /* Aapka light blue color */
    display: flex; flex-direction: column; gap: 8px; 
}

/* --- MESSAGE ALIGNMENT --- */
.msg-container { 
    display: flex; 
    width: 100%; 
    margin-bottom: 5px;
    animation: popUp 0.3s ease-out forwards;
}

/* HG (Aap) - Right Side */
.msg-container.hg { 
    justify-content: flex-end; 
}

/* JB (Guest) - Left Side */
.msg-container.jb { 
    justify-content: flex-start; 
}

/* --- BUBBLE STYLING (WHITE BOLD TEXT) --- */
.bubble { 
    max-width: 80%; 
    padding: 10px 14px; 
    font-size: 15px; 
    line-height: 1.4; 
    word-wrap: break-word;
    background: #ffffff !important; /* White Background */
    color: #000000 !important; /* Black Text */
    font-weight: bold !important; /* Bold Text */
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    position: relative;
}

/* Bubble Corners HG */
.hg .bubble { 
    border-radius: 18px 18px 2px 18px; 
    border: 1px solid #007bff; 
}

/* Bubble Corners JB */
.jb .bubble { 
    border-radius: 18px 18px 18px 2px; 
    border: 1px solid #ccc; 
}

@keyframes popUp {
    0% { transform: translateY(10px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* --- TYPING & FOOTER --- */
#typing-indicator { 
    padding: 5px 15px; font-size: 12px; color: #007bff; 
    font-weight: bold; font-style: italic; background: #d0ebf7;
}

footer { 
    position: relative; display: flex; padding: 10px; 
    background: white; border-top: 1px solid #e0e0e0; 
    align-items: center; gap: 8px;
}

.icon-btn { background: transparent; border: none; font-size: 22px; cursor: pointer; color: #007bff; }

footer input[type="text"] { 
    flex: 1; padding: 10px 15px; border: 1px solid #ddd; 
    border-radius: 20px; outline: none; font-size: 16px; 
}

.send-btn { 
    background: #007bff; color: white; border: none; 
    width: 40px; height: 40px; border-radius: 50%; 
    font-size: 16px; cursor: pointer; display: flex; 
    justify-content: center; align-items: center;
}

/* --- PANELS (EMOJI & PREVIEW) --- */
#emoji-panel { 
    position: absolute; bottom: 65px; left: 10px; 
    background: white; border-radius: 12px; padding: 10px; 
    display: flex; flex-wrap: wrap; gap: 10px; 
    width: 250px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); z-index: 100; 
}
#emoji-panel span { font-size: 24px; cursor: pointer; }

#attachment-preview { 
    position: absolute; bottom: 65px; left: 10px; 
    background: white; padding: 5px; border-radius: 10px; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); display: flex; gap: 5px; z-index: 99; 
}
#attachment-preview img, #attachment-preview video { max-height: 60px; border-radius: 5px; }
.cancel-btn { background: #ff4d4d; color: white; border: none; border-radius: 50%; width: 20px; height: 20px; font-size: 10px; cursor: pointer; }