@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

:root {
    --bg-color: #121212;
    --surface-color: #1e1e1e;
    --primary-color: #ff477e;
    --primary-hover: #ff7096;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --success: #06d6a0;
    --danger: #ef476f;
    --border: #333333;
}

* { box-sizing: border-box; font-family: 'Poppins', sans-serif; }
body { margin: 0; background-color: var(--bg-color); color: var(--text-main); text-align: center; }

/* Top Header */
.header-bar { 
    background-color: var(--surface-color); 
    padding: 15px 25px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    font-weight: 600; 
    font-size: 18px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    border-bottom: 1px solid var(--border);
}
.dot { height: 12px; width: 12px; background-color: var(--success); border-radius: 50%; display: inline-block; margin-right: 8px; vertical-align: middle; box-shadow: 0 0 8px var(--success); }
.menu-icon { font-size: 28px; color: var(--text-main); cursor: pointer; }

/* The Big Circle Button */
.status-circle { 
    width: 200px; 
    height: 200px; 
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin: 80px auto; 
    color: white; 
    cursor: pointer; 
    font-size: 22px; 
    font-weight: 700;
    transition: all 0.3s ease; 
    box-shadow: 0px 10px 30px rgba(255, 71, 126, 0.4); 
}
.status-circle:hover {
    transform: scale(1.05);
    box-shadow: 0px 15px 40px rgba(255, 71, 126, 0.6); 
}

/* Chat Icon Container */
.chat-icon-container { 
    position: fixed; 
    bottom: 30px; 
    left: 20px; 
    z-index: 90; 
}
#chat-btn {
    background: var(--surface-color);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 65px;
    height: 65px;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(0,0,0,0.4);
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
#chat-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* The Bottom Controls */
.control-panel { display: flex; justify-content: center; gap: 20px; margin-top: 50px; align-items: center; }
.ctrl-btn { 
    background: var(--surface-color); 
    border: 1px solid var(--border); 
    font-size: 14px; 
    cursor: pointer; 
    color: var(--text-main); 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    width: 85px;
    height: 85px;
    padding: 10px;
    border-radius: 16px;
    transition: 0.3s;
    box-sizing: border-box;
}
.ctrl-btn span { font-size: 24px; margin-bottom: 5px; } /* Assuming we wrap icons in span, but let's just use text */
.ctrl-btn:hover { background: #2a2a2a; transform: translateY(-3px); }

/* Specific Button Colors & States */
#end-call-btn { background-color: var(--danger); color: white; border: none; font-size: 16px; font-weight: bold; }
#end-call-btn.inactive { background-color: #552222; color: #aaa; cursor: not-allowed; box-shadow: none; pointer-events: none; }
#end-call-btn:not(.inactive):hover { background-color: #ff1e56; box-shadow: 0 5px 15px rgba(239, 71, 111, 0.4); }
.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* Chat Popup UI */
#chat-popup { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%); width: 92%; max-width: 400px; background: var(--surface-color); border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.8); display: flex; flex-direction: column; z-index: 100; overflow: hidden; border: 1px solid var(--border); }
.chat-header { background: var(--bg-color); color: white; padding: 15px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.chat-header h3 { margin: 0; font-size: 16px; font-weight: 600;}
#close-chat-btn { background: none; border: none; color: var(--text-muted); font-weight: bold; cursor: pointer; font-size: 18px; transition: 0.3s; }
#close-chat-btn:hover { color: var(--danger); }
#chat-messages { height: 300px; overflow-y: auto; padding: 15px; display: flex; flex-direction: column; gap: 10px; background: var(--bg-color); text-align: left; }

/* Chat Bubbles */
.chat-msg { padding: 10px 15px; border-radius: 18px; max-width: 85%; word-wrap: break-word; font-size: 14px; line-height: 1.4; }
.msg-sent { align-self: flex-end; background: var(--primary-color); color: white; border-bottom-right-radius: 4px; }
.msg-recv { align-self: flex-start; background: #333333; color: var(--text-main); border-bottom-left-radius: 4px; }
.chat-img { max-width: 200px; border-radius: 12px; cursor: pointer; margin-top: 5px; border: 2px solid transparent; }

/* Chat Input Area */
.chat-input-area { display: flex; padding: 12px; border-top: 1px solid var(--border); background: var(--surface-color); align-items: center; gap: 8px;}
#chat-input { flex-grow: 1; padding: 10px 15px; background: var(--bg-color); border: 1px solid var(--border); border-radius: 20px; outline: none; color: var(--text-main); }
#chat-input::placeholder { color: var(--text-muted); }
#send-chat-btn, #attach-img-btn { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--primary-color); transition: 0.3s; }
#send-chat-btn:hover, #attach-img-btn:hover { transform: scale(1.1); }

/* Image Lightbox Modal */
#image-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 200; display: flex; align-items: center; justify-content: center; }
#full-image { max-width: 95%; max-height: 85%; border-radius: 10px; box-shadow: 0 0 30px rgba(0,0,0,0.5); }
#close-image-btn { position: absolute; top: 20px; right: 30px; color: white; font-size: 40px; cursor: pointer; font-weight: bold; }

/* History Modal UI */
#history-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 92%; max-width: 400px; background: var(--surface-color); border-radius: 15px; box-shadow: 0 10px 40px rgba(0,0,0,0.8); display: flex; flex-direction: column; z-index: 150; overflow: hidden; border: 1px solid var(--border); }
.history-header { background: var(--bg-color); color: white; padding: 15px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.history-header h3 { margin: 0; font-size: 16px; }
#close-history-btn { background: none; border: none; color: var(--text-muted); font-weight: bold; cursor: pointer; font-size: 18px; transition: 0.2s;}
#close-history-btn:hover { color: var(--danger); }
#history-list { max-height: 350px; overflow-y: auto; padding: 15px; display: flex; flex-direction: column; gap: 12px; background: var(--bg-color); }

/* Individual History Item */
.history-item { background: var(--surface-color); padding: 12px 15px; border-radius: 12px; border: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; transition: 0.2s; }
.history-item:hover { border-color: #555; }
.history-item-info { text-align: left; }
.history-item-name { font-weight: 600; color: var(--text-main); font-size: 15px; margin-bottom: 4px;}
.history-item-status { font-size: 12px; font-weight: 600; }
.status-online { color: var(--success); }
.status-offline { color: var(--text-muted); }
.reconnect-btn { background-color: var(--primary-color); color: white; border: none; padding: 8px 16px; border-radius: 20px; cursor: pointer; font-weight: 600; transition: 0.3s; }
.reconnect-btn:hover:not(:disabled) { background-color: var(--primary-hover); transform: scale(1.05); }
.reconnect-btn:disabled { background-color: #444; color: #888; cursor: not-allowed; }

/* Welcome & Gender Screens */
#welcome-screen, #gender-screen {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: var(--surface-color); padding: 30px; border-radius: 15px;
    width: 90%; max-width: 400px; border: 1px solid var(--border);
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}
#welcome-screen h1, #gender-screen h2 { margin-top: 0; color: var(--primary-color); }
#join-btn, .gender-btn { 
    background: var(--primary-color); color: white; border: none; padding: 12px 20px; 
    border-radius: 25px; font-size: 16px; font-weight: bold; cursor: pointer; margin: 10px;
    transition: 0.3s; box-shadow: 0 4px 15px rgba(255, 71, 126, 0.3);
}
#join-btn:hover, .gender-btn:hover { background: var(--primary-hover); transform: translateY(-2px); }

/* Scrollbars */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: #444; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #666; }