/* Container and grid */
.rtc-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 1.5rem auto;
    display: flex;
    flex-direction: column;
}

.rtc-main-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 1.5rem;
    align-items: stretch;
    justify-content: center;
    width: 100%;
    transition: all 0.25s;
}

.rtc-main-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    transition: all 0.25s;
}

/* Remote video area */
.rtc-remote {
    position: relative;
    background: #000;
    min-height: 260px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rtc-remote video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

/* Local PiP preview */
.rtc-local {
    position: absolute;
    right: 1.2rem;
    bottom: 1.2rem;
    width: 24%;
    max-width: 160px;
    min-width: 80px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    background: #222;
    border: 2px solid #fff;
}

.rtc-local video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #222;
}

/* Toolbar */
.rtc-toolbar {
    display: flex;
    gap: .75rem;
    align-items: center;
    padding: .5rem 0 .5rem .2rem;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    width: 100%;
    justify-content: center;
}

.rtc-toolbar button {
    min-width: 40px;
    font-size: 1.1em;
}

/* Panels (Status, ICE, Chat) */
.rtc-panel-pre {
    height: 80px;
    overflow: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    white-space: pre-wrap;
    word-break: break-word;
    background: #f8fafc;
    border-radius: 4px;
    margin-bottom: 0;
}

.rtc-chat-panel.hide,
.rtc-debug-panel.hide {
    display: none !important;
}

.rtc-chat-panel,
.rtc-debug-panel {
    transition: all 0.2s;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .rtc-container {
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 992px) {

    .rtc-main-col,
    .rtc-toolbar,
    .rtc-chat-panel,
    .rtc-debug-panel {
        max-width: 100%;
    }

    .rtc-remote {
        min-height: 180px;
    }

    .rtc-local {
        width: 32%;
        max-width: 110px;
    }
}

@media (max-width: 768px) {
    .rtc-main-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .rtc-main-col {
        width: 100%;
        align-items: center;
    }

    .rtc-panel-pre {
        height: 56px;
        font-size: 0.93em;
    }

    .rtc-remote {
        min-height: 120px;
    }

    .rtc-toolbar {
        flex-direction: column;
        gap: .5rem;
        align-items: stretch;
        width: 100%;
    }

    .rtc-chat-panel,
    .rtc-debug-panel {
        margin-top: 0.5rem;
    }
}