/* --- PREVIOUS STYLES REMAIN UNCHANGED --- */
:root {
    --yellow: #FFD700;
    --white: #FFFFFF;
    --border: #E0E0E0;
    --text: #111111;
    --error: #FF3333;
    --admin: #1a1a1a;
}

body {
    background-color: var(--white);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    overflow: hidden;
}

.card {
    width: 380px;
    padding: 40px;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    text-align: center;
    background: white;
}

.logo { font-size: 36px; margin-bottom: 25px; font-weight: 800; }
.yellow-text { color: var(--yellow); }

.toggle-container {
    display: flex;
    margin-bottom: 25px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.auth-tab {
    flex: 1;
    border: none;
    background-color: #FAFAFA;
    color: #888;
    padding: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}

.auth-tab.active-tab {
    background-color: var(--yellow);
    color: var(--text);
}

.input-group { margin-bottom: 18px; text-align: left; }

input[type="text"], input[type="password"] {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 14px;
    outline: none;
}

input[type="text"]:focus, input[type="password"]:focus { border-color: var(--yellow); }

button#enter-btn {
    width: 100%;
    padding: 15px;
    background-color: var(--yellow);
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 16px;
}

#chat-screen {
    width: 1000px;
    height: 700px;
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    background: var(--white);
}

.sidebar {
    width: 300px;
    border-right: 1px solid var(--border);
    background-color: #FBFBFB;
    display: flex;
    flex-direction: column;}

.sidebar-header {
    padding: 25px;
    background-color: var(--yellow);
    font-weight: 800;
    font-size: 20px;
    text-align: center;
}

/* ADMIN PANEL STYLES */
#admin-panel {
    background: var(--admin);
    color: white;
    padding: 15px;
    font-size: 12px;
    border-bottom: 2px solid var(--yellow);
}
.admin-header { font-weight: bold; color: var(--yellow); margin-bottom: 5px; }
.admin-stats { display: flex; justify-content: space-between; margin-bottom: 10px; }
#view-deleted-btn, #view-accounts-btn { 
    width: 100%; background: #333; color: white; border: 1px solid #555; 
    padding: 5px; cursor: pointer; font-size: 10px; border-radius: 4px;
}

.search-container {
    padding: 15px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border);
}

.search-container input {
    border-radius: 8px;
    padding: 10px;
    border: 1px solid var(--border);
    flex-grow: 1;
}

#add-chat-btn {
    width: 45px;
    background: var(--yellow);
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

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

.contact-item {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: 0.2s;
}

.contact-item:hover { background: #F0F0F0; }
.active-contact { background-color: #EDEDED; border-left: 5px solid var(--yellow); }

.logout-style {
    background-color: #EEEEEE;
    border: none;
    padding: 12px;
    margin: 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

.chat-area { flex-grow: 1; display: flex; flex-direction: column; }
.chat-header { padding: 20px; border-bottom: 1px solid var(--border); background: white; }

#message-feed {
    flex-grow: 1;
    padding: 25px;
    overflow-y: auto;
    background-color: #FFFFFF;
    display: flex;
    flex-direction: column;
}

.message {
    margin-bottom: 15px;
    padding: 12px 18px;
    border-radius: 12px;
    max-width: 65%;
    word-wrap: break-word;
    font-size: 15px;
    line-height: 1.4;
    position: relative;
}

.received { background-color: #F1F1F1; align-self: flex-start; }
.sent { background-color: var(--yellow); align-self: flex-end; }
.sent-image { max-width: 100%; border-radius: 8px; margin-top: 8px; display: block; }

.input-area {
    display: flex;
    padding: 20px;
    border-top: 1px solid var(--border);
    align-items: center;
    background: white;
}

.upload-btn {
    cursor: pointer;
    padding: 12px 18px;
    background-color: #F5F5F5;
    border: 2px solid var(--border);
    border-right: none;
    border-radius: 10px 0 0 10px;
    font-size: 20px;
}

#chat-input { flex-grow: 1; border-radius: 0; margin: 0; height: 50px; }
#send-btn { width: 100px; height: 50px; margin: 0; border-radius: 0 10px 10px 0; background: var(--yellow); }

.hidden { display: none !important; }
.hidden-error { display: none; color: var(--error); font-size: 12px; margin-top: 5px; font-weight: 600; }

/* Custom Context Menu */
.hidden-menu { display: none; position: absolute; z-index: 1000; background: white; border: 1px solid var(--border); box-shadow: 0 2px 10px rgba(0,0,0,0.1); border-radius: 5px; width: 150px; }
.menu-item { padding: 10px 15px; cursor: pointer; font-size: 13px; }
.menu-item:hover { background: var(--yellow); }
.delete-item { color: var(--error); border-top: 1px solid #eee; }

/* --- NEW: CUSTOM APP MODALS --- */
.app-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 2000;
    display: flex; justify-content: center; align-items: center;
}
.app-modal-box {
    background: white; width: 450px; max-height: 80vh; border-radius: 12px;
    padding: 25px; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: flex; flex-direction: column; text-align: left;
}
#modal-title { margin-top: 0; margin-bottom: 10px; font-size: 18px; color: var(--text); }
#modal-desc { font-size: 14px; color: #555; margin-bottom: 20px; line-height: 1.5; }
#modal-input { margin-bottom: 20px; width: 100%; }
.modal-buttons { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.modal-btn { padding: 10px 20px; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; }
.cancel-btn { background: #eee; color: #333; }
.confirm-btn { background: var(--yellow); color: var(--text); }

.scrollable-list {
    max-height: 300px; overflow-y: auto; background: #f9f9f9; 
    border: 1px solid var(--border); border-radius: 6px; padding: 10px; margin-bottom: 15px;
}
.log-item { padding: 10px; border-bottom: 1px solid #eee; font-size: 13px; }
.log-item:last-child { border-bottom: none; }
.log-meta { font-size: 10px; color: #888; margin-bottom: 3px; }