:root {
    --primary: #00f3ff;
    --secondary: #bc13fe;
    --bg: #0a0a12;
    --text: #ffffff;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(0, 0, 0, 0.3);
}

* {
    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: var(--bg);
    color: var(--text);
    overflow: hidden; /* Prevent body scroll */
    height: 100vh;
    height: 100dvh; /* Dynamic Viewport Height for mobile */
    display: flex;
    flex-direction: column;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}
::-webkit-scrollbar-track {
    background: transparent;
}

/* Utils */
.btn {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    border: none;
    padding: 10px 20px;
    color: #fff;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 15px var(--primary);
    transition: 0.3s;
}

.btn:hover {
    box-shadow: 0 0 25px var(--secondary);
    transform: scale(1.05);
}

.input-futuristic {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    padding: 12px;
    border-radius: 10px;
    color: white;
    width: 100%;
    margin-bottom: 10px;
    transition: 0.3s;
}

.input-futuristic:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary);
    outline: none;
}

/* Layouts */
.full-screen-center {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: radial-gradient(circle at center, #1a1a2e 0%, var(--bg) 70%);
}

.card {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    opacity: 1;
    transition: opacity 0.3s;
}
.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    display: flex; /* Keep display flex to allow transition, just hide opacity/events */
}

.modal-box {
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid var(--primary);
    padding: 25px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.2);
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-overlay.hidden .modal-box {
    transform: scale(0.8);
}

.modal-actions {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
}
.app-container {
    display: flex;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    overflow: hidden;
}

.sidebar {
    width: 350px;
    background: rgba(0,0,0,0.2);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at top right, rgba(0, 243, 255, 0.05), transparent 40%);
    position: relative;
}

/* Mobile Responsive */
#back-btn {
    display: none;
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: absolute;
        z-index: 10;
        height: 100%;
        background: var(--bg);
        transition: transform 0.3s;
    }
    .sidebar.hidden {
        transform: translateX(-100%);
    }
    .chat-area {
        width: 100%;
    }
    #back-btn {
        display: block;
    }
}

/* Chat Items */
.group-item {
    padding: 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    cursor: pointer;
    transition: 0.2s;
}
.group-item:hover {
    background: var(--glass);
}
.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #333;
    margin-right: 15px;
    object-fit: cover;
    border: 2px solid var(--primary);
}

/* Messages */
.messages-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.message {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 15px;
    background: var(--glass);
    position: relative;
    word-wrap: break-word;
}
.message.mine {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(0, 243, 255, 0.2), rgba(188, 19, 254, 0.2));
    border: 1px solid var(--primary);
}
.message-meta {
    font-size: 0.7em;
    opacity: 0.7;
    margin-bottom: 3px;
    display: block;
}
.message-content {
    font-size: 1em;
}

/* Rich Text Styles */
.rt-bold { font-weight: bold; }
.rt-italic { font-style: italic; }
.rt-mono { font-family: monospace; background: #000; padding: 2px 5px; border-radius: 3px; }

/* Input Area */
.chat-input-area {
    padding: 15px;
    background: rgba(0,0,0,0.8); /* Darker bg for better visibility */
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--glass-border);
    flex-shrink: 0; /* Prevent shrinking */
}
.media-btn {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
}

/* Animations */
@keyframes neonPulse {
    0% { box-shadow: 0 0 5px var(--primary); }
    50% { box-shadow: 0 0 20px var(--primary), 0 0 10px var(--secondary); }
    100% { box-shadow: 0 0 5px var(--primary); }
}

.neon-text {
    text-shadow: 0 0 10px var(--primary);
}

/* Stats on Landing */
.stats-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    justify-content: center;
}
.stat-box {
    background: var(--glass);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--secondary);
}
.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: var(--primary);
}

/* Utilities */
.hidden {
    display: none !important;
}
