:root {
    --bg-main: #202124;
    --bg-hover: #3c4043;
    --bg-chat: #ffffff;
    --text-main: #ffffff;
    --text-chat: #202124;
    --accent-red: #ea4335;
    --accent-blue: #8ab4f8;
    --glass-bg: rgba(32, 33, 36, 0.9);
}

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

body, html {
    height: 100%;
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow: hidden;
}

.main-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Video Section */
.video-section {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.3s ease;
}

.video-grid {
    flex-grow: 1;
    display: grid;
    gap: 10px;
    padding: 20px;
    align-items: stretch;
    justify-content: stretch;
    height: 100%;
    max-height: calc(100vh - 80px);
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    background-color: #3c4043;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transform: rotateY(180deg); /* Mirror effect for self */
}
/* Un-mirror screen shares */
video.screen-share {
    transform: none;
    object-fit: contain;
}

/* Control Bar */
.controls-bar {
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.controls-block {
    display: flex;
    align-items: center;
    gap: 15px;
}

.left { width: 250px; }
.right { width: 250px; justify-content: flex-end; }
.center { flex-grow: 1; justify-content: center; }

.room-info {
    font-weight: 500;
    font-size: 1rem;
}

.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #3c4043;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.control-btn:hover {
    background-color: #4a4d51;
}

.control-btn.active {
    background-color: var(--accent-blue);
    color: var(--bg-main);
}

.control-btn.off {
    background-color: var(--accent-red);
    color: white;
}

.leave-btn {
    background-color: var(--accent-red);
    width: 60px;
    border-radius: 30px;
}
.leave-btn:hover {
    background-color: #d93025;
}

/* Chat Section */
.chat-section {
    width: 360px;
    background-color: var(--bg-chat);
    color: var(--text-chat);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    border-left: 1px solid #e0e0e0;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 80px; /* Leave space for controls */
    z-index: 90;
}

.chat-section.show {
    transform: translateX(0);
    position: relative;
    bottom: 0;
}

.chat-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
}

.close-chat {
    cursor: pointer;
    color: #5f6368;
}

.chat-window {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
}

.messages {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
    flex-direction: column;
}

.msg-sender {
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 2px;
    color: #202124;
}

.msg-text {
    font-size: 0.95rem;
    line-height: 1.4;
    color: #3c4043;
}

.chat-input-container {
    padding: 20px;
    display: flex;
    gap: 10px;
    border-top: 1px solid #e0e0e0;
}

.chat-input-container input {
    flex-grow: 1;
    padding: 12px 15px;
    border-radius: 20px;
    border: 1px solid #dadce0;
    outline: none;
    font-family: 'Roboto', sans-serif;
}

.chat-input-container button {
    background: transparent;
    border: none;
    color: var(--accent-blue);
    cursor: pointer;
    display: flex;
    align-items: center;
}
