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

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

/* Join Screen */
#join-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.join-container {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
}

.join-container h1 {
    font-size: 32px;
    margin-bottom: 10px;
    text-align: center;
    color: #667eea;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

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

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

.primary-btn {
    width: 100%;
    padding: 14px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.primary-btn:hover {
    background: #5568d3;
}

.secondary-btn {
    width: 100%;
    padding: 12px;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s;
}

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

.info-box {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.info-box strong {
    display: block;
    margin-bottom: 10px;
    color: #667eea;
}

.info-box ul {
    list-style: none;
    padding-left: 0;
}

.info-box li {
    padding: 5px 0;
    color: #555;
    font-size: 14px;
}

.info-box li:before {
    content: "✓ ";
    color: #667eea;
    font-weight: bold;
}

/* Chat Screen */
#chat-screen {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #1a1a2e;
}

.header {
    background: #16213e;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #0f3460;
}

.room-info h2 {
    color: white;
    font-size: 18px;
    margin-bottom: 5px;
}

.room-info span {
    color: #667eea;
}

#participant-count {
    color: #aaa;
    font-size: 14px;
}

.controls-top {
    display: flex;
    gap: 10px;
}

.icon-btn {
    background: #0f3460;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
}

.icon-btn:hover {
    background: #1a4d7a;
    transform: scale(1.05);
}

.icon-btn.danger:hover {
    background: #c0392b;
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.video-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    padding: 20px;
    overflow-y: auto;
    align-content: start;
}

.video-container {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-container.local {
    border: 3px solid #667eea;
}

.video-label {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
}

.video-status {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
}

/* Sidebar */
.sidebar {
    width: 350px;
    background: #16213e;
    border-left: 2px solid #0f3460;
    display: flex;
    flex-direction: column;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.chat-container h3 {
    color: white;
    margin-bottom: 15px;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    background: #0f3460;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.chat-message {
    background: #1a4d7a;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    color: white;
}

.chat-message .username {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 5px;
}

.chat-message .text {
    color: #ddd;
}

.chat-message .timestamp {
    font-size: 11px;
    color: #888;
    margin-top: 5px;
}

.chat-input-container {
    display: flex;
    gap: 10px;
}

#chat-input {
    flex: 1;
    padding: 10px;
    border: 2px solid #0f3460;
    border-radius: 8px;
    background: #0f3460;
    color: white;
    font-size: 14px;
}

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

#send-message-btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

#send-message-btn:hover {
    background: #5568d3;
}

/* Bottom Controls */
.controls-bottom {
    background: #16213e;
    padding: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
    border-top: 2px solid #0f3460;
}

.control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background: #0f3460;
    border: 2px solid #0f3460;
    padding: 15px 25px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
}

.control-btn .icon {
    font-size: 24px;
}

.control-btn .label {
    font-size: 12px;
    font-weight: 600;
}

.control-btn:hover {
    background: #1a4d7a;
    transform: translateY(-2px);
}

.control-btn.active {
    background: #667eea;
    border-color: #667eea;
}

.control-btn.active:hover {
    background: #5568d3;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #667eea;
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.setting-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        max-height: 300px;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .controls-bottom {
        gap: 8px;
    }
    
    .control-btn {
        padding: 12px 15px;
    }
}
