/* Multi View Standalone Page Styles */

.multiview-page {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #000;
}

.multiview-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.multiview-header {
    height: 60px;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid #333;
}

.multiview-title {
    font-weight: bold;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.2rem;
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
    font-size: 1.1rem;
}

.back-link:hover {
    color: var(--accent);
}

.multiview-controls {
    display: flex;
    gap: 10px;
}

.multiview-btn {
    background: #222;
    border: 1px solid #444;
    color: var(--text);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.multiview-btn:hover {
    background: #333;
    border-color: var(--accent);
}

.multiview-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 4px;
    background: #111;
    overflow: hidden;
    padding: 4px;
}

.grid-cell {
    background: #050505;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #222;
    overflow: hidden;
    border-radius: 8px;
}

.cell-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: #444;
    transition: all 0.2s;
    cursor: pointer;
}

.grid-cell:hover .cell-placeholder {
    color: #666;
}

.add-stream-btn {
    background: var(--primary);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.add-stream-btn:hover {
    transform: scale(1.1);
    background: #2563eb;
}

.cell-content {
    width: 100%;
    height: 100%;
    display: none;
}

.cell-content.active {
    display: block;
}

.cell-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.cell-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
    background: rgba(0, 0, 0, 0.8);
    padding: 6px;
    border-radius: 8px;
    backdrop-filter: blur(8px);
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.grid-cell:hover .cell-controls {
    opacity: 1;
}

.cell-btn {
    background: transparent;
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.cell-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.cell-btn.remove {
    color: #fca5a5;
}

.cell-btn.remove:hover {
    background: rgba(220, 38, 38, 0.6);
    color: white;
}

/* Modal Styles Extracted */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #18181b;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    border-radius: 20px;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    transform: translateY(30px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
}

.modal-close {
    background: #27272a;
    border: none;
    color: #a1a1aa;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #3f3f46;
    color: var(--text);
    transform: rotate(90deg);
}

.modal-body {
    padding: 0;
    flex: 1;
    overflow-y: auto;
}

.modal-search {
    padding: 20px;
    background: #18181b;
    position: sticky;
    top: 0;
    z-index: 5;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-search input {
    width: 100%;
    background: #09090b;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 12px 18px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.modal-search input:focus {
    border-color: var(--accent);
}

.selector-match-list {
    padding: 10px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Responsive Grid */
@media (max-width: 992px) {
    .multiview-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 1fr);
    }
}