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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

main {
    flex: 1;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.section {
    margin-bottom: 30px;
}

.hidden {
    display: none !important;
}

/* Room Setup */
.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.input-group label {
    font-weight: 600;
    min-width: 80px;
}

.input-group input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
}

.input-group input:focus {
    outline: none;
    border-color: #2196F3;
}

/* Buttons */
button {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.primary-btn {
    background: #2196F3;
    color: white;
    width: 100%;
    padding: 15px;
    font-size: 18px;
}

.primary-btn:hover:not(:disabled) {
    background: #1976D2;
    transform: translateY(-1px);
}

.primary-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.secondary-btn {
    background: #f5f5f5;
    color: #666;
}

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

#generate-room {
    background: #4CAF50;
    color: white;
    white-space: nowrap;
}

#generate-room:hover {
    background: #45a049;
}

/* Room Active */
.room-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 20px;
}

.room-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.room-name code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.user-count {
    font-size: 14px;
    color: #666;
}

/* Audio Controls */
.audio-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.audio-btn {
    background: #4CAF50;
    color: white;
    border-radius: 50px;
    padding: 15px 25px;
    font-size: 16px;
}

.audio-btn:hover {
    background: #45a049;
}

.audio-btn.muted {
    background: #f44336;
}

.audio-btn.muted:hover {
    background: #d32f2f;
}

.volume-indicator {
    flex: 1;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.volume-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #FFC107, #f44336);
    width: 0%;
    transition: width 0.1s;
}

/* Users List */
.users-list {
    margin-bottom: 20px;
}

.user-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
}

.user-indicator .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4CAF50;
}

.user-indicator.connecting .status-dot {
    background: #FFC107;
    animation: pulse 1s infinite;
}

.user-indicator.connected .status-dot {
    background: #4CAF50;
}

.user-indicator.reconnecting .status-dot {
    background: #FF9800;
    animation: pulse 0.5s infinite;
}

.user-indicator.failed .status-dot {
    background: #f44336;
}

.user-indicator .user-name {
    font-size: 14px;
    color: #555;
}

/* Status */
.status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #e8f5e8;
    border-radius: 8px;
    font-size: 14px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4CAF50;
    animation: pulse 2s infinite;
}

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

.status.connecting .status-dot {
    background: #FFC107;
}

.status.error .status-dot {
    background: #f44336;
}

.status.error {
    background: #ffebee;
}

/* Error Message */
.error {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#dismiss-error {
    background: none;
    border: none;
    font-size: 20px;
    font-weight: bold;
    color: #c62828;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
}

/* Footer */
footer {
    text-align: center;
    color: white;
    margin-top: 20px;
    opacity: 0.8;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    main {
        padding: 20px;
    }
    
    .input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .input-group label {
        min-width: auto;
        margin-bottom: 5px;
    }
    
    .room-info {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .audio-controls {
        flex-direction: column;
        align-items: stretch;
    }
}