* {
    box-sizing: border-box;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: #f0f2f5;
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 1300px;
    width: 100%;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 25px;
}

h1 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #1a1a1a;
    font-size: 24px;
}

.room-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

input, button {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

input:focus {
    outline: none;
    border-color: #0066ff;
}

button {
    background: #0066ff;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

button:hover:not(:disabled) {
    background: #0052cc;
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.status-area {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: #e8f0fe;
    border-radius: 10px;
    font-size: 14px;
}

#connectionStatus {
    font-weight: bold;
}

.main-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.chat-area, .video-area {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
}

.messages-box {
    height: 300px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    padding: 8px 12px;
    border-radius: 12px;
    max-width: 80%;
    word-break: break-word;
}

.message.own {
    background: #0066ff;
    color: white;
    align-self: flex-end;
}

.message.other {
    background: #e9ecef;
    color: black;
    align-self: flex-start;
}

.message small {
    font-size: 10px;
    opacity: 0.7;
    margin-left: 8px;
}

.message-input-area, .file-input-area {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.message-input-area input {
    flex-grow: 1;
}

.videos-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.video-wrapper {
    background: #ddd;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.video-wrapper video {
    width: 100%;
    height: auto;
    display: block;
    background: #2d2d2d;
}

.video-wrapper span {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.remote-videos {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

#fileProgress {
    margin-top: 10px;
    padding: 10px;
    background: #fff3cd;
    border-radius: 6px;
    display: none;
}

@media (max-width: 768px) {
    .main-area {
        grid-template-columns: 1fr;
    }
}