* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    color: white;
    min-height: 100vh;
    overflow: hidden;
}

.app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 24px;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(45deg, #fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-stats {
    display: flex;
    gap: 8px;
}

.stat-badge {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    font-size: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.screen-badge {
    background: rgba(255, 193, 7, 0.2);
    border-color: #ffc107;
}

/* Video Grid - Layout Menurun */
.video-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1.2fr 0.8fr;
    gap: 8px;
    padding: 12px;
    min-height: 0;
}

.screen-container {
    grid-column: span 2;
    grid-row: 1;
    border-color: #ffc107;
}

.local-container {
    grid-column: 1;
    grid-row: 2;
}

.remote-container {
    grid-column: 2;
    grid-row: 2;
}

.video-container {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.video-container:hover {
    border-color: #ffc107;
    transform: scale(1.01);
    z-index: 10;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #1a1a1a;
}

.video-label {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 10;
}

/* Connecting Overlay */
.connecting-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: opacity 0.3s;
}

.connecting-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #ffc107;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Screen Status */
.screen-status {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ffc107;
    color: black;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    z-index: 10;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.8; }
    100% { opacity: 1; }
}

/* Status Bar - Mic/Speaker/Camera */
.status-bar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-icon {
    font-size: 16px;
}

.status-text {
    font-size: 12px;
    font-weight: 500;
}

.status-indicator {
    font-size: 12px;
    margin-left: 4px;
}

.status-indicator.off {
    color: #f44336;
}

/* Control Bar */
.control-bar {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 16px;
    border: none;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 70px;
}

.control-btn .btn-icon {
    font-size: 20px;
}

.control-btn.next {
    background: #2196f3;
    color: white;
}

.control-btn.screen {
    background: #ffc107;
    color: black;
}

.control-btn.settings {
    background: #9c27b0;
    color: white;
}

.control-btn.stop {
    background: #f44336;
    color: white;
}

.control-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.control-btn:active {
    transform: translateY(0);
}

/* Settings Panel */
.settings-panel {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px 20px 0 0;
    padding: 20px;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    max-height: 80vh;
    overflow-y: auto;
}

.settings-panel.show {
    bottom: 0;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.settings-header h3 {
    font-size: 18px;
}

.close-btn {
    width: 36px;
    height: 36px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 16px;
    cursor: pointer;
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.setting-group label {
    font-size: 13px;
    color: #aaa;
}

.setting-group select,
.setting-group input[type="range"] {
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 14px;
}

.test-btn {
    padding: 12px;
    background: #4caf50;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
}

/* Toast */
.toast {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 13px;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border: 1px solid #ffc107;
    transition: all 0.3s;
}

.toast.hidden {
    opacity: 0;
    transform: translate(-50%, -20px);
    pointer-events: none;
}

.toast.error {
    border-color: #f44336;
}

.toast.success {
    border-color: #4caf50;
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr;
        grid-template-rows: 1.5fr 1fr 1fr;
        gap: 6px;
        padding: 8px;
    }
    
    .screen-container {
        grid-column: 1;
        grid-row: 1;
    }
    
    .local-container {
        grid-row: 2;
    }
    
    .remote-container {
        grid-row: 3;
    }
    
    .status-bar {
        padding: 6px 10px;
    }
    
    .status-item {
        padding: 4px 8px;
        gap: 4px;
    }
    
    .status-text {
        font-size: 11px;
    }
    
    .control-btn .btn-text {
        display: none;
    }
    
    .control-btn {
        min-width: auto;
        padding: 8px;
    }
    
    .control-btn .btn-icon {
        font-size: 22px;
    }
}

/* Landscape Mode */
@media (orientation: landscape) and (max-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 0.8fr;
    }
    
    .screen-container {
        grid-column: span 2;
        grid-row: 1;
    }
    
    .local-container {
        grid-column: 1;
        grid-row: 2;
    }
    
    .remote-container {
        grid-column: 2;
        grid-row: 2;
    }
    
    .control-btn .btn-text {
        display: inline;
    }
}