/* public/style.css */
:root {
    --bg-color: #000000;
    --card-bg: #1e1e1f;
    --text-main: #a0a0a0;
    --accent: #00f0ff;
    --glow: 0 0 15px rgba(0, 240, 255, 0.3);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Glassmorphism */
.glass-card {
    background: rgba(30, 30, 31, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 3rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--glow);
}

#welcome-screen h1 {
    font-size: 3rem;
    letter-spacing: 8px;
    color: #fff;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px var(--accent);
}

input, textarea {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    background: rgba(0,0,0,0.3);
    border: 1px solid #333;
    color: white;
    border-radius: 8px;
}

button {
    padding: 12px 24px;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow);
}

/* Chat Layout */
#chat-interface {
    width: 95vw;
    height: 85vh;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
}

.hidden { display: none !important; }

.sidebar {
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    padding: 15px;
}

.user-item {
    padding: 10px;
    margin: 5px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.user-item:hover { background: rgba(255,255,255,0.1); }

.main-content {
    display: flex;
    flex-direction: column;
    border: 1px solid #333;
    border-radius: 12px;
    overflow: hidden;
}

.tabs {
    display: flex;
    background: #0a0a0a;
    padding: 8px;
    gap: 10px;
    border-radius: 8px;
    border: 1px solid #333;
    overflow-x: auto;
}

.tab {
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #333;
}

.tab.active {
    background: var(--accent);
    color: #000;
    box-shadow: var(--glow);
    font-weight: bold;
}

.message-display {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: rgba(0,0,0,0.2);
}

.msg { margin-bottom: 15px; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.input-area { padding: 20px; border-top: 1px solid #333; }
#msg-form { display: flex; gap: 10px; }

.tab {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.close-btn {
    margin-left: 8px;
    font-size: 14px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.close-btn:hover {
    opacity: 1;
    color: #ff4d4d;
}
.cyan-text {
    color: var(--accent);
}

.tab[data-id="global"] .close-btn {
    display: none;
}

#active-tab-title {
    font-weight: bold;
    color: var(--accent);
    margin-bottom: 5px;
/*    display: block; */
    display: inline-block;
    white-space: nowrap;
}

.msg { margin-bottom: 15px; padding: 8px 12px; border-radius: 8px; max-width: 80%; }

.msg.system {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333;
    max-width: 100%;
    color: #a0a0a0;
}

/* Received messages (Opponent) */
.msg.private {
    background: rgba(255, 255, 255, 0.05);
    border-left: 4px solid var(--accent);
    align-self: flex-start;
}

/* Sent messages (You) */
.msg.sent {
    background: rgba(0, 240, 255, 0.1);
/*    border: 1px solid var(--accent); */
 border-left: 4px solid var(--accent);
/*    margin-left: auto; /* Aligns to the right */
/*    text-align: right; */
    text-align: left;
     margin-right: auto
}

.msg .nick { font-weight: bold; color: #fff; display: block; margin-bottom: 4px; }

/* This applies ONLY to screens smaller than 768px (tablets and phones) */
@media screen and (max-width: 768px) {
  .your-container-class {
    flex-direction: column; /* Stack items vertically instead of horizontally */
    width: 100%;            /* Force full width on small screens */
  }

  .your-text-class {
    font-size: 16px;        /* Scale down large desktop text */
  }
}

/* call */
/* Call Action Button */
.user-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}
.user-item strong { width: 100%; }
.user-item small { flex: 1; }

.user-item .call-btn {
    margin-left: auto;
    padding: 5px 10px;
    font-size: 0.8rem;
    color: var(--accent);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--accent);
    border-radius: 4px;
}

.user-item .call-btn:hover {
    background: var(--accent);
    color: #000;
}

/* Call Status Indicators */
.status-calling {
    color: orange;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Call Status Bar */
#call-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    margin: 10px 10px 0 10px;
    background: rgba(0, 240, 255, 0.06);
    border: 1px solid var(--accent);
    border-radius: 8px;
    box-shadow: var(--glow);
    color: #fff;
}

#call-status-bar button {
    padding: 6px 14px;
    font-size: 0.8rem;
}

/* Incoming Call Modal */
#incoming-call-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.call-modal {
    min-width: 300px;
}

#incoming-call-text {
    color: #fff;
    font-size: 1.2rem;
    animation: pulse 1.5s infinite;
}

.call-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Destructive actions (decline / hang up) */
button.danger {
    background: transparent;
    color: #ff4d4d;
    border: 1px solid #ff4d4d;
}

button.danger:hover {
    background: #ff4d4d;
    color: #000;
    box-shadow: 0 0 15px rgba(255, 77, 77, 0.4);
}

/* Hide the audio sink element */
#remote-audio { display: none; }

/* Verbal safety code (short authentication string) */
#safety-code {
    margin-left: auto;
    margin-right: 12px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    letter-spacing: 2px;
    color: var(--accent);
    cursor: help;
}

/* Connection quality indicator */
#call-quality {
    font-size: 0.8rem;
    letter-spacing: 1px;
    cursor: help;
}
#call-quality.q-good { color: #4dff88; }
#call-quality.q-fair { color: orange; }
#call-quality.q-poor { color: #ff4d4d; }

/* Mute toggle */
#mute-btn {
    padding: 6px 14px;
    font-size: 0.8rem;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}
#mute-btn:hover {
    background: var(--accent);
    color: #000;
}
