body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
}

#root {
    min-height: 100vh;
}

/* Video Container */
.video-container {
    position: relative;
    width: 100%;
    height: 100vh;
    background-color: #1a1a1a;
    overflow: hidden;
}

/* Normal Grid Layout */
.video-grid.normal-layout {
    display: grid;
    gap: 10px;
    padding: 10px;
    padding-bottom: 100px; /* Space for controls */
    height: calc(100vh - 100px);
    box-sizing: border-box;
}

/* Screen Share Layout */
.video-grid.screen-share-layout {
    display: flex;
    gap: 10px;
    padding: 10px;
    padding-bottom: 100px;
    height: calc(100vh - 100px);
    box-sizing: border-box;
}

.screen-share-main {
    flex: 1;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.screen-share-main video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.participants-sidebar {
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-participant {
    position: relative;
    background-color: #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Video Participant */
.video-participant {
    position: relative;
    background-color: #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.video-participant.active-speaker {
    box-shadow: 0 0 0 3px #28a745;
}

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

/* Video Placeholder (when camera is off) */
.video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #2a2a2a;
    color: #666;
    font-size: 48px;
    z-index: 1;
}

.sidebar-participant .video-placeholder {
    font-size: 32px;
}

/* Participant Info */
.participant-info {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 10;
    max-width: calc(100% - 20px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Controls Bar */
.controls-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.9);
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    z-index: 1000;
    height: 90px;
    box-sizing: border-box;
}

.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background-color: #444;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background-color: #555;
    transform: scale(1.1);
}

.control-btn.danger {
    background-color: #dc3545;
}

.control-btn.danger:hover {
    background-color: #c82333;
}

.control-btn.active {
    background-color: #28a745;
}

.control-btn.active:hover {
    background-color: #218838;
}

.control-btn i {
    pointer-events: none;
}

/* Home Page */
.home-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.room-form-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 500px;
}

/* Chat (will be added) */
.chat-container {
    position: fixed;
    right: 20px;
    bottom: 110px;
    width: 350px;
    height: 400px;
    background-color: rgba(0, 0, 0, 0.9);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    z-index: 999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: all 0.3s;
}

.chat-container.hidden {
    transform: translateY(calc(100% + 110px));
}

.chat-header {
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

.chat-header h5 {
    margin: 0;
    color: white;
    font-size: 16px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
    color: white;
    word-wrap: break-word;
}

.chat-message .sender {
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 12px;
    color: #aaa;
}

.chat-message .text {
    font-size: 14px;
}

.chat-message.own {
    background-color: rgba(40, 167, 69, 0.3);
    align-self: flex-end;
}

.chat-input-container {
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.5);
    border-top: 1px solid #444;
    display: flex;
    gap: 10px;
    border-radius: 0 0 8px 8px;
}

.chat-input-container input {
    flex: 1;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid #444;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
}

.chat-input-container input::placeholder {
    color: #888;
}

.chat-input-container input:focus {
    outline: none;
    border-color: #667eea;
    background-color: rgba(255, 255, 255, 0.15);
}

.chat-input-container button {
    background-color: #667eea;
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.chat-input-container button:hover {
    background-color: #5568d3;
}

/* Responsive */
@media (max-width: 768px) {
    .participants-sidebar {
        width: 200px;
    }

    .sidebar-participant {
        aspect-ratio: 4/3;
    }

    .controls-bar {
        padding: 15px 10px;
        height: 80px;
    }

    .control-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .chat-container {
        width: 300px;
        height: 350px;
        right: 10px;
        bottom: 90px;
    }
}

@media (max-width: 480px) {
    .video-grid.screen-share-layout {
        flex-direction: column-reverse;
    }

    .participants-sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        height: 120px;
    }

    .sidebar-participant {
        min-width: 160px;
        aspect-ratio: 16/9;
    }

    .screen-share-main {
        height: calc(100vh - 230px);
    }

    .chat-container {
        width: calc(100% - 20px);
        right: 10px;
        left: 10px;
    }
}

/* Scrollbar styles */
.chat-messages::-webkit-scrollbar,
.participants-sidebar::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track,
.participants-sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.chat-messages::-webkit-scrollbar-thumb,
.participants-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.participants-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}
