:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --card-bg: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --danger: #ef4444;
    --danger-hover: #dc2626;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at top right, #1e1b4b, var(--bg-color));
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
}

.screen {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    animation: fadeIn 0.5s forwards;
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 1;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Join Screen */
#join-screen {
    text-align: center;
    height: 100vh;
    justify-content: center;
}

.logo-text {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: #94a3b8;
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

.primary-btn {
    position: relative;
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.25rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.5);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.primary-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.6);
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50px;
    background-color: var(--primary);
    z-index: -1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.3); opacity: 0; }
}

/* Chat Screen */
#chat-screen {
    width: 100%;
}

header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.my-badge {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    width: 100%;
    margin-bottom: 3rem;
}

.user-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.user-card.talking {
    border-color: #4ade80;
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.3);
}

.user-card:hover {
    transform: translateY(-5px);
    background: rgba(30, 41, 59, 0.9);
}

.avatar-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4ade80, #3b82f6);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    font-weight: bold;
}

.user-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.mic-icon {
    font-size: 0.9rem;
}

.mic-icon.unmuted {
    color: #4ade80;
}

.mic-icon.muted {
    color: #ef4444;
}

.mic-icon.no_permission {
    color: #9ca3af;
}

.mic-icon.no_connection {
    color: #f59e0b;
}

.mic-icon.talking {
    color: #4ade80;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.footer-actions {
    display: flex;
    justify-content: center;
    width: 100%;
}

.secondary-btn {
    background-color: var(--danger);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.secondary-btn:hover {
    background-color: var(--danger-hover);
}

/* Mobile Responsive Adjustments */
@media screen and (max-width: 600px) {
    .container {
        padding: 1rem;
    }

    .logo-text {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .primary-btn {
        padding: 0.8rem 2rem;
        font-size: 1.1rem;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .users-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .user-card {
        padding: 1rem;
    }

    .avatar-placeholder {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }

    .user-name {
        font-size: 0.95rem;
    }

    .footer-actions {
        flex-direction: column;
        row-gap: 1rem;
    }

    .footer-actions button {
        width: 100%;
        margin-right: 0 !important;
    }
}
