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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 1200px;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

.card {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2.5rem;
}

h1 i {
    color: #667eea;
    margin-right: 10px;
}

.card > p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.form-group {
    margin-bottom: 25px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
}

input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input:focus {
    border-color: #667eea;
    outline: none;
}

small {
    display: block;
    margin-top: 5px;
    color: #888;
    font-size: 0.85rem;
}

.button-group {
    margin-top: 30px;
}

.btn-primary, .btn-secondary, .btn-mic, .btn-small {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: #667eea;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #dee2e6;
}

.btn-secondary:hover {
    background: #e9ecef;
}

.btn-mic {
    background: #28a745;
    color: white;
    width: 100%;
}

.btn-mic.muted {
    background: #dc3545;
}

.btn-small {
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    font-size: 14px;
}

.instructions {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: left;
}

.instructions h3 {
    margin-bottom: 15px;
    color: #333;
}

.instructions ul {
    list-style-position: inside;
    color: #666;
}

.instructions li {
    margin-bottom: 8px;
}

.room-header {
    background: white;
    border-radius: 15px 15px 0 0;
    padding: 25px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.room-content {
    background: #f8f9fa;
    border-radius: 0 0 15px 15px;
    padding: 30px;
    min-height: 600px;
}

.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.user-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    font-weight: bold;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.user-id {
    font-size: 0.85rem;
    color: #888;
    font-family: monospace;
}

.controls-panel {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.control-group {
    margin-bottom: 30px;
}

.control-group h3 {
    margin-bottom: 20px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-item {
    margin-bottom: 20px;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 8px;
}

input[type="range"] {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: #e1e1e1;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
}

.room-info {
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #666;
}

.room-info p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

@media (max-width: 768px) {
    .card {
        padding: 30px 20px;
    }
    
    .room-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .users-grid {
        grid-template-columns: 1fr;
    }
}

.input-with-button {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-with-button input {
    flex: 1;
}

.btn-small {
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    font-size: 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
}

.btn-small:hover {
    background: #5a6268;
}

.active-rooms {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: left;
}

.active-rooms h3 {
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
}

.rooms-list {
    max-height: 300px;
    overflow-y: auto;
}

.room-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
    cursor: pointer;
    border: 2px solid transparent;
}

.room-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.room-info {
    flex: 1;
}

.room-id {
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
    font-family: monospace;
}

.room-stats {
    display: flex;
    gap: 15px;
    margin-top: 5px;
    font-size: 0.9rem;
    color: #666;
}

.room-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.join-room-btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.join-room-btn:hover {
    background: #5a6fd8;
}

.loading-rooms, .no-rooms {
    text-align: center;
    padding: 30px;
    color: #666;
    font-style: italic;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #333;
}

.room-header-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-count-badge {
    background: #667eea;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.info-item i {
    color: #667eea;
    width: 20px;
}

.info-item:last-child {
    border-bottom: none;
}

/* Scrollbar personalizada */
.rooms-list::-webkit-scrollbar {
    width: 8px;
}

.rooms-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.rooms-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.rooms-list::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Responsividade */
@media (max-width: 768px) {
    .input-with-button {
        flex-direction: column;
    }
    
    .input-with-button input {
        width: 100%;
    }
    
    .room-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .room-header-info {
        flex-direction: column;
        gap: 10px;
    }
}

/* Estilos para status de conexão */
.connection-status {
    font-size: 0.85rem;
    color: #28a745;
    display: flex;
    align-items: center;
    gap: 5px;
}

.connection-status.reconnecting {
    color: #ffc107;
}

.connection-status.disconnected {
    color: #dc3545;
}

.user-card.disconnected {
    opacity: 0.6;
    border-left: 4px solid #ffc107;
}

.user-card.disconnected .user-avatar {
    filter: grayscale(0.5);
}

.badge-self {
    background: #667eea;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: 5px;
}

/* Notificações */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 1000;
    animation: slideIn 0.3s ease;
    max-width: 300px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    background: #28a745;
}

.notification.warning {
    background: #ffc107;
    color: #333;
}

.notification.error {
    background: #dc3545;
}

.notification.info {
    background: #17a2b8;
}

/* Status de conexão global */
.connection-indicator {
    position: fixed;
    top: 10px;
    left: 10px;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    z-index: 1001;
}

.connection-indicator.connected {
    background: #28a745;
    color: white;
}

.connection-indicator.connecting {
    background: #ffc107;
    color: #333;
}

.connection-indicator.disconnected {
    background: #dc3545;
    color: white;
}