* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #0f172a;
    color: #f8fafc;
    height: 100vh;
    overflow: hidden;
}

/* Room Wrapper */
.room-wrapper {
    display: flex;
    width: 100vw;
    height: 100vh;
    background: #090d16;
}

/* Main Stage & Video Grid */
.main-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #020617;
}

#video-grid-container {
    flex: 1;
    padding: 16px;
    display: grid;
    gap: 16px;
    align-content: center;
    justify-content: center;
    overflow-y: auto;
}

/* Layout Options */
.layout-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.layout-spotlight .participant-tile {
    grid-column: 1 / -1;
    max-height: 80vh;
}

.layout-sidebar {
    grid-template-columns: 3fr 1fr;
}

/* Participant Video Card */
.participant-tile {
    position: relative;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    overflow: hidden;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.participant-label {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    color: #f8fafc;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Bottom Control Bar */
.controls-bar {
    height: 72px;
    background: #0f172a;
    border-top: 1px solid #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 20px;
}

.ctrl-btn {
    padding: 10px 18px;
    background: #1e293b;
    border: 1px solid #334155;
    color: #f8fafc;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ctrl-btn:hover {
    background: #334155;
}

.ctrl-btn.btn-active {
    background: #dc2626;
    border-color: #ef4444;
}

.ctrl-btn.btn-danger {
    background: #991b1b;
    border-color: #dc2626;
}

.ctrl-btn.btn-danger:hover {
    background: #dc2626;
}

.ctrl-select {
    padding: 10px 14px;
    background: #1e293b;
    border: 1px solid #334155;
    color: #f8fafc;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

/* Side Chat Drawer */
.chat-drawer {
    width: 320px;
    background: #0f172a;
    border-left: 1px solid #1e293b;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 18px;
    font-weight: bold;
    font-size: 16px;
    border-bottom: 1px solid #1e293b;
    color: #38bdf8;
}

.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-msg {
    font-size: 13px;
    line-height: 1.4;
    padding: 8px 12px;
    border-radius: 8px;
    max-width: 85%;
    word-break: break-word;
}

.chat-msg.self {
    align-self: flex-end;
    background: #0284c7;
    color: white;
}

.chat-msg.remote {
    align-self: flex-start;
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid #334155;
}

.chat-input-box {
    padding: 12px;
    border-top: 1px solid #1e293b;
    display: flex;
    gap: 8px;
}

.chat-input-box input {
    flex: 1;
    padding: 10px 12px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    color: white;
    font-size: 13px;
}

.chat-input-box input:focus {
    outline: none;
    border-color: #38bdf8;
}

.chat-input-box button {
    padding: 10px 14px;
    background: #0284c7;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .room-wrapper {
        flex-direction: column;
    }
    .chat-drawer {
        width: 100%;
        height: 200px;
    }
}