/* Browser Stream Styles */
.browser-stream-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    min-height: 400px;
}

.stream-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: #fff;
    border-bottom: 1px solid #ddd;
    gap: 10px;
    flex-shrink: 0;
}

.url-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    color: #333;
}

.url-input:focus {
    outline: none;
    border-color: #72D8EF;
}

.nav-button, .refresh-button {
    padding: 8px 16px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.nav-button:hover, .refresh-button:hover {
    background: #1976D2;
}

.nav-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.connection-status {
    font-size: 12px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    background: #f0f0f0;
    color: #666;
    border: 1px solid #ddd;
}

.connection-status.connected {
    background: #e8f5e8;
    color: #2e7d32;
    border-color: #4caf50;
}

.connection-status.connecting {
    background: #fff3e0;
    color: #ef6c00;
    border-color: #ff9800;
}

.connection-status.error {
    background: #ffebee;
    color: #c62828;
    border-color: #f44336;
}

/* ADD these connection status styles */
.connection-status.connecting {
    background: #fff3e0;
    color: #ef6c00;
    border-color: #ff9800;
}

.connection-status.disconnecting {
    background: #fff3e0;
    color: #ef6c00;
    border-color: #ff9800;
}

.connection-status.disconnected {
    background: #f5f5f5;
    color: #666;
    border-color: #ddd;
}

.stream-viewport {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    min-height: 300px;
}

#browserCanvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: pointer;
    background: white;
    border-radius: 4px;
}

.stream-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: border-color 0.3s ease;
}

.stream-overlay.active {
    border-color: #72D8EF;
    box-shadow: 0 0 20px rgba(114, 216, 239, 0.3);
}

.browser-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #666;
    text-align: center;
    padding: 40px;
}

.browser-placeholder i {
    margin-bottom: 16px;
    opacity: 0.5;
}

.browser-placeholder p {
    margin: 0;
    font-size: 14px;
}

/* Browser Controls */
.browser-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(20, 22, 28, 0.5);
    border-radius: 8px;
}

.browser-control-btn {
    background: linear-gradient(135deg, #72D8EF 0%, #5ab0bf 100%);
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    color: #14161C;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.browser-control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(114, 216, 239, 0.4);
}

.browser-control-btn:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.status-indicator {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #444;
    color: #888;
    border: 1px solid #555;
}

.status-indicator.streaming {
    background: #e8f5e8;
    color: #2e7d32;
    border-color: #4caf50;
}

.status-indicator.error {
    background: #ffebee;
    color: #c62828;
    border-color: #f44336;
}

/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #72D8EF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments for browser stream */
@media (max-width: 768px) {
    .stream-controls {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .url-input {
        min-width: 200px;
    }
    
    .browser-controls {
        flex-wrap: wrap;
    }
    
    .browser-control-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
}