@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600;800&family=JetBrains+Mono:wght@500&display=swap');

:root {
    --bg: #030304;
    --surface: #0a0a0e;
    --surface-light: #12121a;
    --primary: #0070f3;
    --primary-glow: rgba(0, 112, 243, 0.4);
    --border: rgba(255, 255, 255, 0.06);
    --text: #ffffff;
    --text-dim: #888891;
    --danger: #ff0055;
    --success: #00ffaa;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: 'Plus Jakarta Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    height: calc(var(--vh, 1vh) * 100);
    width: 100vw;
    /* Subtle Vector Pattern */
    background-image: 
        radial-gradient(circle at 2px 2px, rgba(255,255,255,0.03) 1px, transparent 0);
    background-size: 32px 32px;
}

.app-container {
    display: flex;
    height: 100%;
    width: 100%;
}

/* SIDEBAR - Polished */
.sidebar {
    width: 300px;
    height: 100%;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 32px 24px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--primary);
    font-weight: 800;
    text-shadow: 0 0 20px var(--primary-glow);
}

.channel-item { 
    padding: 14px 18px; 
    border-radius: 12px; 
    margin: 4px 12px; 
    cursor: pointer; 
    color: var(--text-dim); 
    display: flex; 
    align-items: center; 
    gap: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.channel-item:hover { background: var(--surface-light); color: white; }
.channel-item.active { 
    background: rgba(0, 112, 243, 0.1); 
    color: var(--primary); 
    border-color: rgba(0, 112, 243, 0.2);
    box-shadow: 0 0 20px rgba(0, 112, 243, 0.05);
}

/* CHAT INTERFACE */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    overflow: hidden;
    position: relative;
}

.screen {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.chat-header {
    height: 72px;
    padding: 0 24px;
    background: rgba(10, 10, 14, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message {
    max-width: 80%;
    padding: 14px 18px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 4px 18px 18px 18px;
    font-size: 15px;
    line-height: 1.6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.my-message {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary) 0%, #0051cc 100%);
    border: none;
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 8px 24px rgba(0, 112, 243, 0.25);
}

.meta {
    font-size: 10px;
    color: var(--text-dim);
    margin-bottom: 6px;
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    justify-content: space-between;
}

.my-message .meta { color: rgba(255,255,255,0.7); }

.meta span:last-child:hover { 
    opacity: 1 !important; 
    color: var(--danger); 
}

/* INPUT SYSTEM */
#form-chat {
    padding: 16px 20px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    align-items: center;
}

input[type="text"], input[type="password"] {
    background: #000;
    border: 1px solid var(--border);
    color: white;
    padding: 12px 18px;
    border-radius: 14px;
    outline: none;
    transition: 0.2s;
    flex: 1;
}

input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0, 112, 243, 0.1); }

button {
    background: var(--primary);
    color: white;
    font-weight: 700;
    border-radius: 14px;
    padding: 12px 24px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

button:hover { transform: translateY(-1px); filter: brightness(1.1); }
button:active { transform: scale(0.97); }

#form-chat button {
    width: 48px !important; height: 48px !important;
    min-width: 48px !important; border-radius: 50%;
    background: var(--surface-light);
    border: 1px solid var(--border);
}

#form-chat button:last-child { 
    background: var(--primary); 
    border: none;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.panic-btn {
    background: rgba(255, 0, 85, 0.1) !important;
    border: 1px solid var(--danger) !important;
    color: var(--danger) !important;
}

.panic-btn:hover { background: var(--danger) !important; color: white !important; }

/* CALL SYSTEM - Full Screen Professional */
.call-card {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    background: radial-gradient(circle at center, #1a1a2e 0%, #030304 100%) !important;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    padding: 80px 24px !important;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 3000;
}

.call-avatar {
    width: 120px;
    height: 120px;
    background: var(--surface-light);
    border: 2px solid var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    box-shadow: 0 0 40px var(--primary-glow);
    margin-bottom: 20px;
}

#call-status {
    font-size: 14px;
    letter-spacing: 3px;
    color: var(--primary);
    font-weight: 800;
    text-transform: uppercase;
}

#call-username {
    font-size: 32px;
    font-weight: 800;
    color: white;
    margin-top: 10px;
}

.call-controls-row {
    display: flex;
    gap: 30px;
    margin-top: 40px;
}

.call-btn-round {
    width: 72px !important;
    height: 72px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 28px !important;
    transition: all 0.3s ease;
}

.call-btn-accept { background: var(--success) !important; box-shadow: 0 0 20px rgba(0, 255, 170, 0.4); }
.call-btn-decline { background: var(--danger) !important; box-shadow: 0 0 20px rgba(255, 0, 85, 0.4); }
.call-btn-mute { background: var(--surface-light) !important; border: 1px solid var(--border) !important; }

/* MODAL / GLASS */
.glass-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

@media (max-width: 768px) {
    .sidebar { position: fixed; left: -300px; transition: transform 0.3s; z-index: 2000; }
    .sidebar.active { transform: translateX(300px); }
    
    #form-chat {
        padding: 10px 12px;
        gap: 6px;
    }
    
    #form-chat button {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        padding: 0 !important;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px !important;
    }

    input[type="text"] {
        padding: 8px 10px;
        font-size: 14px;
        min-width: 0; /* Allow it to shrink */
    }

    #burn-timer-select {
        margin-right: 2px;
    }
}

.hidden { display: none !important; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }