body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: white;
}

#app {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
}

#main-container {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#video-section {
    flex: 1;
    position: relative;
    background-color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#video-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#remote-video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    background-color: #000;
}

#local-video {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 200px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background-color: #222;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

#chat-section {
    width: 350px;
    background-color: #121212;
    border-left: 1px solid #333;
    display: flex;
    flex-direction: column;
    z-index: 30;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.95em;
    line-height: 1.4;
    word-wrap: break-word;
    position: relative;
}

.message.local {
    align-self: flex-end;
    background-color: #2196F3;
    color: white;
    border-bottom-right-radius: 2px;
}

.message.remote {
    align-self: flex-start;
    background-color: #333;
    color: #eee;
    border-bottom-left-radius: 2px;
}

.message.system {
    align-self: center;
    background-color: transparent;
    color: #888;
    font-size: 0.8em;
    font-style: italic;
    padding: 5px;
    max-width: 100%;
}

.message.system .meta {
    display: none;
}

.message .meta {
    font-size: 0.7em;
    opacity: 0.6;
    margin-top: 4px;
    display: block;
    text-align: right;
}

#chat-input-area {
    padding: 20px;
    background-color: #1a1a1a;
    border-top: 1px solid #333;
    display: flex;
    gap: 10px;
}

#chat-input {
    flex: 1;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 20px;
    padding: 10px 15px;
    color: white;
    outline: none;
    transition: border-color 0.2s;
}

#chat-input:focus {
    border-color: #2196F3;
}

#send-btn {
    background: #2196F3;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
}

#send-btn:hover {
    background: #1976D2;
}

#send-btn:active {
    transform: scale(0.95);
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    box-sizing: border-box;
}

#status-bar {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    align-self: flex-start;
    backdrop-filter: blur(5px);
}

#status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 10px;
}

#status-indicator.online { background-color: #4CAF50; }
#status-indicator.connecting { background-color: #FFC107; }
#status-indicator.disconnected { background-color: #F44336; }

#room-id {
    margin-left: 15px;
    opacity: 0.7;
    font-size: 0.9em;
}

#controls {
    pointer-events: auto;
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

#controls button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

#controls button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

#controls button.active {
    background: #4CAF50;
}

#controls button.inactive {
    background: #F44336;
}

#controls button#hangup {
    background: #F44336;
}

#controls button#hangup:hover {
    background: #D32F2F;
}

#landing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(10px);
}

#landing-overlay.hidden {
    display: none;
}

.modal {
    text-align: center;
    max-width: 400px;
    padding: 40px;
}

.modal h1 {
    font-size: 3em;
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.modal p {
    margin-bottom: 30px;
    opacity: 0.8;
}

.modal button {
    background: #2196F3;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1em;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.modal button:hover {
    background: #1976D2;
}

.small {
    font-size: 0.8em;
    margin-top: 20px;
}
